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

adler32_ssse3.c:adler32_len_16:
   29|     61|static inline uint32_t adler32_len_16(uint32_t adler, const uint8_t *buf, size_t len, uint32_t sum2) {
   30|    641|    while (len) {
  ------------------
  |  Branch (30:12): [True: 580, False: 61]
  ------------------
   31|    580|        --len;
   32|    580|        adler += *buf++;
   33|    580|        sum2 += adler;
   34|    580|    }
   35|     61|    adler %= BASE;
  ------------------
  |  |   11|     61|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   36|     61|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     61|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   37|       |    /* return recombined sums */
   38|     61|    return adler | (sum2 << 16);
   39|     61|}
adler32_sse42.c:adler32_copy_len_16:
   41|    117|static inline uint32_t adler32_copy_len_16(uint32_t adler, const uint8_t *buf, uint8_t *dst, size_t len, uint32_t sum2) {
   42|  1.06k|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 945, False: 117]
  ------------------
   43|    945|        *dst = *buf++;
   44|    945|        adler += *dst++;
   45|    945|        sum2 += adler;
   46|    945|    }
   47|    117|    adler %= BASE;
  ------------------
  |  |   11|    117|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|    117|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|    117|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|    117|    return adler | (sum2 << 16);
   51|    117|}
adler32_avx2.c:adler32_copy_len_16:
   41|    203|static inline uint32_t adler32_copy_len_16(uint32_t adler, const uint8_t *buf, uint8_t *dst, size_t len, uint32_t sum2) {
   42|  1.47k|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 1.27k, False: 203]
  ------------------
   43|  1.27k|        *dst = *buf++;
   44|  1.27k|        adler += *dst++;
   45|  1.27k|        sum2 += adler;
   46|  1.27k|    }
   47|    203|    adler %= BASE;
  ------------------
  |  |   11|    203|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|    203|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|    203|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|    203|    return adler | (sum2 << 16);
   51|    203|}
adler32_avx2.c:adler32_len_16:
   29|     65|static inline uint32_t adler32_len_16(uint32_t adler, const uint8_t *buf, size_t len, uint32_t sum2) {
   30|    517|    while (len) {
  ------------------
  |  Branch (30:12): [True: 452, False: 65]
  ------------------
   31|    452|        --len;
   32|    452|        adler += *buf++;
   33|    452|        sum2 += adler;
   34|    452|    }
   35|     65|    adler %= BASE;
  ------------------
  |  |   11|     65|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   36|     65|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     65|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   37|       |    /* return recombined sums */
   38|     65|    return adler | (sum2 << 16);
   39|     65|}

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

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

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

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

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

chunkset_avx2.c:loadhalfchunk:
   91|    179|static inline void loadhalfchunk(uint8_t const *s, halfchunk_t *chunk) {
   92|    179|    *chunk = _mm_loadu_si128((__m128i *)s);
   93|    179|}
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|    743|static inline void storehalfchunk(uint8_t *out, halfchunk_t *chunk) {
   96|    743|    _mm_storeu_si128((__m128i *)out, *chunk);
   97|    743|}
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|  10.3k|static inline void chunkmemset_2(uint8_t *from, chunk_t *chunk) {
   23|  10.3k|    *chunk = _mm256_set1_epi16(zng_memread_2(from));
   24|  10.3k|}
chunkset_avx2.c:chunkmemset_4:
   26|  24.0k|static inline void chunkmemset_4(uint8_t *from, chunk_t *chunk) {
   27|  24.0k|    *chunk = _mm256_set1_epi32(zng_memread_4(from));
   28|  24.0k|}
chunkset_avx2.c:chunkmemset_8:
   30|  2.69k|static inline void chunkmemset_8(uint8_t *from, chunk_t *chunk) {
   31|  2.69k|    *chunk = _mm256_set1_epi64x(zng_memread_8(from));
   32|  2.69k|}
chunkset_avx2.c:chunkmemset_16:
   34|  1.83k|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.83k|    *chunk = _mm256_broadcastsi128_si256(_mm_loadu_si128((__m128i*)from));
   41|  1.83k|#endif
   42|  1.83k|}
chunkset_avx2.c:GET_CHUNK_MAG:
   52|  1.50k|static inline chunk_t GET_CHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
   53|  1.50k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
   54|  1.50k|    __m256i ret_vec;
   55|       |    /* While technically we only need to read 4 or 8 bytes into this vector register for a lot of cases, GCC is
   56|       |     * compiling this to a shared load for all branches, preferring the simpler code.  Given that the buf value isn't in
   57|       |     * GPRs to begin with the 256 bit load is _probably_ just as inexpensive */
   58|  1.50k|    *chunk_rem = lut_rem.remval;
   59|       |
   60|       |    /* See note in chunkset_ssse3.c for why this is ok */
   61|  1.50k|    __msan_unpoison(buf + dist, 32 - dist);
  ------------------
  |  |  338|  1.50k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.50k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.50k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 1.50k]
  |  |  ------------------
  ------------------
   62|       |
   63|  1.50k|    if (dist < 16) {
  ------------------
  |  Branch (63:9): [True: 1.28k, False: 228]
  ------------------
   64|       |        /* This simpler case still requires us to shuffle in 128 bit lanes, so we must apply a static offset after
   65|       |         * broadcasting the first vector register to both halves. This is _marginally_ faster than doing two separate
   66|       |         * shuffles and combining the halves later */
   67|  1.28k|        const __m256i permute_xform =
   68|  1.28k|            _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   69|  1.28k|                             16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16);
   70|  1.28k|        __m256i perm_vec = _mm256_load_si256((__m256i*)(permute_table+lut_rem.idx));
   71|  1.28k|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   72|  1.28k|        perm_vec = _mm256_add_epi8(perm_vec, permute_xform);
   73|  1.28k|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), ret_vec0, 1);
   74|  1.28k|        ret_vec = _mm256_shuffle_epi8(ret_vec, perm_vec);
   75|  1.28k|    }  else {
   76|    228|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   77|    228|        __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|    228|        __m128i perm_vec1 = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
   80|    228|        __m128i xlane_permutes = _mm_cmpgt_epi8(_mm_set1_epi8(16), perm_vec1);
   81|    228|        __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|    228|        __m128i latter_half = _mm_blendv_epi8(ret_vec1, xlane_res, xlane_permutes);
   85|    228|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), latter_half, 1);
   86|    228|    }
   87|       |
   88|  1.50k|    return ret_vec;
   89|  1.50k|}
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|   120k|static inline void loadchunk(uint8_t const *s, chunk_t *chunk) {
   45|   120k|    *chunk = _mm256_loadu_si256((__m256i *)s);
   46|   120k|}

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.87k|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.87k|    len = MIN(len, left);
  ------------------
  |  |  124|  3.87k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 3.87k]
  |  |  ------------------
  ------------------
  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.87k|#ifndef HAVE_MASKED_READWRITE
  247|  3.87k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  3.87k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 507, False: 3.36k]
  |  |  ------------------
  ------------------
  248|  4.04k|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 3.53k, False: 507]
  ------------------
  249|  3.53k|            *out++ = *from++;
  250|  3.53k|            --len;
  251|  3.53k|        }
  252|       |
  253|    507|        return out;
  254|    507|    }
  255|  3.36k|#endif
  256|       |
  257|  3.36k|    if (len)
  ------------------
  |  Branch (257:9): [True: 3.36k, False: 0]
  ------------------
  258|  3.36k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  3.36k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  3.36k|    return out;
  261|  3.87k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|  68.1k|static inline uint8_t* CHUNKMEMSET(uint8_t *out, uint8_t *from, unsigned len) {
  113|       |    /* Debug performance related issues when len < sizeof(uint64_t):
  114|       |       Assert(len >= sizeof(uint64_t), "chunkmemset should be called on larger chunks"); */
  115|  68.1k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|  68.1k|    chunk_t chunk_load;
  118|  68.1k|    uint32_t chunk_mod = 0;
  119|  68.1k|    uint32_t adv_amount;
  120|  68.1k|    int64_t sdist = out - from;
  121|  68.1k|    uint64_t dist = llabs(sdist);
  122|       |
  123|       |    /* We are supporting the case for when we are reading bytes from ahead in the buffer.
  124|       |     * We now have to handle this, though it wasn't _quite_ clear if this rare circumstance
  125|       |     * always needed to be handled here or if we're just now seeing it because we are
  126|       |     * dispatching to this function, more */
  127|  68.1k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 68.1k]
  |  Branch (127:22): [True: 0, False: 0]
  ------------------
  128|       |#ifdef HAVE_MASKED_READWRITE
  129|       |        /* We can still handle this case if we can mitigate over writing _and_ we
  130|       |         * fit the entirety of the copy length with one load */
  131|       |        if (len <= sizeof(chunk_t)) {
  132|       |            /* Tempting to add a goto to the block below but hopefully most compilers
  133|       |             * collapse these identical code segments as one label to jump to */
  134|       |            return CHUNKCOPY(out, from, len);
  135|       |        }
  136|       |#endif
  137|       |        /* Here the memmove semantics match perfectly, as when this happens we are
  138|       |         * effectively sliding down the contents of memory by dist bytes */
  139|      0|        memmove(out, from, len);
  140|      0|        return out + len;
  141|      0|    }
  142|       |
  143|  68.1k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 16.8k, False: 51.3k]
  ------------------
  144|  16.8k|        memset(out, *from, len);
  145|  16.8k|        return out + len;
  146|  51.3k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 319, False: 51.0k]
  ------------------
  147|    319|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    319|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    319|    }
  149|       |
  150|       |    /* Only AVX2+ as there's 128 bit vectors and 256 bit. We allow for shorter vector
  151|       |     * lengths because they serve to allow more cases to fall into chunkcopy, as the
  152|       |     * distance of the shorter length is still deemed a safe distance. We rewrite this
  153|       |     * here rather than calling the ssse3 variant directly now because doing so required
  154|       |     * dispatching to another function and broke inlining for this function entirely. We
  155|       |     * also can merge an assert and some remainder peeling behavior into the same code blocks,
  156|       |     * making the code a little smaller.  */
  157|  51.0k|#ifdef HAVE_HALF_CHUNK
  158|  51.0k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 43.5k, False: 7.45k]
  ------------------
  159|  43.5k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 179, False: 43.3k]
  ------------------
  160|    179|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  43.3k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 9.66k, False: 33.7k]
  |  Branch (162:32): [True: 748, False: 32.9k]
  ------------------
  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: 564, False: 9.84k]
  ------------------
  166|    564|                storehalfchunk(out, &halfchunk_load);
  167|    564|                len -= sizeof(halfchunk_t);
  168|    564|                out += sizeof(halfchunk_t);
  169|    564|            }
  170|       |
  171|  10.4k|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|  10.4k|            goto rem_bytes;
  173|  10.4k|        }
  174|  43.3k|    }
  175|  40.4k|#endif
  176|       |
  177|  40.4k|#ifdef HAVE_CHUNKMEMSET_2
  178|  40.4k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 10.3k, False: 30.0k]
  ------------------
  179|  10.3k|        chunkmemset_2(from, &chunk_load);
  180|  10.3k|    } else
  181|  30.0k|#endif
  182|  30.0k|#ifdef HAVE_CHUNKMEMSET_4
  183|  30.0k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 24.0k, False: 6.03k]
  ------------------
  184|  24.0k|        chunkmemset_4(from, &chunk_load);
  185|  24.0k|    } else
  186|  6.03k|#endif
  187|  6.03k|#ifdef HAVE_CHUNKMEMSET_8
  188|  6.03k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 2.69k, False: 3.34k]
  ------------------
  189|  2.69k|        chunkmemset_8(from, &chunk_load);
  190|  2.69k|    } else
  191|  3.34k|#endif
  192|  3.34k|#ifdef HAVE_CHUNKMEMSET_16
  193|  3.34k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 1.83k, False: 1.50k]
  ------------------
  194|  1.83k|        chunkmemset_16(from, &chunk_load);
  195|  1.83k|    } else
  196|  1.50k|#endif
  197|  1.50k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  40.4k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  44.4k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 4.03k, False: 40.4k]
  ------------------
  202|  4.03k|        storechunk(out, &chunk_load);
  203|  4.03k|        storechunk(out + adv_amount, &chunk_load);
  204|  4.03k|        out += 2 * adv_amount;
  205|  4.03k|        len -= 2 * adv_amount;
  206|  4.03k|    }
  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|  45.2k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 4.83k, False: 40.4k]
  ------------------
  213|  4.83k|        storechunk(out, &chunk_load);
  214|  4.83k|        len -= adv_amount;
  215|  4.83k|        out += adv_amount;
  216|  4.83k|    }
  217|       |
  218|  40.4k|#ifdef HAVE_HALF_CHUNK
  219|  50.8k|rem_bytes:
  220|  50.8k|#endif
  221|  50.8k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 50.2k, False: 586]
  ------------------
  222|  50.2k|        memcpy(out, &chunk_load, len);
  223|  50.2k|        out += len;
  224|  50.2k|    }
  225|       |
  226|  50.8k|    return out;
  227|  40.4k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|    179|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|    179|    halfchunk_t chunk;
   93|    179|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|    179|    loadhalfchunk(from, &chunk);
   95|    179|    storehalfchunk(out, &chunk);
   96|    179|    out += align;
   97|    179|    from += align;
   98|    179|    len -= align;
   99|    179|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 179]
  ------------------
  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|    179|    return out;
  107|    179|}
chunkset_avx2.c:chunksize_avx2:
    9|  66.8k|static inline size_t CHUNKSIZE(void) {
   10|  66.8k|    return sizeof(chunk_t);
   11|  66.8k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|   110k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|   110k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|   110k|    chunk_t chunk;
   27|   110k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|   110k|    loadchunk(from, &chunk);
   29|   110k|    storechunk(out, &chunk);
   30|   110k|    out += align;
   31|   110k|    from += align;
   32|   110k|    len -= align;
   33|   120k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 10.1k, False: 110k]
  ------------------
   34|  10.1k|        loadchunk(from, &chunk);
   35|  10.1k|        storechunk(out, &chunk);
   36|  10.1k|        out += sizeof(chunk_t);
   37|  10.1k|        from += sizeof(chunk_t);
   38|  10.1k|        len -= sizeof(chunk_t);
   39|  10.1k|    }
   40|   110k|    return out;
   41|   110k|}

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

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

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

zng_inflateResetKeep:
   61|  1.04k|int32_t Z_EXPORT PREFIX(inflateResetKeep)(PREFIX3(stream) *strm) {
   62|  1.04k|    struct inflate_state *state;
   63|       |
   64|  1.04k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (64:9): [True: 0, False: 1.04k]
  ------------------
   65|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   66|  1.04k|    state = (struct inflate_state *)strm->state;
   67|  1.04k|    strm->total_in = strm->total_out = state->total = 0;
   68|  1.04k|    strm->msg = NULL;
   69|  1.04k|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (69:9): [True: 1.04k, False: 0]
  ------------------
   70|  1.04k|        strm->adler = state->wrap & 1;
   71|  1.04k|    state->mode = HEAD;
   72|  1.04k|    state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|  1.04k|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
   73|  1.04k|    state->last = 0;
   74|  1.04k|    state->havedict = 0;
   75|  1.04k|    state->flags = -1;
   76|  1.04k|    state->head = NULL;
   77|  1.04k|    state->hold = 0;
   78|  1.04k|    state->bits = 0;
   79|  1.04k|    state->lencode = state->distcode = state->next = state->codes;
   80|  1.04k|    state->back = -1;
   81|       |#ifdef INFLATE_STRICT
   82|       |    state->dmax = 32768U;
   83|       |#endif
   84|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
   85|       |    state->sane = 1;
   86|       |#endif
   87|  1.04k|    INFLATE_RESET_KEEP_HOOK(strm);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   25|  1.04k|#  define INFLATE_RESET_KEEP_HOOK(strm) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (25:54): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
   88|  1.04k|    Tracev((stderr, "inflate: reset\n"));
   89|  1.04k|    return Z_OK;
  ------------------
  |  |  180|  1.04k|#define Z_OK            0
  ------------------
   90|  1.04k|}
zng_inflateReset:
   92|  1.04k|int32_t Z_EXPORT PREFIX(inflateReset)(PREFIX3(stream) *strm) {
   93|  1.04k|    struct inflate_state *state;
   94|       |
   95|  1.04k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (95:9): [True: 0, False: 1.04k]
  ------------------
   96|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   97|  1.04k|    state = (struct inflate_state *)strm->state;
   98|  1.04k|    state->wsize = 0;
   99|  1.04k|    state->whave = 0;
  100|  1.04k|    state->wnext = 0;
  101|  1.04k|    return PREFIX(inflateResetKeep)(strm);
  ------------------
  |  |   97|  1.04k|#  define PREFIX(x) zng_ ## x
  ------------------
  102|  1.04k|}
zng_inflateReset2:
  104|  1.04k|int32_t Z_EXPORT PREFIX(inflateReset2)(PREFIX3(stream) *strm, int32_t windowBits) {
  105|  1.04k|    int wrap;
  106|  1.04k|    struct inflate_state *state;
  107|       |
  108|       |    /* get the state */
  109|  1.04k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (109:9): [True: 0, False: 1.04k]
  ------------------
  110|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  111|  1.04k|    state = (struct inflate_state *)strm->state;
  112|       |
  113|       |    /* extract wrap request from windowBits parameter */
  114|  1.04k|    if (windowBits < 0) {
  ------------------
  |  Branch (114:9): [True: 0, False: 1.04k]
  ------------------
  115|      0|        wrap = 0;
  116|      0|        if (windowBits < -MAX_WBITS)
  ------------------
  |  |   39|      0|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  118|      0|        windowBits = -windowBits;
  119|  1.04k|    } else {
  120|  1.04k|        wrap = (windowBits >> 4) + 5;
  121|  1.04k|#ifdef GUNZIP
  122|  1.04k|        if (windowBits < 48)
  ------------------
  |  Branch (122:13): [True: 1.04k, False: 0]
  ------------------
  123|  1.04k|            windowBits &= MAX_WBITS;
  ------------------
  |  |   39|  1.04k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  124|  1.04k|#endif
  125|  1.04k|    }
  126|       |
  127|       |    /* set number of window bits */
  128|  1.04k|    if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   36|  2.09k|#  define MIN_WBITS   8  /* 256 LZ77 window */
  ------------------
                  if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   39|  1.04k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (128:9): [True: 1.04k, False: 0]
  |  Branch (128:24): [True: 0, False: 1.04k]
  |  Branch (128:50): [True: 0, False: 1.04k]
  ------------------
  129|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  130|       |
  131|       |    /* update state and reset the rest of it */
  132|  1.04k|    state->wrap = wrap;
  133|  1.04k|    state->wbits = (unsigned)windowBits;
  134|  1.04k|    return PREFIX(inflateReset)(strm);
  ------------------
  |  |   97|  1.04k|#  define PREFIX(x) zng_ ## x
  ------------------
  135|  1.04k|}
alloc_inflate:
  152|  1.04k|Z_INTERNAL inflate_allocs* alloc_inflate(PREFIX3(stream) *strm) {
  153|  1.04k|    int curr_size = 0;
  154|       |
  155|       |    /* Define sizes */
  156|  1.04k|    int window_size = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64); /* 64B padding for chunksize */
  ------------------
  |  |   23|  1.04k|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  157|  1.04k|    int state_size = sizeof(inflate_state);
  158|  1.04k|    int alloc_size = sizeof(inflate_allocs);
  159|       |
  160|       |    /* Calculate relative buffer positions and paddings */
  161|  1.04k|    LOGSZP("window", window_size, PAD_WINDOW(curr_size), PADSZ(curr_size,WINDOW_PAD_SIZE));
  162|  1.04k|    int window_pos = PAD_WINDOW(curr_size);
  ------------------
  |  |  465|  1.04k|#  define PAD_WINDOW            PAD_64
  |  |  ------------------
  |  |  |  |  245|  1.04k|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|  1.04k|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|  1.04k|    curr_size = window_pos + window_size;
  164|       |
  165|  1.04k|    LOGSZP("state", state_size, PAD_64(curr_size), PADSZ(curr_size,64));
  166|  1.04k|    int state_pos = PAD_64(curr_size);
  ------------------
  |  |  245|  1.04k|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|  1.04k|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  167|  1.04k|    curr_size = state_pos + state_size;
  168|       |
  169|  1.04k|    LOGSZP("alloc", alloc_size, PAD_16(curr_size), PADSZ(curr_size,16));
  170|  1.04k|    int alloc_pos = PAD_16(curr_size);
  ------------------
  |  |  244|  1.04k|#define PAD_16(bpos) ((bpos) + PADSZ((bpos),16))
  |  |  ------------------
  |  |  |  |  243|  1.04k|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  171|  1.04k|    curr_size = alloc_pos + alloc_size;
  172|       |
  173|       |    /* Add 64-1 or 4096-1 to allow window alignment, and round size of buffer up to multiple of 64 */
  174|  1.04k|    int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1));
  ------------------
  |  |  245|  1.04k|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|  1.04k|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  175|       |
  176|       |    /* Allocate buffer, align to 64-byte cacheline, and zerofill the resulting buffer */
  177|  1.04k|    char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size);
  178|  1.04k|    if (original_buf == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 1.04k]
  ------------------
  179|      0|        return NULL;
  180|       |
  181|  1.04k|    char *buff = (char *)HINT_ALIGNED_WINDOW((char *)PAD_WINDOW(original_buf));
  ------------------
  |  |  467|  1.04k|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|  1.04k|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|  1.04k|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.04k|    LOGSZPL("Buffer alloc", total_size, PADSZ((uintptr_t)original_buf,WINDOW_PAD_SIZE), PADSZ(curr_size,WINDOW_PAD_SIZE));
  183|       |
  184|       |    /* Initialize alloc_bufs */
  185|  1.04k|    inflate_allocs *alloc_bufs  = (struct inflate_allocs_s *)(buff + alloc_pos);
  186|  1.04k|    alloc_bufs->buf_start = original_buf;
  187|  1.04k|    alloc_bufs->zfree = strm->zfree;
  188|       |
  189|  1.04k|    alloc_bufs->window =  (unsigned char *)HINT_ALIGNED_WINDOW((buff + window_pos));
  ------------------
  |  |  467|  1.04k|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|  1.04k|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|  1.04k|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  1.04k|    alloc_bufs->state = (inflate_state *)HINT_ALIGNED_64((buff + state_pos));
  ------------------
  |  |  236|  1.04k|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  ------------------
  |  |  |  |  231|  1.04k|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  ------------------
  ------------------
  191|       |
  192|       |#ifdef Z_MEMORY_SANITIZER
  193|       |    /* This is _not_ to subvert the memory sanitizer but to instead unposion some
  194|       |       data we willingly and purposefully load uninitialized into vector registers
  195|       |       in order to safely read the last < chunksize bytes of the window. */
  196|       |    __msan_unpoison(alloc_bufs->window + window_size, 64);
  197|       |#endif
  198|       |
  199|  1.04k|    return alloc_bufs;
  200|  1.04k|}
free_inflate:
  205|  1.04k|Z_INTERNAL void free_inflate(PREFIX3(stream) *strm) {
  206|  1.04k|    struct inflate_state *state = (struct inflate_state *)strm->state;
  207|       |
  208|  1.04k|    if (state->alloc_bufs != NULL) {
  ------------------
  |  Branch (208:9): [True: 1.04k, False: 0]
  ------------------
  209|  1.04k|        inflate_allocs *alloc_bufs = state->alloc_bufs;
  210|  1.04k|        alloc_bufs->zfree(strm->opaque, alloc_bufs->buf_start);
  211|       |        strm->state = NULL;
  212|  1.04k|    }
  213|  1.04k|}
zng_inflateInit2:
  219|  1.04k|int32_t ZNG_CONDEXPORT PREFIX(inflateInit2)(PREFIX3(stream) *strm, int32_t windowBits) {
  220|  1.04k|    struct inflate_state *state;
  221|  1.04k|    int32_t ret;
  222|       |
  223|       |    /* Initialize functable */
  224|  1.04k|    FUNCTABLE_INIT;
  ------------------
  |  |   48|  1.04k|#  define FUNCTABLE_INIT if (functable.force_init()) {return Z_VERSION_ERROR;}
  |  |  ------------------
  |  |  |  |  188|      0|#define Z_VERSION_ERROR (-6)
  |  |  ------------------
  |  |  |  Branch (48:30): [True: 0, False: 1.04k]
  |  |  ------------------
  ------------------
  225|       |
  226|  1.04k|    if (strm == NULL)
  ------------------
  |  Branch (226:9): [True: 0, False: 1.04k]
  ------------------
  227|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  228|  1.04k|    strm->msg = NULL;                   /* in case we return an error */
  229|  1.04k|    if (strm->zalloc == NULL) {
  ------------------
  |  Branch (229:9): [True: 1.04k, False: 0]
  ------------------
  230|  1.04k|        strm->zalloc = PREFIX(zcalloc);
  ------------------
  |  |   97|  1.04k|#  define PREFIX(x) zng_ ## x
  ------------------
  231|  1.04k|        strm->opaque = NULL;
  232|  1.04k|    }
  233|  1.04k|    if (strm->zfree == NULL)
  ------------------
  |  Branch (233:9): [True: 1.04k, False: 0]
  ------------------
  234|  1.04k|        strm->zfree = PREFIX(zcfree);
  ------------------
  |  |   97|  1.04k|#  define PREFIX(x) zng_ ## x
  ------------------
  235|       |
  236|  1.04k|    inflate_allocs *alloc_bufs = alloc_inflate(strm);
  237|  1.04k|    if (alloc_bufs == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 1.04k]
  ------------------
  238|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  186|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  239|       |
  240|  1.04k|    state = alloc_bufs->state;
  241|  1.04k|    state->window = alloc_bufs->window;
  242|  1.04k|    state->alloc_bufs = alloc_bufs;
  243|  1.04k|    state->wbufsize = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64);
  ------------------
  |  |   23|  1.04k|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  244|  1.04k|    Tracev((stderr, "inflate: allocated\n"));
  245|       |
  246|  1.04k|    strm->state = (struct internal_state *)state;
  247|  1.04k|    state->strm = strm;
  248|  1.04k|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  249|  1.04k|    ret = PREFIX(inflateReset2)(strm, windowBits);
  ------------------
  |  |   97|  1.04k|#  define PREFIX(x) zng_ ## x
  ------------------
  250|  1.04k|    if (ret != Z_OK) {
  ------------------
  |  |  180|  1.04k|#define Z_OK            0
  ------------------
  |  Branch (250:9): [True: 0, False: 1.04k]
  ------------------
  251|      0|        free_inflate(strm);
  252|      0|    }
  253|  1.04k|    return ret;
  254|  1.04k|}
zng_inflateInit:
  257|  1.04k|int32_t Z_EXPORT PREFIX(inflateInit)(PREFIX3(stream) *strm) {
  258|  1.04k|    return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   97|  1.04k|#  define PREFIX(x) zng_ ## x
  ------------------
                  return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   35|  1.04k|#  define DEF_WBITS MAX_WBITS
  |  |  ------------------
  |  |  |  |   39|  1.04k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  |  |  ------------------
  ------------------
  259|  1.04k|}
zng_fixedtables:
  303|  12.8k|void Z_INTERNAL PREFIX(fixedtables)(struct inflate_state *state) {
  304|  12.8k|    state->lencode = lenfix;
  305|  12.8k|    state->lenbits = 9;
  306|  12.8k|    state->distcode = distfix;
  307|  12.8k|    state->distbits = 5;
  308|  12.8k|}
zng_inflate:
  475|  1.53k|int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
  476|  1.53k|    struct inflate_state *state;
  477|  1.53k|    const unsigned char *next;  /* next input */
  478|  1.53k|    unsigned char *put;         /* next output */
  479|  1.53k|    unsigned char *from;        /* where to copy match bytes from */
  480|  1.53k|    unsigned have, left;        /* available input and output */
  481|  1.53k|    uint64_t hold;              /* bit buffer */
  482|  1.53k|    unsigned bits;              /* bits in bit buffer */
  483|  1.53k|    uint32_t in, out;           /* save starting available input and output */
  484|  1.53k|    unsigned copy;              /* number of stored or match bytes to copy */
  485|  1.53k|    code here;                  /* current decoding table entry */
  486|  1.53k|    code last;                  /* parent table entry */
  487|  1.53k|    unsigned len;               /* length to copy for repeats, bits to drop */
  488|  1.53k|    int32_t ret;                /* return code */
  489|  1.53k|#ifdef GUNZIP
  490|  1.53k|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  491|  1.53k|#endif
  492|  1.53k|    static const uint16_t order[19] = /* permutation of code lengths */
  493|  1.53k|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  494|       |
  495|  1.53k|    if (inflateStateCheck(strm) || strm->next_out == NULL ||
  ------------------
  |  Branch (495:9): [True: 0, False: 1.53k]
  |  Branch (495:36): [True: 0, False: 1.53k]
  ------------------
  496|  1.53k|        (strm->next_in == NULL && strm->avail_in != 0))
  ------------------
  |  Branch (496:10): [True: 0, False: 1.53k]
  |  Branch (496:35): [True: 0, False: 0]
  ------------------
  497|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  498|       |
  499|  1.53k|    state = (struct inflate_state *)strm->state;
  500|  1.53k|    if (state->mode == TYPE)      /* skip check */
  ------------------
  |  Branch (500:9): [True: 5, False: 1.53k]
  ------------------
  501|      5|        state->mode = TYPEDO;
  502|  1.53k|    LOAD();
  ------------------
  |  |   77|  1.53k|    do { \
  |  |   78|  1.53k|        put = strm->next_out; \
  |  |   79|  1.53k|        left = strm->avail_out; \
  |  |   80|  1.53k|        next = strm->next_in; \
  |  |   81|  1.53k|        have = strm->avail_in; \
  |  |   82|  1.53k|        hold = state->hold; \
  |  |   83|  1.53k|        bits = state->bits; \
  |  |   84|  1.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 1.53k]
  |  |  ------------------
  ------------------
  503|  1.53k|    in = have;
  504|  1.53k|    out = left;
  505|  1.53k|    ret = Z_OK;
  ------------------
  |  |  180|  1.53k|#define Z_OK            0
  ------------------
  506|  1.53k|    for (;;)
  507|   112k|        switch (state->mode) {
  508|  1.05k|        case HEAD:
  ------------------
  |  Branch (508:9): [True: 1.05k, False: 111k]
  ------------------
  509|  1.05k|            if (state->wrap == 0) {
  ------------------
  |  Branch (509:17): [True: 0, False: 1.05k]
  ------------------
  510|      0|                state->mode = TYPEDO;
  511|      0|                break;
  512|      0|            }
  513|  1.05k|            NEEDBITS(16);
  ------------------
  |  |  107|  1.05k|    do { \
  |  |  108|  3.14k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 2.10k, False: 1.04k]
  |  |  ------------------
  |  |  109|  2.10k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  2.10k|    do { \
  |  |  |  |  387|  2.10k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 12, False: 2.08k]
  |  |  |  |  ------------------
  |  |  |  |  388|  2.10k|        have--; \
  |  |  |  |  389|  2.08k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  2.08k|        bits += 8; \
  |  |  |  |  391|  2.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 2.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  1.05k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  514|  1.04k|#ifdef GUNZIP
  515|  1.04k|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (515:17): [True: 0, False: 1.04k]
  |  Branch (515:38): [True: 0, False: 0]
  ------------------
  516|      0|                if (state->wbits == 0)
  ------------------
  |  Branch (516:21): [True: 0, False: 0]
  ------------------
  517|      0|                    state->wbits = MAX_WBITS;
  ------------------
  |  |   39|      0|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  518|      0|                state->check = CRC32_INITIAL_VALUE;
  ------------------
  |  |   66|      0|#define CRC32_INITIAL_VALUE   0 /* initial crc-32 hash value */
  ------------------
  519|      0|                CRC2(state->check, hold);
  ------------------
  |  |   59|      0|    do { \
  |  |   60|      0|        hbuf[0] = (unsigned char)(word); \
  |  |   61|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |   62|      0|        check = PREFIX(crc32)(check, hbuf, 2); \
  |  |  ------------------
  |  |  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  |  |  ------------------
  |  |   63|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (63:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  520|      0|                INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  521|      0|                state->mode = FLAGS;
  522|      0|                break;
  523|      0|            }
  524|  1.04k|            if (state->head != NULL)
  ------------------
  |  Branch (524:17): [True: 0, False: 1.04k]
  ------------------
  525|      0|                state->head->done = -1;
  526|  1.04k|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (526:17): [True: 0, False: 1.04k]
  ------------------
  527|       |#else
  528|       |            if (
  529|       |#endif
  530|  1.04k|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  114|  1.04k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  |  Branch (530:17): [True: 20, False: 1.02k]
  ------------------
  531|     20|                SET_BAD("incorrect header check");
  ------------------
  |  |  132|     20|    do { \
  |  |  133|     20|        state->mode = BAD; \
  |  |  134|     20|        strm->msg = (char *)errmsg; \
  |  |  135|     20|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 20]
  |  |  ------------------
  ------------------
  532|     20|                break;
  533|     20|            }
  534|  1.02k|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  114|  1.02k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  212|  1.02k|#define Z_DEFLATED   8
  ------------------
  |  Branch (534:17): [True: 7, False: 1.01k]
  ------------------
  535|      7|                SET_BAD("unknown compression method");
  ------------------
  |  |  132|      7|    do { \
  |  |  133|      7|        state->mode = BAD; \
  |  |  134|      7|        strm->msg = (char *)errmsg; \
  |  |  135|      7|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 7]
  |  |  ------------------
  ------------------
  536|      7|                break;
  537|      7|            }
  538|  1.01k|            DROPBITS(4);
  ------------------
  |  |  118|  1.01k|    do { \
  |  |  119|  1.01k|        hold >>= (n); \
  |  |  120|  1.01k|        bits -= (unsigned)(n); \
  |  |  121|  1.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 1.01k]
  |  |  ------------------
  ------------------
  539|  1.01k|            len = BITS(4) + 8;
  ------------------
  |  |  114|  1.01k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  540|  1.01k|            if (state->wbits == 0)
  ------------------
  |  Branch (540:17): [True: 0, False: 1.01k]
  ------------------
  541|      0|                state->wbits = len;
  542|  1.01k|            if (len > MAX_WBITS || len > state->wbits) {
  ------------------
  |  |   39|  2.02k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (542:17): [True: 1, False: 1.01k]
  |  Branch (542:36): [True: 0, False: 1.01k]
  ------------------
  543|      1|                SET_BAD("invalid window size");
  ------------------
  |  |  132|      1|    do { \
  |  |  133|      1|        state->mode = BAD; \
  |  |  134|      1|        strm->msg = (char *)errmsg; \
  |  |  135|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  544|      1|                break;
  545|      1|            }
  546|       |#ifdef INFLATE_STRICT
  547|       |            state->dmax = 1U << len;
  548|       |#endif
  549|  1.01k|            state->flags = 0;               /* indicate zlib header */
  550|  1.01k|            Tracev((stderr, "inflate:   zlib header ok\n"));
  551|  1.01k|            strm->adler = state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|  1.01k|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
  552|  1.01k|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (552:27): [True: 6, False: 1.00k]
  ------------------
  553|  1.01k|            INITBITS();
  ------------------
  |  |   99|  1.01k|    do { \
  |  |  100|  1.01k|        hold = 0; \
  |  |  101|  1.01k|        bits = 0; \
  |  |  102|  1.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 1.01k]
  |  |  ------------------
  ------------------
  554|  1.01k|            break;
  555|      0|#ifdef GUNZIP
  556|       |
  557|      0|        case FLAGS:
  ------------------
  |  Branch (557:9): [True: 0, False: 112k]
  ------------------
  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: 112k]
  ------------------
  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: 112k]
  ------------------
  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: 112k]
  ------------------
  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: 112k]
  ------------------
  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: 112k]
  ------------------
  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: 112k]
  ------------------
  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: 112k]
  ------------------
  686|      0|            if (state->flags & 0x0200) {
  ------------------
  |  Branch (686:17): [True: 0, False: 0]
  ------------------
  687|      0|                NEEDBITS(16);
  ------------------
  |  |  107|      0|    do { \
  |  |  108|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|      0|    do { \
  |  |  |  |  387|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  388|      0|        have--; \
  |  |  |  |  389|      0|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      0|        bits += 8; \
  |  |  |  |  391|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  688|      0|                if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
  ------------------
  |  Branch (688:21): [True: 0, False: 0]
  |  Branch (688:42): [True: 0, False: 0]
  ------------------
  689|      0|                    SET_BAD("header crc mismatch");
  ------------------
  |  |  132|      0|    do { \
  |  |  133|      0|        state->mode = BAD; \
  |  |  134|      0|        strm->msg = (char *)errmsg; \
  |  |  135|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  690|      0|                    break;
  691|      0|                }
  692|      0|                INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  693|      0|            }
  694|      0|            if (state->head != NULL) {
  ------------------
  |  Branch (694:17): [True: 0, False: 0]
  ------------------
  695|      0|                state->head->hcrc = (int)((state->flags >> 9) & 1);
  696|      0|                state->head->done = 1;
  697|      0|            }
  698|       |            /* compute crc32 checksum if not in raw mode */
  699|      0|            if ((state->wrap & 4) && state->flags)
  ------------------
  |  Branch (699:17): [True: 0, False: 0]
  |  Branch (699:38): [True: 0, False: 0]
  ------------------
  700|      0|                strm->adler = state->check = FUNCTABLE_CALL(crc32_fold_reset)(&state->crc_fold);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
  701|      0|            state->mode = TYPE;
  702|      0|            break;
  703|      0|#endif
  704|     10|        case DICTID:
  ------------------
  |  Branch (704:9): [True: 10, False: 112k]
  ------------------
  705|     10|            NEEDBITS(32);
  ------------------
  |  |  107|     10|    do { \
  |  |  108|     24|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 22, False: 2]
  |  |  ------------------
  |  |  109|     22|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|     22|    do { \
  |  |  |  |  387|     22|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 8, False: 14]
  |  |  |  |  ------------------
  |  |  |  |  388|     22|        have--; \
  |  |  |  |  389|     14|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|     14|        bits += 8; \
  |  |  |  |  391|     14|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     10|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  706|      2|            strm->adler = state->check = ZSWAP32((unsigned)hold);
  ------------------
  |  |  170|      2|#  define ZSWAP32(q) __builtin_bswap32(q)
  ------------------
  707|      2|            INITBITS();
  ------------------
  |  |   99|      2|    do { \
  |  |  100|      2|        hold = 0; \
  |  |  101|      2|        bits = 0; \
  |  |  102|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  708|      2|            state->mode = DICT;
  709|      2|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      2|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  710|       |
  711|      2|        case DICT:
  ------------------
  |  Branch (711:9): [True: 0, False: 112k]
  ------------------
  712|      2|            if (state->havedict == 0) {
  ------------------
  |  Branch (712:17): [True: 2, False: 0]
  ------------------
  713|      2|                RESTORE();
  ------------------
  |  |   88|      2|    do { \
  |  |   89|      2|        strm->next_out = put; \
  |  |   90|      2|        strm->avail_out = left; \
  |  |   91|      2|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|      2|        strm->avail_in = have; \
  |  |   93|      2|        state->hold = hold; \
  |  |   94|      2|        state->bits = bits; \
  |  |   95|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  714|      2|                return Z_NEED_DICT;
  ------------------
  |  |  182|      2|#define Z_NEED_DICT     2
  ------------------
  715|      2|            }
  716|      0|            strm->adler = state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|      0|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
  717|      0|            state->mode = TYPE;
  718|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  719|       |
  720|  31.4k|        case TYPE:
  ------------------
  |  Branch (720:9): [True: 31.4k, False: 81.2k]
  ------------------
  721|  31.4k|            if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  176|  62.9k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  177|  31.4k|#define Z_TREES         6
  ------------------
  |  Branch (721:17): [True: 0, False: 31.4k]
  |  Branch (721:37): [True: 0, False: 31.4k]
  ------------------
  722|      0|                goto inf_leave;
  723|  31.4k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  31.4k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  724|       |
  725|  31.5k|        case TYPEDO:
  ------------------
  |  Branch (725:9): [True: 5, False: 112k]
  ------------------
  726|       |            /* determine and dispatch block type */
  727|  31.5k|            INFLATE_TYPEDO_HOOK(strm, flush);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   29|  31.5k|#  define INFLATE_TYPEDO_HOOK(strm, flush) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (29:57): [Folded, False: 31.5k]
  |  |  ------------------
  ------------------
  728|  31.5k|            if (state->last) {
  ------------------
  |  Branch (728:17): [True: 131, False: 31.3k]
  ------------------
  729|    131|                BYTEBITS();
  ------------------
  |  |  125|    131|    do { \
  |  |  126|    131|        hold >>= bits & 7; \
  |  |  127|    131|        bits -= bits & 7; \
  |  |  128|    131|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 131]
  |  |  ------------------
  ------------------
  730|    131|                state->mode = CHECK;
  731|    131|                break;
  732|    131|            }
  733|  31.3k|            NEEDBITS(3);
  ------------------
  |  |  107|  31.3k|    do { \
  |  |  108|  52.4k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 21.1k, False: 31.3k]
  |  |  ------------------
  |  |  109|  31.3k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  21.1k|    do { \
  |  |  |  |  387|  21.1k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 10, False: 21.1k]
  |  |  |  |  ------------------
  |  |  |  |  388|  21.1k|        have--; \
  |  |  |  |  389|  21.1k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  21.1k|        bits += 8; \
  |  |  |  |  391|  21.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 21.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  31.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 31.3k]
  |  |  ------------------
  ------------------
  734|  31.3k|            state->last = BITS(1);
  ------------------
  |  |  114|  31.3k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  735|  31.3k|            DROPBITS(1);
  ------------------
  |  |  118|  31.3k|    do { \
  |  |  119|  31.3k|        hold >>= (n); \
  |  |  120|  31.3k|        bits -= (unsigned)(n); \
  |  |  121|  31.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 31.3k]
  |  |  ------------------
  ------------------
  736|  31.3k|            switch (BITS(2)) {
  ------------------
  |  |  114|  31.3k|    (hold & ((1U << (unsigned)(n)) - 1))
  |  |  ------------------
  |  |  |  Branch (114:5): [True: 31.3k, False: 0]
  |  |  ------------------
  ------------------
  737|  8.59k|            case 0:                             /* stored block */
  ------------------
  |  Branch (737:13): [True: 8.59k, False: 22.7k]
  ------------------
  738|  8.59k|                Tracev((stderr, "inflate:     stored block%s\n", state->last ? " (last)" : ""));
  739|  8.59k|                state->mode = STORED;
  740|  8.59k|                break;
  741|  12.8k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (741:13): [True: 12.8k, False: 18.4k]
  ------------------
  742|  12.8k|                PREFIX(fixedtables)(state);
  ------------------
  |  |   97|  12.8k|#  define PREFIX(x) zng_ ## x
  ------------------
  743|  12.8k|                Tracev((stderr, "inflate:     fixed codes block%s\n", state->last ? " (last)" : ""));
  744|  12.8k|                state->mode = LEN_;             /* decode codes */
  745|  12.8k|                if (flush == Z_TREES) {
  ------------------
  |  |  177|  12.8k|#define Z_TREES         6
  ------------------
  |  Branch (745:21): [True: 0, False: 12.8k]
  ------------------
  746|      0|                    DROPBITS(2);
  ------------------
  |  |  118|      0|    do { \
  |  |  119|      0|        hold >>= (n); \
  |  |  120|      0|        bits -= (unsigned)(n); \
  |  |  121|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  747|      0|                    goto inf_leave;
  748|      0|                }
  749|  12.8k|                break;
  750|  12.8k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (750:13): [True: 9.87k, False: 21.4k]
  ------------------
  751|  9.87k|                Tracev((stderr, "inflate:     dynamic codes block%s\n", state->last ? " (last)" : ""));
  752|  9.87k|                state->mode = TABLE;
  753|  9.87k|                break;
  754|      8|            case 3:
  ------------------
  |  Branch (754:13): [True: 8, False: 31.3k]
  ------------------
  755|      8|                SET_BAD("invalid block type");
  ------------------
  |  |  132|      8|    do { \
  |  |  133|      8|        state->mode = BAD; \
  |  |  134|      8|        strm->msg = (char *)errmsg; \
  |  |  135|      8|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 8]
  |  |  ------------------
  ------------------
  756|  31.3k|            }
  757|  31.3k|            DROPBITS(2);
  ------------------
  |  |  118|  31.3k|    do { \
  |  |  119|  31.3k|        hold >>= (n); \
  |  |  120|  31.3k|        bits -= (unsigned)(n); \
  |  |  121|  31.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 31.3k]
  |  |  ------------------
  ------------------
  758|  31.3k|            break;
  759|       |
  760|  8.61k|        case STORED:
  ------------------
  |  Branch (760:9): [True: 8.61k, False: 104k]
  ------------------
  761|       |            /* get and verify stored block length */
  762|  8.61k|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  125|  8.61k|    do { \
  |  |  126|  8.61k|        hold >>= bits & 7; \
  |  |  127|  8.61k|        bits -= bits & 7; \
  |  |  128|  8.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 8.61k]
  |  |  ------------------
  ------------------
  763|  8.61k|            NEEDBITS(32);
  ------------------
  |  |  107|  8.61k|    do { \
  |  |  108|  42.9k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 34.3k, False: 8.57k]
  |  |  ------------------
  |  |  109|  34.3k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  34.3k|    do { \
  |  |  |  |  387|  34.3k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 36, False: 34.3k]
  |  |  |  |  ------------------
  |  |  |  |  388|  34.3k|        have--; \
  |  |  |  |  389|  34.3k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  34.3k|        bits += 8; \
  |  |  |  |  391|  34.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 34.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 8.57k]
  |  |  ------------------
  ------------------
  764|  8.57k|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (764:17): [True: 50, False: 8.52k]
  ------------------
  765|     50|                SET_BAD("invalid stored block lengths");
  ------------------
  |  |  132|     50|    do { \
  |  |  133|     50|        state->mode = BAD; \
  |  |  134|     50|        strm->msg = (char *)errmsg; \
  |  |  135|     50|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 50]
  |  |  ------------------
  ------------------
  766|     50|                break;
  767|     50|            }
  768|  8.52k|            state->length = (uint16_t)hold;
  769|  8.52k|            Tracev((stderr, "inflate:       stored length %u\n", state->length));
  770|  8.52k|            INITBITS();
  ------------------
  |  |   99|  8.52k|    do { \
  |  |  100|  8.52k|        hold = 0; \
  |  |  101|  8.52k|        bits = 0; \
  |  |  102|  8.52k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 8.52k]
  |  |  ------------------
  ------------------
  771|  8.52k|            state->mode = COPY_;
  772|  8.52k|            if (flush == Z_TREES)
  ------------------
  |  |  177|  8.52k|#define Z_TREES         6
  ------------------
  |  Branch (772:17): [True: 0, False: 8.52k]
  ------------------
  773|      0|                goto inf_leave;
  774|  8.52k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  8.52k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  775|       |
  776|  8.52k|        case COPY_:
  ------------------
  |  Branch (776:9): [True: 0, False: 112k]
  ------------------
  777|  8.52k|            state->mode = COPY;
  778|  8.52k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  8.52k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  779|       |
  780|  8.75k|        case COPY:
  ------------------
  |  Branch (780:9): [True: 229, False: 112k]
  ------------------
  781|       |            /* copy stored block from input to output */
  782|  8.75k|            copy = state->length;
  783|  8.75k|            if (copy) {
  ------------------
  |  Branch (783:17): [True: 266, False: 8.48k]
  ------------------
  784|    266|                copy = MIN(copy, have);
  ------------------
  |  |  124|    266|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 97, False: 169]
  |  |  ------------------
  ------------------
  785|    266|                copy = MIN(copy, left);
  ------------------
  |  |  124|    266|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 54, False: 212]
  |  |  ------------------
  ------------------
  786|    266|                if (copy == 0)
  ------------------
  |  Branch (786:21): [True: 74, False: 192]
  ------------------
  787|     74|                    goto inf_leave;
  788|    192|                memcpy(put, next, copy);
  789|    192|                have -= copy;
  790|    192|                next += copy;
  791|    192|                left -= copy;
  792|    192|                put += copy;
  793|    192|                state->length -= copy;
  794|    192|                break;
  795|    266|            }
  796|  8.48k|            Tracev((stderr, "inflate:       stored end\n"));
  797|  8.48k|            state->mode = TYPE;
  798|  8.48k|            break;
  799|       |
  800|  9.88k|        case TABLE:
  ------------------
  |  Branch (800:9): [True: 9.88k, False: 102k]
  ------------------
  801|       |            /* get dynamic table entries descriptor */
  802|  9.88k|            NEEDBITS(14);
  ------------------
  |  |  107|  9.88k|    do { \
  |  |  108|  29.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 19.7k, False: 9.87k]
  |  |  ------------------
  |  |  109|  19.7k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  19.7k|    do { \
  |  |  |  |  387|  19.7k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 6, False: 19.7k]
  |  |  |  |  ------------------
  |  |  |  |  388|  19.7k|        have--; \
  |  |  |  |  389|  19.7k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  19.7k|        bits += 8; \
  |  |  |  |  391|  19.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  9.88k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 9.87k]
  |  |  ------------------
  ------------------
  803|  9.87k|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  114|  9.87k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  804|  9.87k|            DROPBITS(5);
  ------------------
  |  |  118|  9.87k|    do { \
  |  |  119|  9.87k|        hold >>= (n); \
  |  |  120|  9.87k|        bits -= (unsigned)(n); \
  |  |  121|  9.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 9.87k]
  |  |  ------------------
  ------------------
  805|  9.87k|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  114|  9.87k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  806|  9.87k|            DROPBITS(5);
  ------------------
  |  |  118|  9.87k|    do { \
  |  |  119|  9.87k|        hold >>= (n); \
  |  |  120|  9.87k|        bits -= (unsigned)(n); \
  |  |  121|  9.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 9.87k]
  |  |  ------------------
  ------------------
  807|  9.87k|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  114|  9.87k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  808|  9.87k|            DROPBITS(4);
  ------------------
  |  |  118|  9.87k|    do { \
  |  |  119|  9.87k|        hold >>= (n); \
  |  |  120|  9.87k|        bits -= (unsigned)(n); \
  |  |  121|  9.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 9.87k]
  |  |  ------------------
  ------------------
  809|  9.87k|#ifndef PKZIP_BUG_WORKAROUND
  810|  9.87k|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (810:17): [True: 4, False: 9.87k]
  |  Branch (810:38): [True: 1, False: 9.87k]
  ------------------
  811|      5|                SET_BAD("too many length or distance symbols");
  ------------------
  |  |  132|      5|    do { \
  |  |  133|      5|        state->mode = BAD; \
  |  |  134|      5|        strm->msg = (char *)errmsg; \
  |  |  135|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
  812|      5|                break;
  813|      5|            }
  814|  9.87k|#endif
  815|  9.87k|            Tracev((stderr, "inflate:       table sizes ok\n"));
  816|  9.87k|            state->have = 0;
  817|  9.87k|            state->mode = LENLENS;
  818|  9.87k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  9.87k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  819|       |
  820|  9.87k|        case LENLENS:
  ------------------
  |  Branch (820:9): [True: 9, False: 112k]
  ------------------
  821|       |            /* get code length code lengths (not a typo) */
  822|   174k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (822:20): [True: 164k, False: 9.86k]
  ------------------
  823|   164k|                NEEDBITS(3);
  ------------------
  |  |  107|   164k|    do { \
  |  |  108|   219k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 54.5k, False: 164k]
  |  |  ------------------
  |  |  109|   164k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  54.5k|    do { \
  |  |  |  |  387|  54.5k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 18, False: 54.5k]
  |  |  |  |  ------------------
  |  |  |  |  388|  54.5k|        have--; \
  |  |  |  |  389|  54.5k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  54.5k|        bits += 8; \
  |  |  |  |  391|  54.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 54.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   164k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 164k]
  |  |  ------------------
  ------------------
  824|   164k|                state->lens[order[state->have++]] = (uint16_t)BITS(3);
  ------------------
  |  |  114|   164k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  825|   164k|                DROPBITS(3);
  ------------------
  |  |  118|   164k|    do { \
  |  |  119|   164k|        hold >>= (n); \
  |  |  120|   164k|        bits -= (unsigned)(n); \
  |  |  121|   164k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 164k]
  |  |  ------------------
  ------------------
  826|   164k|            }
  827|  32.7k|            while (state->have < 19)
  ------------------
  |  Branch (827:20): [True: 22.9k, False: 9.86k]
  ------------------
  828|  22.9k|                state->lens[order[state->have++]] = 0;
  829|  9.86k|            state->next = state->codes;
  830|  9.86k|            state->lencode = (const code *)(state->next);
  831|  9.86k|            state->lenbits = 7;
  832|  9.86k|            ret = zng_inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work);
  833|  9.86k|            if (ret) {
  ------------------
  |  Branch (833:17): [True: 38, False: 9.82k]
  ------------------
  834|     38|                SET_BAD("invalid code lengths set");
  ------------------
  |  |  132|     38|    do { \
  |  |  133|     38|        state->mode = BAD; \
  |  |  134|     38|        strm->msg = (char *)errmsg; \
  |  |  135|     38|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 38]
  |  |  ------------------
  ------------------
  835|     38|                break;
  836|     38|            }
  837|  9.82k|            Tracev((stderr, "inflate:       code lengths ok\n"));
  838|  9.82k|            state->have = 0;
  839|  9.82k|            state->mode = CODELENS;
  840|  9.82k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  9.82k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  841|       |
  842|  9.90k|        case CODELENS:
  ------------------
  |  Branch (842:9): [True: 79, False: 112k]
  ------------------
  843|       |            /* get length and distance code code lengths */
  844|  1.39M|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (844:20): [True: 1.38M, False: 9.71k]
  ------------------
  845|  1.70M|                for (;;) {
  846|  1.70M|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  1.70M|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  847|  1.70M|                    if (here.bits <= bits) break;
  ------------------
  |  Branch (847:25): [True: 1.38M, False: 319k]
  ------------------
  848|   319k|                    PULLBYTE();
  ------------------
  |  |  386|   319k|    do { \
  |  |  387|   319k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 90, False: 319k]
  |  |  ------------------
  |  |  388|   319k|        have--; \
  |  |  389|   319k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|   319k|        bits += 8; \
  |  |  391|   319k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 319k]
  |  |  ------------------
  ------------------
  849|   319k|                }
  850|  1.38M|                if (here.val < 16) {
  ------------------
  |  Branch (850:21): [True: 1.26M, False: 118k]
  ------------------
  851|  1.26M|                    DROPBITS(here.bits);
  ------------------
  |  |  118|  1.26M|    do { \
  |  |  119|  1.26M|        hold >>= (n); \
  |  |  120|  1.26M|        bits -= (unsigned)(n); \
  |  |  121|  1.26M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 1.26M]
  |  |  ------------------
  ------------------
  852|  1.26M|                    state->lens[state->have++] = here.val;
  853|  1.26M|                } else {
  854|   118k|                    if (here.val == 16) {
  ------------------
  |  Branch (854:25): [True: 28.2k, False: 89.9k]
  ------------------
  855|  28.2k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  107|  28.2k|    do { \
  |  |  108|  34.1k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 5.91k, False: 28.2k]
  |  |  ------------------
  |  |  109|  28.2k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  5.91k|    do { \
  |  |  |  |  387|  5.91k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 22, False: 5.89k]
  |  |  |  |  ------------------
  |  |  |  |  388|  5.91k|        have--; \
  |  |  |  |  389|  5.89k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  5.89k|        bits += 8; \
  |  |  |  |  391|  5.89k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 5.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  28.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 28.2k]
  |  |  ------------------
  ------------------
  856|  28.2k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  28.2k|    do { \
  |  |  119|  28.2k|        hold >>= (n); \
  |  |  120|  28.2k|        bits -= (unsigned)(n); \
  |  |  121|  28.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 28.2k]
  |  |  ------------------
  ------------------
  857|  28.2k|                        if (state->have == 0) {
  ------------------
  |  Branch (857:29): [True: 2, False: 28.2k]
  ------------------
  858|      2|                            SET_BAD("invalid bit length repeat");
  ------------------
  |  |  132|      2|    do { \
  |  |  133|      2|        state->mode = BAD; \
  |  |  134|      2|        strm->msg = (char *)errmsg; \
  |  |  135|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  859|      2|                            break;
  860|      2|                        }
  861|  28.2k|                        len = state->lens[state->have - 1];
  862|  28.2k|                        copy = 3 + BITS(2);
  ------------------
  |  |  114|  28.2k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  863|  28.2k|                        DROPBITS(2);
  ------------------
  |  |  118|  28.2k|    do { \
  |  |  119|  28.2k|        hold >>= (n); \
  |  |  120|  28.2k|        bits -= (unsigned)(n); \
  |  |  121|  28.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 28.2k]
  |  |  ------------------
  ------------------
  864|  89.9k|                    } else if (here.val == 17) {
  ------------------
  |  Branch (864:32): [True: 58.8k, False: 31.0k]
  ------------------
  865|  58.8k|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  107|  58.8k|    do { \
  |  |  108|  88.2k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 29.3k, False: 58.8k]
  |  |  ------------------
  |  |  109|  58.8k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  29.3k|    do { \
  |  |  |  |  387|  29.3k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 18, False: 29.3k]
  |  |  |  |  ------------------
  |  |  |  |  388|  29.3k|        have--; \
  |  |  |  |  389|  29.3k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  29.3k|        bits += 8; \
  |  |  |  |  391|  29.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 29.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  58.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 58.8k]
  |  |  ------------------
  ------------------
  866|  58.8k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  58.8k|    do { \
  |  |  119|  58.8k|        hold >>= (n); \
  |  |  120|  58.8k|        bits -= (unsigned)(n); \
  |  |  121|  58.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 58.8k]
  |  |  ------------------
  ------------------
  867|  58.8k|                        len = 0;
  868|  58.8k|                        copy = 3 + BITS(3);
  ------------------
  |  |  114|  58.8k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  869|  58.8k|                        DROPBITS(3);
  ------------------
  |  |  118|  58.8k|    do { \
  |  |  119|  58.8k|        hold >>= (n); \
  |  |  120|  58.8k|        bits -= (unsigned)(n); \
  |  |  121|  58.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 58.8k]
  |  |  ------------------
  ------------------
  870|  58.8k|                    } else {
  871|  31.0k|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  107|  31.0k|    do { \
  |  |  108|  62.0k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 30.9k, False: 31.0k]
  |  |  ------------------
  |  |  109|  31.0k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  30.9k|    do { \
  |  |  |  |  387|  30.9k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 28, False: 30.9k]
  |  |  |  |  ------------------
  |  |  |  |  388|  30.9k|        have--; \
  |  |  |  |  389|  30.9k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  30.9k|        bits += 8; \
  |  |  |  |  391|  30.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 30.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  31.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 31.0k]
  |  |  ------------------
  ------------------
  872|  31.0k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  31.0k|    do { \
  |  |  119|  31.0k|        hold >>= (n); \
  |  |  120|  31.0k|        bits -= (unsigned)(n); \
  |  |  121|  31.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 31.0k]
  |  |  ------------------
  ------------------
  873|  31.0k|                        len = 0;
  874|  31.0k|                        copy = 11 + BITS(7);
  ------------------
  |  |  114|  31.0k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  875|  31.0k|                        DROPBITS(7);
  ------------------
  |  |  118|  31.0k|    do { \
  |  |  119|  31.0k|        hold >>= (n); \
  |  |  120|  31.0k|        bits -= (unsigned)(n); \
  |  |  121|  31.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 31.0k]
  |  |  ------------------
  ------------------
  876|  31.0k|                    }
  877|   118k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (877:25): [True: 28, False: 118k]
  ------------------
  878|     28|                        SET_BAD("invalid bit length repeat");
  ------------------
  |  |  132|     28|    do { \
  |  |  133|     28|        state->mode = BAD; \
  |  |  134|     28|        strm->msg = (char *)errmsg; \
  |  |  135|     28|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 28]
  |  |  ------------------
  ------------------
  879|     28|                        break;
  880|     28|                    }
  881|  1.70M|                    while (copy) {
  ------------------
  |  Branch (881:28): [True: 1.58M, False: 118k]
  ------------------
  882|  1.58M|                        --copy;
  883|  1.58M|                        state->lens[state->have++] = (uint16_t)len;
  884|  1.58M|                    }
  885|   118k|                }
  886|  1.38M|            }
  887|       |
  888|       |            /* handle error breaks in while */
  889|  9.74k|            if (state->mode == BAD)
  ------------------
  |  Branch (889:17): [True: 30, False: 9.71k]
  ------------------
  890|     30|                break;
  891|       |
  892|       |            /* check for end-of-block code (better have one) */
  893|  9.71k|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (893:17): [True: 8, False: 9.70k]
  ------------------
  894|      8|                SET_BAD("invalid code -- missing end-of-block");
  ------------------
  |  |  132|      8|    do { \
  |  |  133|      8|        state->mode = BAD; \
  |  |  134|      8|        strm->msg = (char *)errmsg; \
  |  |  135|      8|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 8]
  |  |  ------------------
  ------------------
  895|      8|                break;
  896|      8|            }
  897|       |
  898|       |            /* build code tables -- note: do not change the lenbits or distbits
  899|       |               values here (10 and 9) without reading the comments in inftrees.h
  900|       |               concerning the ENOUGH constants, which depend on those values */
  901|  9.70k|            state->next = state->codes;
  902|  9.70k|            state->lencode = (const code *)(state->next);
  903|  9.70k|            state->lenbits = 10;
  904|  9.70k|            ret = zng_inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work);
  905|  9.70k|            if (ret) {
  ------------------
  |  Branch (905:17): [True: 111, False: 9.59k]
  ------------------
  906|    111|                SET_BAD("invalid literal/lengths set");
  ------------------
  |  |  132|    111|    do { \
  |  |  133|    111|        state->mode = BAD; \
  |  |  134|    111|        strm->msg = (char *)errmsg; \
  |  |  135|    111|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 111]
  |  |  ------------------
  ------------------
  907|    111|                break;
  908|    111|            }
  909|  9.59k|            state->distcode = (const code *)(state->next);
  910|  9.59k|            state->distbits = 9;
  911|  9.59k|            ret = zng_inflate_table(DISTS, state->lens + state->nlen, state->ndist,
  912|  9.59k|                            &(state->next), &(state->distbits), state->work);
  913|  9.59k|            if (ret) {
  ------------------
  |  Branch (913:17): [True: 34, False: 9.56k]
  ------------------
  914|     34|                SET_BAD("invalid distances set");
  ------------------
  |  |  132|     34|    do { \
  |  |  133|     34|        state->mode = BAD; \
  |  |  134|     34|        strm->msg = (char *)errmsg; \
  |  |  135|     34|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 34]
  |  |  ------------------
  ------------------
  915|     34|                break;
  916|     34|            }
  917|  9.56k|            Tracev((stderr, "inflate:       codes ok\n"));
  918|  9.56k|            state->mode = LEN_;
  919|  9.56k|            if (flush == Z_TREES)
  ------------------
  |  |  177|  9.56k|#define Z_TREES         6
  ------------------
  |  Branch (919:17): [True: 0, False: 9.56k]
  ------------------
  920|      0|                goto inf_leave;
  921|  9.56k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  9.56k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  922|       |
  923|  22.4k|        case LEN_:
  ------------------
  |  Branch (923:9): [True: 12.8k, False: 99.8k]
  ------------------
  924|  22.4k|            state->mode = LEN;
  925|  22.4k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  22.4k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  926|       |
  927|  48.2k|        case LEN:
  ------------------
  |  Branch (927:9): [True: 25.7k, False: 86.9k]
  ------------------
  928|       |            /* use inflate_fast() if we have enough input and output */
  929|  48.2k|            if (have >= INFLATE_FAST_MIN_HAVE && left >= INFLATE_FAST_MIN_LEFT) {
  ------------------
  |  |  137|  96.4k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
                          if (have >= INFLATE_FAST_MIN_HAVE && left >= INFLATE_FAST_MIN_LEFT) {
  ------------------
  |  |  138|  45.1k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (929:17): [True: 45.1k, False: 3.08k]
  |  Branch (929:50): [True: 21.8k, False: 23.2k]
  ------------------
  930|  21.8k|                RESTORE();
  ------------------
  |  |   88|  21.8k|    do { \
  |  |   89|  21.8k|        strm->next_out = put; \
  |  |   90|  21.8k|        strm->avail_out = left; \
  |  |   91|  21.8k|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|  21.8k|        strm->avail_in = have; \
  |  |   93|  21.8k|        state->hold = hold; \
  |  |   94|  21.8k|        state->bits = bits; \
  |  |   95|  21.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 21.8k]
  |  |  ------------------
  ------------------
  931|  21.8k|                FUNCTABLE_CALL(inflate_fast)(strm, out);
  ------------------
  |  |   49|  21.8k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
  932|  21.8k|                LOAD();
  ------------------
  |  |   77|  21.8k|    do { \
  |  |   78|  21.8k|        put = strm->next_out; \
  |  |   79|  21.8k|        left = strm->avail_out; \
  |  |   80|  21.8k|        next = strm->next_in; \
  |  |   81|  21.8k|        have = strm->avail_in; \
  |  |   82|  21.8k|        hold = state->hold; \
  |  |   83|  21.8k|        bits = state->bits; \
  |  |   84|  21.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 21.8k]
  |  |  ------------------
  ------------------
  933|  21.8k|                if (state->mode == TYPE)
  ------------------
  |  Branch (933:21): [True: 21.4k, False: 425]
  ------------------
  934|  21.4k|                    state->back = -1;
  935|  21.8k|                break;
  936|  21.8k|            }
  937|  26.3k|            state->back = 0;
  938|       |
  939|       |            /* get a literal, length, or end-of-block code */
  940|  42.0k|            for (;;) {
  941|  42.0k|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  42.0k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  942|  42.0k|                if (here.bits <= bits)
  ------------------
  |  Branch (942:21): [True: 26.2k, False: 15.8k]
  ------------------
  943|  26.2k|                    break;
  944|  15.8k|                PULLBYTE();
  ------------------
  |  |  386|  15.8k|    do { \
  |  |  387|  15.8k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 162, False: 15.7k]
  |  |  ------------------
  |  |  388|  15.8k|        have--; \
  |  |  389|  15.7k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  15.7k|        bits += 8; \
  |  |  391|  15.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 15.7k]
  |  |  ------------------
  ------------------
  945|  15.8k|            }
  946|  26.2k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (946:17): [True: 6.29k, False: 19.9k]
  |  Branch (946:28): [True: 2.93k, False: 3.35k]
  ------------------
  947|  2.93k|                last = here;
  948|  3.75k|                for (;;) {
  949|  3.75k|                    here = state->lencode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|  3.75k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  950|  3.75k|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (950:25): [True: 2.91k, False: 842]
  ------------------
  951|  2.91k|                        break;
  952|    842|                    PULLBYTE();
  ------------------
  |  |  386|    842|    do { \
  |  |  387|    842|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 20, False: 822]
  |  |  ------------------
  |  |  388|    842|        have--; \
  |  |  389|    822|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|    822|        bits += 8; \
  |  |  391|    822|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 822]
  |  |  ------------------
  ------------------
  953|    842|                }
  954|  2.91k|                DROPBITS(last.bits);
  ------------------
  |  |  118|  2.91k|    do { \
  |  |  119|  2.91k|        hold >>= (n); \
  |  |  120|  2.91k|        bits -= (unsigned)(n); \
  |  |  121|  2.91k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.91k]
  |  |  ------------------
  ------------------
  955|  2.91k|                state->back += last.bits;
  956|  2.91k|            }
  957|  26.1k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  26.1k|    do { \
  |  |  119|  26.1k|        hold >>= (n); \
  |  |  120|  26.1k|        bits -= (unsigned)(n); \
  |  |  121|  26.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 26.1k]
  |  |  ------------------
  ------------------
  958|  26.1k|            state->back += here.bits;
  959|  26.1k|            state->length = here.val;
  960|       |
  961|       |            /* process literal */
  962|  26.1k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (962:17): [True: 21.6k, False: 4.57k]
  ------------------
  963|  21.6k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  964|  21.6k|                        "inflate:         literal '%c'\n" :
  965|  21.6k|                        "inflate:         literal 0x%02x\n", here.val));
  966|  21.6k|                state->mode = LIT;
  967|  21.6k|                break;
  968|  21.6k|            }
  969|       |
  970|       |            /* process end of block */
  971|  4.57k|            if (here.op & 32) {
  ------------------
  |  Branch (971:17): [True: 563, False: 4.00k]
  ------------------
  972|    563|                Tracevv((stderr, "inflate:         end of block\n"));
  973|    563|                state->back = -1;
  974|    563|                state->mode = TYPE;
  975|    563|                break;
  976|    563|            }
  977|       |
  978|       |            /* invalid code */
  979|  4.00k|            if (here.op & 64) {
  ------------------
  |  Branch (979:17): [True: 3, False: 4.00k]
  ------------------
  980|      3|                SET_BAD("invalid literal/length code");
  ------------------
  |  |  132|      3|    do { \
  |  |  133|      3|        state->mode = BAD; \
  |  |  134|      3|        strm->msg = (char *)errmsg; \
  |  |  135|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
  981|      3|                break;
  982|      3|            }
  983|       |
  984|       |            /* length code */
  985|  4.00k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  4.00k|#define MAX_BITS 15
  ------------------
  986|  4.00k|            state->mode = LENEXT;
  987|  4.00k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  4.00k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  988|       |
  989|  4.00k|        case LENEXT:
  ------------------
  |  Branch (989:9): [True: 1, False: 112k]
  ------------------
  990|       |            /* get extra bits, if any */
  991|  4.00k|            if (state->extra) {
  ------------------
  |  Branch (991:17): [True: 921, False: 3.08k]
  ------------------
  992|    921|                NEEDBITS(state->extra);
  ------------------
  |  |  107|    921|    do { \
  |  |  108|  1.15k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 238, False: 919]
  |  |  ------------------
  |  |  109|    921|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    238|    do { \
  |  |  |  |  387|    238|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 2, False: 236]
  |  |  |  |  ------------------
  |  |  |  |  388|    238|        have--; \
  |  |  |  |  389|    236|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    236|        bits += 8; \
  |  |  |  |  391|    236|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 236]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    921|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 919]
  |  |  ------------------
  ------------------
  993|    919|                state->length += BITS(state->extra);
  ------------------
  |  |  114|    919|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  994|    919|                DROPBITS(state->extra);
  ------------------
  |  |  118|    919|    do { \
  |  |  119|    919|        hold >>= (n); \
  |  |  120|    919|        bits -= (unsigned)(n); \
  |  |  121|    919|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 919]
  |  |  ------------------
  ------------------
  995|    919|                state->back += state->extra;
  996|    919|            }
  997|  4.00k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
  998|  4.00k|            state->was = state->length;
  999|  4.00k|            state->mode = DIST;
 1000|  4.00k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  4.00k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1001|       |
 1002|  4.01k|        case DIST:
  ------------------
  |  Branch (1002:9): [True: 15, False: 112k]
  ------------------
 1003|       |            /* get distance code */
 1004|  5.92k|            for (;;) {
 1005|  5.92k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  114|  5.92k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1006|  5.92k|                if (here.bits <= bits)
  ------------------
  |  Branch (1006:21): [True: 3.99k, False: 1.93k]
  ------------------
 1007|  3.99k|                    break;
 1008|  1.93k|                PULLBYTE();
  ------------------
  |  |  386|  1.93k|    do { \
  |  |  387|  1.93k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 26, False: 1.90k]
  |  |  ------------------
  |  |  388|  1.93k|        have--; \
  |  |  389|  1.90k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  1.90k|        bits += 8; \
  |  |  391|  1.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 1.90k]
  |  |  ------------------
  ------------------
 1009|  1.93k|            }
 1010|  3.99k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1010:17): [True: 730, False: 3.26k]
  ------------------
 1011|    730|                last = here;
 1012|  1.05k|                for (;;) {
 1013|  1.05k|                    here = state->distcode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|  1.05k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1014|  1.05k|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (1014:25): [True: 726, False: 324]
  ------------------
 1015|    726|                        break;
 1016|    324|                    PULLBYTE();
  ------------------
  |  |  386|    324|    do { \
  |  |  387|    324|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 4, False: 320]
  |  |  ------------------
  |  |  388|    324|        have--; \
  |  |  389|    320|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|    320|        bits += 8; \
  |  |  391|    320|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 320]
  |  |  ------------------
  ------------------
 1017|    324|                }
 1018|    726|                DROPBITS(last.bits);
  ------------------
  |  |  118|    726|    do { \
  |  |  119|    726|        hold >>= (n); \
  |  |  120|    726|        bits -= (unsigned)(n); \
  |  |  121|    726|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 726]
  |  |  ------------------
  ------------------
 1019|    726|                state->back += last.bits;
 1020|    726|            }
 1021|  3.98k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  3.98k|    do { \
  |  |  119|  3.98k|        hold >>= (n); \
  |  |  120|  3.98k|        bits -= (unsigned)(n); \
  |  |  121|  3.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 3.98k]
  |  |  ------------------
  ------------------
 1022|  3.98k|            state->back += here.bits;
 1023|  3.98k|            if (here.op & 64) {
  ------------------
  |  Branch (1023:17): [True: 13, False: 3.97k]
  ------------------
 1024|     13|                SET_BAD("invalid distance code");
  ------------------
  |  |  132|     13|    do { \
  |  |  133|     13|        state->mode = BAD; \
  |  |  134|     13|        strm->msg = (char *)errmsg; \
  |  |  135|     13|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 13]
  |  |  ------------------
  ------------------
 1025|     13|                break;
 1026|     13|            }
 1027|  3.97k|            state->offset = here.val;
 1028|  3.97k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  3.97k|#define MAX_BITS 15
  ------------------
 1029|  3.97k|            state->mode = DISTEXT;
 1030|  3.97k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.97k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1031|       |
 1032|  3.98k|        case DISTEXT:
  ------------------
  |  Branch (1032:9): [True: 8, False: 112k]
  ------------------
 1033|       |            /* get distance extra bits, if any */
 1034|  3.98k|            if (state->extra) {
  ------------------
  |  Branch (1034:17): [True: 1.87k, False: 2.10k]
  ------------------
 1035|  1.87k|                NEEDBITS(state->extra);
  ------------------
  |  |  107|  1.87k|    do { \
  |  |  108|  2.61k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 753, False: 1.86k]
  |  |  ------------------
  |  |  109|  1.87k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    753|    do { \
  |  |  |  |  387|    753|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 16, False: 737]
  |  |  |  |  ------------------
  |  |  |  |  388|    753|        have--; \
  |  |  |  |  389|    737|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    737|        bits += 8; \
  |  |  |  |  391|    737|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 737]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  1.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 1.86k]
  |  |  ------------------
  ------------------
 1036|  1.86k|                state->offset += BITS(state->extra);
  ------------------
  |  |  114|  1.86k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1037|  1.86k|                DROPBITS(state->extra);
  ------------------
  |  |  118|  1.86k|    do { \
  |  |  119|  1.86k|        hold >>= (n); \
  |  |  120|  1.86k|        bits -= (unsigned)(n); \
  |  |  121|  1.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 1.86k]
  |  |  ------------------
  ------------------
 1038|  1.86k|                state->back += state->extra;
 1039|  1.86k|            }
 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.96k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1047|  3.96k|            state->mode = MATCH;
 1048|  3.96k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.96k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1049|       |
 1050|  4.26k|        case MATCH:
  ------------------
  |  Branch (1050:9): [True: 294, False: 112k]
  ------------------
 1051|       |            /* copy match from window to output */
 1052|  4.26k|            if (left == 0)
  ------------------
  |  Branch (1052:17): [True: 308, False: 3.95k]
  ------------------
 1053|    308|                goto inf_leave;
 1054|  3.95k|            copy = out - left;
 1055|  3.95k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1055:17): [True: 78, False: 3.87k]
  ------------------
 1056|     78|                copy = state->offset - copy;
 1057|     78|                if (copy > state->whave) {
  ------------------
  |  Branch (1057:21): [True: 78, 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|     78|                    SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     78|    do { \
  |  |  133|     78|        state->mode = BAD; \
  |  |  134|     78|        strm->msg = (char *)errmsg; \
  |  |  135|     78|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 78]
  |  |  ------------------
  ------------------
 1076|     78|#endif
 1077|     78|                    break;
 1078|     78|                }
 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.87k|            } else {
 1090|  3.87k|                copy = MIN(state->length, left);
  ------------------
  |  |  124|  3.87k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 140, False: 3.73k]
  |  |  ------------------
  ------------------
 1091|       |
 1092|  3.87k|                put = FUNCTABLE_CALL(chunkmemset_safe)(put, put - state->offset, copy, left);
  ------------------
  |  |   49|  3.87k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1093|  3.87k|            }
 1094|  3.87k|            left -= copy;
 1095|  3.87k|            state->length -= copy;
 1096|  3.87k|            if (state->length == 0)
  ------------------
  |  Branch (1096:17): [True: 3.73k, False: 140]
  ------------------
 1097|  3.73k|                state->mode = LEN;
 1098|  3.87k|            break;
 1099|       |
 1100|  21.6k|        case LIT:
  ------------------
  |  Branch (1100:9): [True: 21.6k, False: 91.0k]
  ------------------
 1101|  21.6k|            if (left == 0)
  ------------------
  |  Branch (1101:17): [True: 106, False: 21.5k]
  ------------------
 1102|    106|                goto inf_leave;
 1103|  21.5k|            *put++ = (unsigned char)(state->length);
 1104|  21.5k|            left--;
 1105|  21.5k|            state->mode = LEN;
 1106|  21.5k|            break;
 1107|       |
 1108|    137|        case CHECK:
  ------------------
  |  Branch (1108:9): [True: 137, False: 112k]
  ------------------
 1109|    137|            if (state->wrap) {
  ------------------
  |  Branch (1109:17): [True: 137, False: 0]
  ------------------
 1110|    137|                NEEDBITS(32);
  ------------------
  |  |  107|    137|    do { \
  |  |  108|    646|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 521, False: 125]
  |  |  ------------------
  |  |  109|    521|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    521|    do { \
  |  |  |  |  387|    521|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 12, False: 509]
  |  |  |  |  ------------------
  |  |  |  |  388|    521|        have--; \
  |  |  |  |  389|    509|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    509|        bits += 8; \
  |  |  |  |  391|    509|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 509]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    137|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 125]
  |  |  ------------------
  ------------------
 1111|    125|                out -= left;
 1112|    125|                strm->total_out += out;
 1113|    125|                state->total += out;
 1114|       |
 1115|       |                /* compute crc32 checksum if not in raw mode */
 1116|    125|                if (INFLATE_NEED_CHECKSUM(strm) && state->wrap & 4) {
  ------------------
  |  |   31|    250|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 125, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1116:52): [True: 125, False: 0]
  ------------------
 1117|    125|                    if (out) {
  ------------------
  |  Branch (1117:25): [True: 97, False: 28]
  ------------------
 1118|     97|                        inf_chksum(strm, put - out, out);
 1119|     97|                    }
 1120|    125|#ifdef GUNZIP
 1121|    125|                    if (state->flags)
  ------------------
  |  Branch (1121:25): [True: 0, False: 125]
  ------------------
 1122|      0|                        strm->adler = state->check = FUNCTABLE_CALL(crc32_fold_final)(&state->crc_fold);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1123|    125|#endif
 1124|    125|                }
 1125|    125|                out = left;
 1126|    125|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1126:21): [True: 125, False: 0]
  |  Branch (1126:42): [True: 124, False: 1]
  ------------------
 1127|    125|#ifdef GUNZIP
 1128|    125|                     state->flags ? hold :
  ------------------
  |  Branch (1128:22): [True: 0, False: 125]
  ------------------
 1129|    125|#endif
 1130|    125|                     ZSWAP32((unsigned)hold)) != state->check) {
  ------------------
  |  |  170|    125|#  define ZSWAP32(q) __builtin_bswap32(q)
  ------------------
 1131|    124|                    SET_BAD("incorrect data check");
  ------------------
  |  |  132|    124|    do { \
  |  |  133|    124|        state->mode = BAD; \
  |  |  134|    124|        strm->msg = (char *)errmsg; \
  |  |  135|    124|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 124]
  |  |  ------------------
  ------------------
 1132|    124|                    break;
 1133|    124|                }
 1134|      1|                INITBITS();
  ------------------
  |  |   99|      1|    do { \
  |  |  100|      1|        hold = 0; \
  |  |  101|      1|        bits = 0; \
  |  |  102|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1135|      1|                Tracev((stderr, "inflate:   check matches trailer\n"));
 1136|      1|            }
 1137|      1|#ifdef GUNZIP
 1138|      1|            state->mode = LENGTH;
 1139|      1|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      1|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1140|       |
 1141|      1|        case LENGTH:
  ------------------
  |  Branch (1141:9): [True: 0, False: 112k]
  ------------------
 1142|      1|            if (state->wrap && state->flags) {
  ------------------
  |  Branch (1142:17): [True: 1, False: 0]
  |  Branch (1142:32): [True: 0, False: 1]
  ------------------
 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|      1|#endif
 1152|      1|            state->mode = DONE;
 1153|      1|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      1|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1154|       |
 1155|      1|        case DONE:
  ------------------
  |  Branch (1155:9): [True: 0, False: 112k]
  ------------------
 1156|       |            /* inflate stream terminated properly */
 1157|      1|            ret = Z_STREAM_END;
  ------------------
  |  |  181|      1|#define Z_STREAM_END    1
  ------------------
 1158|      1|            goto inf_leave;
 1159|       |
 1160|    555|        case BAD:
  ------------------
  |  Branch (1160:9): [True: 555, False: 112k]
  ------------------
 1161|    555|            ret = Z_DATA_ERROR;
  ------------------
  |  |  185|    555|#define Z_DATA_ERROR   (-3)
  ------------------
 1162|    555|            goto inf_leave;
 1163|       |
 1164|      0|        case SYNC:
  ------------------
  |  Branch (1164:9): [True: 0, False: 112k]
  ------------------
 1165|       |
 1166|      0|        default:                 /* can't happen, but makes compilers happy */
  ------------------
  |  Branch (1166:9): [True: 0, False: 112k]
  ------------------
 1167|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1168|   112k|        }
 1169|       |
 1170|       |    /*
 1171|       |       Return from inflate(), updating the total counts and the check value.
 1172|       |       If there was no progress during the inflate() call, return a buffer
 1173|       |       error.  Call updatewindow() to create and/or update the window state.
 1174|       |     */
 1175|  1.53k|  inf_leave:
 1176|  1.53k|    RESTORE();
  ------------------
  |  |   88|  1.53k|    do { \
  |  |   89|  1.53k|        strm->next_out = put; \
  |  |   90|  1.53k|        strm->avail_out = left; \
  |  |   91|  1.53k|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|  1.53k|        strm->avail_in = have; \
  |  |   93|  1.53k|        state->hold = hold; \
  |  |   94|  1.53k|        state->bits = bits; \
  |  |   95|  1.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 1.53k]
  |  |  ------------------
  ------------------
 1177|  1.53k|    uint32_t check_bytes = out - strm->avail_out;
 1178|  1.53k|    if (INFLATE_NEED_UPDATEWINDOW(strm) &&
  ------------------
  |  |   33|  3.06k|#  define INFLATE_NEED_UPDATEWINDOW(strm) 1
  |  |  ------------------
  |  |  |  Branch (33:43): [True: 1.53k, Folded]
  |  |  ------------------
  ------------------
 1179|  1.53k|            (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1179:14): [True: 389, False: 1.14k]
  |  Branch (1179:31): [True: 610, False: 535]
  |  Branch (1179:57): [True: 389, False: 221]
  ------------------
 1180|    778|                 (state->mode < CHECK || flush != Z_FINISH)))) {
  ------------------
  |  |  175|      4|#define Z_FINISH        4
  ------------------
  |  Branch (1180:19): [True: 385, False: 4]
  |  Branch (1180:42): [True: 4, False: 0]
  ------------------
 1181|       |        /* update sliding window with respective checksum if not in "raw" mode */
 1182|    778|        updatewindow(strm, strm->next_out, check_bytes, state->wrap & 4);
 1183|    778|    }
 1184|  1.53k|    in -= strm->avail_in;
 1185|  1.53k|    out -= strm->avail_out;
 1186|  1.53k|    strm->total_in += in;
 1187|  1.53k|    strm->total_out += out;
 1188|  1.53k|    state->total += out;
 1189|       |
 1190|  1.53k|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1190:43): [True: 455, False: 1.07k]
  ------------------
 1191|  1.53k|                      (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1191:24): [True: 5, False: 1.52k]
  |  Branch (1191:58): [True: 0, False: 1.53k]
  |  Branch (1191:81): [True: 0, False: 1.53k]
  ------------------
 1192|  1.53k|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) {
  ------------------
  |  |  175|  1.04k|#define Z_FINISH        4
  ------------------
                  if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) {
  ------------------
  |  |  180|    489|#define Z_OK            0
  ------------------
  |  Branch (1192:11): [True: 489, False: 1.04k]
  |  Branch (1192:22): [True: 489, False: 0]
  |  Branch (1192:35): [True: 0, False: 1.04k]
  |  Branch (1192:57): [True: 489, False: 0]
  ------------------
 1193|       |        /* when no sliding window is used, hash the output bytes if no CHECK state */
 1194|    489|        if (INFLATE_NEED_CHECKSUM(strm) && !state->wsize && flush == Z_FINISH) {
  ------------------
  |  |   31|    978|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 489, Folded]
  |  |  ------------------
  ------------------
                      if (INFLATE_NEED_CHECKSUM(strm) && !state->wsize && flush == Z_FINISH) {
  ------------------
  |  |  175|    100|#define Z_FINISH        4
  ------------------
  |  Branch (1194:44): [True: 100, False: 389]
  |  Branch (1194:61): [True: 0, False: 100]
  ------------------
 1195|      0|            inf_chksum(strm, put - check_bytes, check_bytes);
 1196|      0|        }
 1197|    489|        ret = Z_BUF_ERROR;
  ------------------
  |  |  187|    489|#define Z_BUF_ERROR    (-5)
  ------------------
 1198|    489|    }
 1199|  1.53k|    return ret;
 1200|  1.53k|}
zng_inflateEnd:
 1202|  1.04k|int32_t Z_EXPORT PREFIX(inflateEnd)(PREFIX3(stream) *strm) {
 1203|  1.04k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1203:9): [True: 0, False: 1.04k]
  ------------------
 1204|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1205|       |
 1206|       |    /* Free allocated buffers */
 1207|  1.04k|    free_inflate(strm);
 1208|       |
 1209|  1.04k|    Tracev((stderr, "inflate: end\n"));
 1210|  1.04k|    return Z_OK;
  ------------------
  |  |  180|  1.04k|#define Z_OK            0
  ------------------
 1211|  1.04k|}
inflate.c:inflateStateCheck:
   51|  5.72k|static int inflateStateCheck(PREFIX3(stream) *strm) {
   52|  5.72k|    struct inflate_state *state;
   53|  5.72k|    if (strm == NULL || strm->zalloc == NULL || strm->zfree == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 5.72k]
  |  Branch (53:25): [True: 0, False: 5.72k]
  |  Branch (53:49): [True: 0, False: 5.72k]
  ------------------
   54|      0|        return 1;
   55|  5.72k|    state = (struct inflate_state *)strm->state;
   56|  5.72k|    if (state == NULL || state->alloc_bufs == NULL || state->strm != strm || state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (56:9): [True: 0, False: 5.72k]
  |  Branch (56:26): [True: 0, False: 5.72k]
  |  Branch (56:55): [True: 0, False: 5.72k]
  |  Branch (56:78): [True: 0, False: 5.72k]
  |  Branch (56:100): [True: 0, False: 5.72k]
  ------------------
   57|      0|        return 1;
   58|  5.72k|    return 0;
   59|  5.72k|}
inflate.c:inf_chksum:
   39|    143|static inline void inf_chksum(PREFIX3(stream) *strm, const uint8_t *src, uint32_t len) {
   40|    143|    struct inflate_state *state = (struct inflate_state*)strm->state;
   41|    143|#ifdef GUNZIP
   42|    143|    if (state->flags) {
  ------------------
  |  Branch (42:9): [True: 0, False: 143]
  ------------------
   43|      0|        FUNCTABLE_CALL(crc32_fold)(&state->crc_fold, src, len, 0);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   44|      0|    } else
   45|    143|#endif
   46|    143|    {
   47|    143|        strm->adler = state->check = FUNCTABLE_CALL(adler32)(state->check, src, len);
  ------------------
  |  |   49|    143|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   48|    143|    }
   49|    143|}
inflate.c:updatewindow:
  324|    778|static void updatewindow(PREFIX3(stream) *strm, const uint8_t *end, uint32_t len, int32_t cksum) {
  325|    778|    struct inflate_state *state;
  326|    778|    uint32_t dist;
  327|       |
  328|    778|    state = (struct inflate_state *)strm->state;
  329|       |
  330|       |    /* if window not in use yet, initialize */
  331|    778|    if (state->wsize == 0)
  ------------------
  |  Branch (331:9): [True: 389, False: 389]
  ------------------
  332|    389|        state->wsize = 1U << state->wbits;
  333|       |
  334|       |    /* len state->wsize or less output bytes into the circular window */
  335|    778|    if (len >= state->wsize) {
  ------------------
  |  Branch (335:9): [True: 47, False: 731]
  ------------------
  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|     47|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|     94|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 47, Folded]
  |  |  ------------------
  ------------------
  |  Branch (338:44): [True: 47, False: 0]
  ------------------
  339|       |            /* We have to split the checksum over non-copied and copied bytes */
  340|     47|            if (len > state->wsize)
  ------------------
  |  Branch (340:17): [True: 46, False: 1]
  ------------------
  341|     46|                inf_chksum(strm, end - len, len - state->wsize);
  342|     47|            inf_chksum_cpy(strm, state->window, end - state->wsize, state->wsize);
  343|     47|        } else {
  344|      0|            memcpy(state->window, end - state->wsize, state->wsize);
  345|      0|        }
  346|       |
  347|     47|        state->wnext = 0;
  348|     47|        state->whave = state->wsize;
  349|    731|    } else {
  350|    731|        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|    731|        dist = MIN(dist, len);
  ------------------
  |  |  124|    731|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 731, False: 0]
  |  |  ------------------
  ------------------
  354|    731|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|  1.46k|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 731, Folded]
  |  |  ------------------
  ------------------
  |  Branch (354:44): [True: 731, False: 0]
  ------------------
  355|    731|            inf_chksum_cpy(strm, state->window + state->wnext, end - len, dist);
  356|    731|        } else {
  357|      0|            memcpy(state->window + state->wnext, end - len, dist);
  358|      0|        }
  359|    731|        len -= dist;
  360|    731|        if (len) {
  ------------------
  |  Branch (360:13): [True: 0, False: 731]
  ------------------
  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|    731|        } else {
  370|    731|            state->wnext += dist;
  371|    731|            if (state->wnext == state->wsize)
  ------------------
  |  Branch (371:17): [True: 0, False: 731]
  ------------------
  372|      0|                state->wnext = 0;
  373|    731|            if (state->whave < state->wsize)
  ------------------
  |  Branch (373:17): [True: 684, False: 47]
  ------------------
  374|    684|                state->whave += dist;
  375|    731|        }
  376|    731|    }
  377|    778|}
inflate.c:inf_chksum_cpy:
   26|    778|                           const uint8_t *src, uint32_t copy) {
   27|    778|    if (!copy) return;
  ------------------
  |  Branch (27:9): [True: 389, False: 389]
  ------------------
   28|    389|    struct inflate_state *state = (struct inflate_state*)strm->state;
   29|    389|#ifdef GUNZIP
   30|    389|    if (state->flags) {
  ------------------
  |  Branch (30:9): [True: 0, False: 389]
  ------------------
   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|    389|#endif
   34|    389|    {
   35|    389|        strm->adler = state->check = FUNCTABLE_CALL(adler32_fold_copy)(state->check, dst, src, copy);
  ------------------
  |  |   49|    389|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   36|    389|    }
   37|    389|}

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

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

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

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

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

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

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

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

zstd_decompress_block.c:BIT_initDStream:
  255|  4.15k|{
  256|  4.15k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     23|# 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|     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 (256:9): [True: 23, False: 4.13k]
  ------------------
  257|       |
  258|  4.13k|    bitD->start = (const char*)srcBuffer;
  259|  4.13k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  4.13k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 1.75k, False: 2.37k]
  ------------------
  262|  1.75k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  1.75k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  1.75k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  1.75k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.64k, False: 107]
  ------------------
  266|  1.75k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    107|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    107|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    107|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 107, False: 1.64k]
  ------------------
  267|  2.37k|    } else {
  268|  2.37k|        bitD->ptr   = bitD->start;
  269|  2.37k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.37k|        switch(srcSize)
  271|  2.37k|        {
  272|    151|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 151, False: 2.22k]
  ------------------
  273|    151|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    151|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    281|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 130, False: 2.24k]
  ------------------
  276|    281|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    281|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    495|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 214, False: 2.16k]
  ------------------
  279|    495|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    495|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    991|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 496, False: 1.88k]
  ------------------
  282|    991|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    991|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.27k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 282, False: 2.09k]
  ------------------
  285|  1.27k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.27k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.85k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 581, False: 1.79k]
  ------------------
  288|  1.85k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.85k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.37k|        default: break;
  ------------------
  |  Branch (290:9): [True: 524, False: 1.85k]
  ------------------
  291|  2.37k|        }
  292|  2.37k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.37k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.36k, False: 13]
  ------------------
  294|  2.37k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 13, False: 2.36k]
  ------------------
  295|  2.37k|        }
  296|  2.36k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.36k|    }
  298|       |
  299|  4.01k|    return srcSize;
  300|  4.13k|}
zstd_decompress_block.c:BIT_readBits:
  363|  17.1M|{
  364|  17.1M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  17.1M|    BIT_skipBits(bitD, nbBits);
  366|  17.1M|    return value;
  367|  17.1M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  17.1M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  17.1M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  17.1M|    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|  17.1M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  17.1M|{
  309|  17.1M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  17.1M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  17.1M|#    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|  17.1M|#if defined(__x86_64__) || defined(_M_X64)
  318|  17.1M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  17.1M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  22.4M|{
  355|  22.4M|    bitD->bitsConsumed += nbBits;
  356|  22.4M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  5.73M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  5.73M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  5.73M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 236k, False: 5.49M]
  |  |  ------------------
  ------------------
  416|   236k|        static const BitContainerType zeroFilled = 0;
  417|   236k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|   236k|        return BIT_DStream_overflow;
  420|   236k|    }
  421|       |
  422|  5.49M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  5.49M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  5.49M|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 5.47M, False: 16.1k]
  ------------------
  425|  5.47M|        return BIT_reloadDStream_internal(bitD);
  426|  5.47M|    }
  427|  16.1k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 13.0k, False: 3.11k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  13.0k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 12.3k, False: 717]
  ------------------
  430|    717|        return BIT_DStream_completed;
  431|  13.0k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  3.11k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  3.11k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  3.11k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 195, False: 2.92k]
  ------------------
  436|    195|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    195|            result = BIT_DStream_endOfBuffer;
  438|    195|        }
  439|  3.11k|        bitD->ptr -= nbBytes;
  440|  3.11k|        bitD->bitsConsumed -= nbBytes*8;
  441|  3.11k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  3.11k|        return result;
  443|  16.1k|    }
  444|  16.1k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|  5.47M|{
  386|  5.47M|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  5.47M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  5.47M|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  5.47M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  5.47M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  5.47M|    bitD->bitsConsumed &= 7;
  390|  5.47M|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  5.47M|    return BIT_DStream_unfinished;
  392|  5.47M|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  5.28M|{
  373|  5.28M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  5.28M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  5.28M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  5.28M|    BIT_skipBits(bitD, nbBits);
  376|  5.28M|    return value;
  377|  5.28M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  5.28M|{
  348|  5.28M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  5.28M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  5.28M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  5.28M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  5.28M|}
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.11k, False: 37]
  |  Branch (451:49): [True: 2.08k, False: 38]
  ------------------
  452|  2.15k|}
fse_decompress.c:BIT_initDStream:
  255|  5.14k|{
  256|  5.14k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     23|# 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|     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 (256:9): [True: 23, False: 5.12k]
  ------------------
  257|       |
  258|  5.12k|    bitD->start = (const char*)srcBuffer;
  259|  5.12k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  5.12k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 4.30k, False: 817]
  ------------------
  262|  4.30k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  4.30k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  4.30k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  4.30k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 4.22k, False: 77]
  ------------------
  266|  4.30k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     77|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     77|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     77|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 77, False: 4.22k]
  ------------------
  267|  4.30k|    } else {
  268|    817|        bitD->ptr   = bitD->start;
  269|    817|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    817|        switch(srcSize)
  271|    817|        {
  272|    162|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 162, False: 655]
  ------------------
  273|    162|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    162|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    277|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 115, False: 702]
  ------------------
  276|    277|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    277|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    393|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 116, False: 701]
  ------------------
  279|    393|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    393|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    507|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 114, False: 703]
  ------------------
  282|    507|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    507|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    634|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 127, False: 690]
  ------------------
  285|    634|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    634|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    796|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 162, False: 655]
  ------------------
  288|    796|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    796|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    817|        default: break;
  ------------------
  |  Branch (290:9): [True: 21, False: 796]
  ------------------
  291|    817|        }
  292|    817|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    817|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 807, False: 10]
  ------------------
  294|    817|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 10, False: 807]
  ------------------
  295|    817|        }
  296|    807|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    807|    }
  298|       |
  299|  5.03k|    return srcSize;
  300|  5.12k|}
fse_decompress.c:BIT_readBits:
  363|   346k|{
  364|   346k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|   346k|    BIT_skipBits(bitD, nbBits);
  366|   346k|    return value;
  367|   346k|}
fse_decompress.c:BIT_lookBits:
  331|   346k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|   346k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|   346k|    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|   346k|}
fse_decompress.c:BIT_getMiddleBits:
  308|   346k|{
  309|   346k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|   346k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|   346k|#    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|   346k|#if defined(__x86_64__) || defined(_M_X64)
  318|   346k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|   346k|}
fse_decompress.c:BIT_skipBits:
  354|   428k|{
  355|   428k|    bitD->bitsConsumed += nbBits;
  356|   428k|}
fse_decompress.c:BIT_reloadDStream:
  413|   297k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   297k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   297k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 5.02k, False: 292k]
  |  |  ------------------
  ------------------
  416|  5.02k|        static const BitContainerType zeroFilled = 0;
  417|  5.02k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  5.02k|        return BIT_DStream_overflow;
  420|  5.02k|    }
  421|       |
  422|   292k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   292k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   292k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 13.3k, False: 278k]
  ------------------
  425|  13.3k|        return BIT_reloadDStream_internal(bitD);
  426|  13.3k|    }
  427|   278k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 234k, False: 44.4k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|   234k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 228k, False: 6.12k]
  ------------------
  430|  6.12k|        return BIT_DStream_completed;
  431|   234k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  44.4k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  44.4k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  44.4k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 547, False: 43.8k]
  ------------------
  436|    547|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    547|            result = BIT_DStream_endOfBuffer;
  438|    547|        }
  439|  44.4k|        bitD->ptr -= nbBytes;
  440|  44.4k|        bitD->bitsConsumed -= nbBytes*8;
  441|  44.4k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  44.4k|        return result;
  443|   278k|    }
  444|   278k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  13.3k|{
  386|  13.3k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  13.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  13.3k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  13.3k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  13.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  13.3k|    bitD->bitsConsumed &= 7;
  390|  13.3k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  13.3k|    return BIT_DStream_unfinished;
  392|  13.3k|}
fse_decompress.c:BIT_readBitsFast:
  372|  81.2k|{
  373|  81.2k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  81.2k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  81.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  81.2k|    BIT_skipBits(bitD, nbBits);
  376|  81.2k|    return value;
  377|  81.2k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  81.2k|{
  348|  81.2k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  81.2k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  81.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  81.2k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  81.2k|}
huf_decompress.c:BIT_initDStream:
  255|  3.12k|{
  256|  3.12k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     13|# 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|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 13, False: 3.10k]
  ------------------
  257|       |
  258|  3.10k|    bitD->start = (const char*)srcBuffer;
  259|  3.10k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  3.10k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 902, False: 2.20k]
  ------------------
  262|    902|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    902|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    902|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    902|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 890, False: 12]
  ------------------
  266|    902|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 12, False: 890]
  ------------------
  267|  2.20k|    } else {
  268|  2.20k|        bitD->ptr   = bitD->start;
  269|  2.20k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.20k|        switch(srcSize)
  271|  2.20k|        {
  272|     30|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 30, False: 2.17k]
  ------------------
  273|     30|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     30|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     74|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 44, False: 2.16k]
  ------------------
  276|     74|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     74|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    139|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 65, False: 2.14k]
  ------------------
  279|    139|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    139|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    187|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 48, False: 2.15k]
  ------------------
  282|    187|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    187|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.02k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 842, False: 1.36k]
  ------------------
  285|  1.02k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.02k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.10k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 74, False: 2.13k]
  ------------------
  288|  1.10k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.10k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.20k|        default: break;
  ------------------
  |  Branch (290:9): [True: 1.10k, False: 1.10k]
  ------------------
  291|  2.20k|        }
  292|  2.20k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.20k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.18k, False: 17]
  ------------------
  294|  2.20k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 17, False: 2.18k]
  ------------------
  295|  2.20k|        }
  296|  2.18k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.18k|    }
  298|       |
  299|  3.07k|    return srcSize;
  300|  3.10k|}
huf_decompress.c:BIT_reloadDStream:
  413|   333k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   333k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   333k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 209, False: 333k]
  |  |  ------------------
  ------------------
  416|    209|        static const BitContainerType zeroFilled = 0;
  417|    209|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    209|        return BIT_DStream_overflow;
  420|    209|    }
  421|       |
  422|   333k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   333k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   333k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 318k, False: 15.2k]
  ------------------
  425|   318k|        return BIT_reloadDStream_internal(bitD);
  426|   318k|    }
  427|  15.2k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 3.59k, False: 11.6k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  3.59k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 2.68k, False: 917]
  ------------------
  430|    917|        return BIT_DStream_completed;
  431|  3.59k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  11.6k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  11.6k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  11.6k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 1.46k, False: 10.1k]
  ------------------
  436|  1.46k|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|  1.46k|            result = BIT_DStream_endOfBuffer;
  438|  1.46k|        }
  439|  11.6k|        bitD->ptr -= nbBytes;
  440|  11.6k|        bitD->bitsConsumed -= nbBytes*8;
  441|  11.6k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  11.6k|        return result;
  443|  15.2k|    }
  444|  15.2k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|   412k|{
  386|   412k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   412k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   412k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   412k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   412k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   412k|    bitD->bitsConsumed &= 7;
  390|   412k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   412k|    return BIT_DStream_unfinished;
  392|   412k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  3.72M|{
  348|  3.72M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  3.72M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  3.72M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  3.72M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  3.72M|}
huf_decompress.c:BIT_skipBits:
  354|  3.72M|{
  355|  3.72M|    bitD->bitsConsumed += nbBits;
  356|  3.72M|}
huf_decompress.c:BIT_endOfDStream:
  450|  3.03k|{
  451|  3.03k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 2.63k, False: 394]
  |  Branch (451:49): [True: 1.89k, False: 745]
  ------------------
  452|  3.03k|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  95.1k|{
  402|  95.1k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  95.1k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 446, False: 94.6k]
  |  |  ------------------
  ------------------
  403|    446|        return BIT_DStream_overflow;
  404|  94.6k|    return BIT_reloadDStream_internal(bitD);
  405|  95.1k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  13.5k|{
  387|  13.5k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 13.3k, False: 133]
  ------------------
  388|  13.5k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|  2.31M|{
  375|  2.31M|    return ptr - sub;
  376|  2.31M|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|  2.31M|{
  362|  2.31M|    return ptr + add;
  363|  2.31M|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|  7.61k|{
  387|  7.61k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 6.72k, False: 896]
  ------------------
  388|  7.61k|}

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

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

zstd_common.c:ERR_isError:
   52|  25.1k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  25.1k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  25.1k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  25.1k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  14.5k|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: 10.1k, False: 4.40k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  7.62k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  7.62k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  7.62k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  7.62k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|   202k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   202k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   202k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   202k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  5.75M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  5.75M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  5.75M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  5.75M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|  32.2k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  32.2k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  32.2k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  32.2k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|  33.5k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  33.5k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  33.5k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  33.5k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  22.9k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  22.9k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  22.9k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  22.9k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  6.89k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  6.89k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  6.89k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  6.89k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  15.5k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  15.5k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  15.5k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  15.5k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  26.1k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  26.1k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  26.1k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  26.1k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|  4.08k|{
  323|  4.08k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 4.08k, False: 0]
  ------------------
  324|  4.08k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  4.08k|}
zstd_ddict.c:MEM_isLittleEndian:
  141|  4.08k|{
  142|  4.08k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  4.08k|    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.08k|}
zstd_ddict.c:MEM_read32:
  183|  4.08k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  71.1k|{
  323|  71.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 71.1k, False: 0]
  ------------------
  324|  71.1k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  71.1k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  74.7k|{
  142|  74.7k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  74.7k|    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|  74.7k|}
zstd_decompress.c:MEM_read32:
  183|  71.1k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|  1.45k|{
  291|  1.45k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.45k, False: 0]
  ------------------
  292|  1.45k|        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.45k|}
zstd_decompress.c:MEM_read16:
  182|  1.45k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|  2.14k|{
  339|  2.14k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 2.14k, False: 0]
  ------------------
  340|  2.14k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  2.14k|}
zstd_decompress.c:MEM_read64:
  184|  2.14k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  48.1k|{
  312|  48.1k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  48.1k|}
zstd_decompress_block.c:MEM_readLE32:
  322|  5.24k|{
  323|  5.24k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 5.24k, False: 0]
  ------------------
  324|  5.24k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  5.24k|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|  5.53M|{
  142|  5.53M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  5.53M|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  5.53M|}
zstd_decompress_block.c:MEM_read32:
  183|  5.24k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  35.5k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  49.1k|{
  291|  49.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 49.1k, False: 0]
  ------------------
  292|  49.1k|        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|  49.1k|}
zstd_decompress_block.c:MEM_read16:
  182|  49.1k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  38.3M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  5.72M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|  5.48M|{
  355|  5.48M|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 5.48M]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  5.48M|    else
  358|  5.48M|        return (size_t)MEM_readLE64(memPtr);
  359|  5.48M|}
zstd_decompress_block.c:MEM_readLE64:
  338|  5.48M|{
  339|  5.48M|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 5.48M, False: 0]
  ------------------
  340|  5.48M|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  5.48M|}
zstd_decompress_block.c:MEM_read64:
  184|  5.48M|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|  37.6k|{
  323|  37.6k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 37.6k, False: 0]
  ------------------
  324|  37.6k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  37.6k|}
zstd_v05.c:MEM_isLittleEndian:
  141|   197k|{
  142|   197k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   197k|    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|   197k|}
zstd_v05.c:MEM_read32:
  183|  37.6k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.c:MEM_readLEST:
  354|  22.0k|{
  355|  22.0k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 22.0k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  22.0k|    else
  358|  22.0k|        return (size_t)MEM_readLE64(memPtr);
  359|  22.0k|}
zstd_v05.c:MEM_32bits:
  137|  32.9k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.c:MEM_readLE64:
  338|  22.0k|{
  339|  22.0k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 22.0k, False: 0]
  ------------------
  340|  22.0k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  22.0k|}
zstd_v05.c:MEM_read64:
  184|  22.0k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE16:
  290|    899|{
  291|    899|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 899, False: 0]
  ------------------
  292|    899|        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|    899|}
zstd_v05.c:MEM_read16:
  182|    899|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_v05.c:MEM_64bits:
  138|  3.20k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v05.c:MEM_writeLE16:
  300|   136k|{
  301|   136k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (301:9): [True: 136k, False: 0]
  ------------------
  302|   136k|        MEM_write16(memPtr, val);
  303|   136k|    } else {
  304|      0|        BYTE* p = (BYTE*)memPtr;
  305|      0|        p[0] = (BYTE)val;
  306|      0|        p[1] = (BYTE)(val>>8);
  307|      0|    }
  308|   136k|}
zstd_v05.c:MEM_write16:
  187|   136k|MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; }
entropy_common.c:MEM_readLE32:
  322|   124k|{
  323|   124k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 124k, False: 0]
  ------------------
  324|   124k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   124k|}
entropy_common.c:MEM_isLittleEndian:
  141|   124k|{
  142|   124k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   124k|    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|   124k|}
entropy_common.c:MEM_read32:
  183|   124k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  14.6k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  62.1k|{
  355|  62.1k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 62.1k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  62.1k|    else
  358|  62.1k|        return (size_t)MEM_readLE64(memPtr);
  359|  62.1k|}
fse_decompress.c:MEM_32bits:
  137|  62.1k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  62.1k|{
  142|  62.1k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  62.1k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  62.1k|}
fse_decompress.c:MEM_readLE64:
  338|  62.1k|{
  339|  62.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 62.1k, False: 0]
  ------------------
  340|  62.1k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  62.1k|}
fse_decompress.c:MEM_read64:
  184|  62.1k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   914k|{
  142|   914k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   914k|    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|   914k|}
huf_decompress.c:MEM_write64:
  189|  2.21M|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|   444k|{
  355|   444k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 444k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   444k|    else
  358|   444k|        return (size_t)MEM_readLE64(memPtr);
  359|   444k|}
huf_decompress.c:MEM_32bits:
  137|   459k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|   444k|{
  339|   444k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 444k, False: 0]
  ------------------
  340|   444k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   444k|}
huf_decompress.c:MEM_read64:
  184|   444k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   788k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  9.19k|{
  291|  9.19k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 9.19k, False: 0]
  ------------------
  292|  9.19k|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|  9.19k|}
huf_decompress.c:MEM_read16:
  182|  9.19k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

do_nothing:
  632|   174k|int do_nothing(uint8_t filter, char cmode) {
  633|   174k|  if (cmode == 'c') {
  ------------------
  |  Branch (633:7): [True: 0, False: 174k]
  ------------------
  634|      0|    return (filter == BLOSC_NOFILTER);
  635|   174k|  } else {
  636|       |    // TRUNC_PREC do not have to be applied during decompression
  637|   174k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (637:13): [True: 87.3k, False: 87.2k]
  |  Branch (637:43): [True: 9.88k, False: 77.3k]
  ------------------
  638|   174k|  }
  639|   174k|}
next_filter:
  642|  32.8k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  643|  57.3k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (643:36): [True: 57.3k, False: 0]
  ------------------
  644|  57.3k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (644:9): [True: 32.8k, False: 24.5k]
  ------------------
  645|  32.8k|      return filters[i];
  646|  32.8k|    }
  647|  57.3k|  }
  648|      0|  return BLOSC_NOFILTER;
  649|  32.8k|}
last_filter:
  652|  19.5k|int last_filter(const uint8_t* filters, char cmode) {
  653|  19.5k|  int last_index = -1;
  654|   136k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (654:40): [True: 117k, False: 19.5k]
  ------------------
  655|   117k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (655:9): [True: 44.4k, False: 72.7k]
  ------------------
  656|  44.4k|      last_index = i;
  657|  44.4k|    }
  658|   117k|  }
  659|  19.5k|  return last_index;
  660|  19.5k|}
read_chunk_header:
  739|   197k|{
  740|   197k|  memset(header, 0, sizeof(blosc_header));
  741|       |
  742|   197k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (742:7): [True: 0, False: 197k]
  ------------------
  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|   197k|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  748|       |
  749|   197k|  bool little_endian = is_little_endian();
  750|       |
  751|   197k|  if (!little_endian) {
  ------------------
  |  Branch (751:7): [True: 0, False: 197k]
  ------------------
  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|   197k|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (757:7): [True: 35, False: 197k]
  ------------------
  758|     35|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   93|     35|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     35|    do {                                            \
  |  |  |  |   98|     35|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     35|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 35, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     35|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|     35|    return BLOSC2_ERROR_INVALID_HEADER;
  760|     35|  }
  761|   197k|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (761:7): [True: 35, False: 197k]
  ------------------
  762|     35|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   93|     35|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     35|    do {                                            \
  |  |  |  |   98|     35|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     35|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 35, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     35|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  763|     35|    return BLOSC2_ERROR_INVALID_HEADER;
  764|     35|  }
  765|   197k|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (765:7): [True: 7, False: 197k]
  ------------------
  766|      7|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      7|    return BLOSC2_ERROR_INVALID_HEADER;
  768|      7|  }
  769|   197k|  if (header->typesize == 0) {
  ------------------
  |  Branch (769:7): [True: 7, False: 197k]
  ------------------
  770|      7|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  771|      7|    return BLOSC2_ERROR_INVALID_HEADER;
  772|      7|  }
  773|       |
  774|       |  /* Read extended header if it is wanted */
  775|   197k|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (775:7): [True: 14.6k, False: 182k]
  |  Branch (775:28): [True: 7.92k, False: 6.74k]
  |  Branch (775:65): [True: 6.41k, False: 1.51k]
  ------------------
  776|  6.41k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (776:9): [True: 29, False: 6.38k]
  ------------------
  777|     29|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|     29|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     29|    do {                                            \
  |  |  |  |   98|     29|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     29|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     29|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|     29|      return BLOSC2_ERROR_INVALID_HEADER;
  779|     29|    }
  780|  6.38k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (780:9): [True: 0, False: 6.38k]
  ------------------
  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|  6.38k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  786|  6.38k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  787|       |
  788|  6.38k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (788:9): [True: 344, False: 6.03k]
  |  Branch (788:55): [True: 225, False: 119]
  ------------------
  789|    225|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  790|    225|      if (special_type != 0) {
  ------------------
  |  Branch (790:11): [True: 8, False: 217]
  ------------------
  791|      8|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  792|      8|        return BLOSC2_ERROR_INVALID_HEADER;
  793|      8|      }
  794|    225|    }
  795|       |
  796|  6.37k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  797|  6.37k|    if (special_type != 0) {
  ------------------
  |  Branch (797:9): [True: 227, False: 6.14k]
  ------------------
  798|    227|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (798:11): [True: 116, False: 111]
  ------------------
  799|       |        // In this case, the actual type size must be derived from the cbytes
  800|    116|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  801|    116|        if (typesize <= 0) {
  ------------------
  |  Branch (801:13): [True: 1, False: 115]
  ------------------
  802|      1|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  804|      1|        }
  805|    115|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (805:13): [True: 0, False: 115]
  ------------------
  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|    115|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (809:13): [True: 13, False: 102]
  ------------------
  810|     13|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   93|     13|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     13|    do {                                            \
  |  |  |  |   98|     13|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     13|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     13|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  811|     13|          return BLOSC2_ERROR_INVALID_HEADER;
  812|     13|        }
  813|    102|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (813:13): [True: 12, False: 90]
  ------------------
  814|     12|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|     12|          return BLOSC2_ERROR_INVALID_HEADER;
  816|     12|        }
  817|    102|      }
  818|    111|      else {
  819|       |        // All-zero chunks fill with memset, which works regardless of element alignment.
  820|    111|        if (special_type != BLOSC2_SPECIAL_ZERO
  ------------------
  |  Branch (820:13): [True: 96, False: 15]
  ------------------
  821|     96|            && header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (821:16): [True: 6, False: 90]
  ------------------
  822|      6|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  823|      6|          return BLOSC2_ERROR_INVALID_HEADER;
  824|      6|        }
  825|    111|      }
  826|    227|    }
  827|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  828|       |    // did not initialize filters to zero beyond the max supported.
  829|  6.34k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (829:9): [True: 698, False: 5.64k]
  ------------------
  830|    698|      header->filters[5] = 0;
  831|    698|      header->filters_meta[5] = 0;
  832|    698|    }
  833|  6.34k|  }
  834|   190k|  else {
  835|   190k|    flags_to_filters(header->flags, header->filters);
  836|   190k|  }
  837|   197k|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (837:7): [True: 17.3k, False: 179k]
  ------------------
  838|  17.3k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (838:7): [True: 9, False: 17.3k]
  ------------------
  839|       |    /* Version from future with unsupported chunk features. */
  840|      9|    return BLOSC2_ERROR_VERSION_SUPPORT;
  841|      9|  }
  842|   197k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (842:7): [True: 334, False: 196k]
  ------------------
  843|    334|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (843:7): [True: 3, False: 331]
  ------------------
  844|      3|    BLOSC_TRACE_ERROR("VL-block chunks cannot be memcpyed.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  845|      3|    return BLOSC2_ERROR_INVALID_HEADER;
  846|      3|  }
  847|   197k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (847:7): [True: 196k, False: 331]
  ------------------
  848|   196k|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (848:7): [True: 196k, False: 145]
  |  Branch (848:29): [True: 34.4k, False: 162k]
  ------------------
  849|  34.4k|    header->blocksize = header->nbytes;
  850|  34.4k|  }
  851|   197k|  return 0;
  852|   197k|}
fill_codec:
  935|      4|int fill_codec(blosc2_codec *codec) {
  936|      4|  char libpath[PATH_MAX];
  937|      4|  void *lib = load_lib(codec->compname, libpath);
  938|      4|  if(lib == NULL) {
  ------------------
  |  Branch (938:6): [True: 4, False: 0]
  ------------------
  939|      4|    BLOSC_TRACE_ERROR("Error while loading the library for codec `%s`", codec->compname);
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|      4|    return BLOSC2_ERROR_FAILURE;
  941|      4|  }
  942|       |
  943|      0|  codec_info *info = dlsym(lib, "info");
  944|      0|  if (info == NULL) {
  ------------------
  |  Branch (944:7): [True: 0, False: 0]
  ------------------
  945|      0|    BLOSC_TRACE_ERROR("`info` symbol cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  946|      0|    dlclose(lib);
  947|      0|    return BLOSC2_ERROR_FAILURE;
  948|      0|  }
  949|      0|  codec->encoder = dlsym(lib, info->encoder);
  950|      0|  codec->decoder = dlsym(lib, info->decoder);
  951|       |
  952|      0|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (952:7): [True: 0, False: 0]
  |  Branch (952:33): [True: 0, False: 0]
  ------------------
  953|      0|    BLOSC_TRACE_ERROR("encoder or decoder cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  954|      0|    dlclose(lib);
  955|      0|    return BLOSC2_ERROR_FAILURE;
  956|      0|  }
  957|       |
  958|       |  /* If ever add .free function in future for codec params
  959|       |  codecparams_info *info2 = dlsym(lib, "info2");
  960|       |  if (info2 != NULL) {
  961|       |    // New plugin (e.g. openzl) with free function for codec_params defined
  962|       |    // will be used when destroying context in blosc2_free_ctx
  963|       |      codec->free = dlsym(lib, info2->free);
  964|       |  }
  965|       |  else{
  966|       |    codec->free = NULL;
  967|       |  }
  968|       |  */
  969|       |
  970|      0|  return BLOSC2_ERROR_SUCCESS;
  971|      0|}
_cycle_buffers:
 1048|  20.2k|void _cycle_buffers(uint8_t **src, uint8_t **dest, uint8_t **tmp) {
 1049|  20.2k|  uint8_t *tmp2 = *src;
 1050|  20.2k|  *src = *dest;
 1051|  20.2k|  *dest = *tmp;
 1052|  20.2k|  *tmp = tmp2;
 1053|  20.2k|}
pipeline_backward:
 1475|  6.14k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1476|  6.14k|  blosc2_context* context = thread_context->parent_context;
 1477|  6.14k|  int32_t typesize = context->typesize;
 1478|  6.14k|  uint8_t* filters = context->filters;
 1479|  6.14k|  uint8_t* filters_meta = context->filters_meta;
 1480|  6.14k|  uint8_t* _src = src;
 1481|  6.14k|  uint8_t* _dest = tmp;
 1482|  6.14k|  uint8_t* _tmp = tmp2;
 1483|  6.14k|  int errcode = 0;
 1484|       |
 1485|  31.0k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1485:40): [True: 31.0k, False: 0]
  ------------------
 1486|       |    // Delta filter requires the whole chunk ready
 1487|  31.0k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1487:28): [True: 6.05k, False: 24.9k]
  |  Branch (1487:56): [True: 6.00k, False: 18.9k]
  ------------------
 1488|  18.9k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1488:28): [True: 6.31k, False: 12.6k]
  ------------------
 1489|  31.0k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1489:9): [True: 18.3k, False: 12.6k]
  |  Branch (1489:29): [True: 18.3k, False: 0]
  ------------------
 1490|  18.3k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1490:10): [True: 8.52k, False: 9.86k]
  |  Branch (1490:39): [True: 6.43k, False: 3.42k]
  ------------------
 1491|  14.9k|      _dest = dest + offset;
 1492|  14.9k|    }
 1493|  31.0k|    int rc = BLOSC2_ERROR_SUCCESS;
 1494|  31.0k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1494:9): [True: 27.8k, False: 3.18k]
  ------------------
 1495|  27.8k|      switch (filters[i]) {
 1496|  4.99k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1496:9): [True: 4.99k, False: 22.8k]
  ------------------
 1497|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1498|  4.99k|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1498:28): [True: 2.57k, False: 2.42k]
  ------------------
 1499|  4.99k|          break;
 1500|  3.55k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1500:9): [True: 3.55k, False: 24.3k]
  ------------------
 1501|  3.55k|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1501:15): [True: 0, False: 3.55k]
  ------------------
 1502|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1503|      0|          }
 1504|  3.55k|          break;
 1505|  8.52k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1505:9): [True: 8.52k, False: 19.3k]
  ------------------
 1506|  8.52k|          if (context->nthreads == 1) {
  ------------------
  |  Branch (1506:15): [True: 8.52k, False: 0]
  ------------------
 1507|       |            /* Serial mode */
 1508|  8.52k|            delta_decoder(dest, offset, bsize, typesize, _dest);
 1509|  8.52k|          } else {
 1510|      0|            struct blosc_job_group *job = context->job;
 1511|      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 (1511:51): [True: 0, False: 0]
  ------------------
 1512|      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 (1512:47): [True: 0, False: 0]
  ------------------
 1513|      0|            int *dref_not_init = job != NULL ? &job->dref_not_init : &context->dref_not_init;
  ------------------
  |  Branch (1513:34): [True: 0, False: 0]
  ------------------
 1514|       |            /* Force the thread in charge of the block 0 to go first */
 1515|      0|            blosc2_pthread_mutex_lock(delta_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 1516|      0|            if (*dref_not_init) {
  ------------------
  |  Branch (1516:17): [True: 0, False: 0]
  ------------------
 1517|      0|              if (offset != 0) {
  ------------------
  |  Branch (1517:19): [True: 0, False: 0]
  ------------------
 1518|      0|                blosc2_pthread_cond_wait(delta_cv, delta_mutex);
  ------------------
  |  |   98|      0|#define blosc2_pthread_cond_wait(a, b) pthread_cond_wait((a), (b))
  ------------------
 1519|      0|              } else {
 1520|      0|                delta_decoder(dest, offset, bsize, typesize, _dest);
 1521|      0|                *dref_not_init = 0;
 1522|      0|                blosc2_pthread_cond_broadcast(delta_cv);
  ------------------
  |  |  100|      0|#define blosc2_pthread_cond_broadcast(a) pthread_cond_broadcast((a))
  ------------------
 1523|      0|              }
 1524|      0|            }
 1525|      0|            blosc2_pthread_mutex_unlock(delta_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 1526|      0|            if (offset != 0) {
  ------------------
  |  Branch (1526:17): [True: 0, False: 0]
  ------------------
 1527|      0|              delta_decoder(dest, offset, bsize, typesize, _dest);
 1528|      0|            }
 1529|      0|          }
 1530|  8.52k|          break;
 1531|  2.19k|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1531:9): [True: 2.19k, False: 25.6k]
  ------------------
 1532|       |          // TRUNC_PREC filter does not need to be undone
 1533|  2.19k|          break;
 1534|  8.58k|        default:
  ------------------
  |  Branch (1534:9): [True: 8.58k, False: 19.2k]
  ------------------
 1535|  8.58k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1535:15): [True: 152, False: 8.43k]
  ------------------
 1536|    152|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   93|    152|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    152|    do {                                            \
  |  |  |  |   98|    152|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    152|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 152, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    152|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1537|    152|                              filters[i]);
 1538|    152|            errcode = -1;
 1539|    152|          }
 1540|  27.8k|      }
 1541|  27.8k|    } else {
 1542|       |        // Look for the filters_meta in user filters and run it
 1543|  13.2k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1543:30): [True: 13.0k, False: 134]
  ------------------
 1544|  13.0k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1544:15): [True: 3.05k, False: 10.0k]
  ------------------
 1545|  3.05k|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1545:17): [True: 0, False: 3.05k]
  ------------------
 1546|       |              // Dynamically load filter
 1547|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1547:19): [True: 0, False: 0]
  ------------------
 1548|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1549|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1550|      0|              }
 1551|      0|            }
 1552|  3.05k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1552:17): [True: 3.05k, False: 0]
  ------------------
 1553|  3.05k|              blosc2_dparams dparams;
 1554|  3.05k|              blosc2_ctx_get_dparams(context, &dparams);
 1555|  3.05k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1556|  3.05k|            } else {
 1557|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1558|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1559|      0|            }
 1560|  3.05k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1560:17): [True: 28, False: 3.02k]
  ------------------
 1561|     28|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   93|     28|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     28|    do {                                            \
  |  |  |  |   98|     28|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     28|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 28, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     28|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1562|     28|              return rc;
 1563|     28|            }
 1564|  3.02k|            goto urfiltersuccess;
 1565|  3.05k|          }
 1566|  13.0k|        }
 1567|    134|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|    134|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    134|    do {                                            \
  |  |  |  |   98|    134|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    134|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 134, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    134|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1568|    134|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1569|  3.02k|      urfiltersuccess:;
 1570|  3.02k|    }
 1571|       |
 1572|       |    // Cycle buffers when required
 1573|  30.8k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1573:9): [True: 22.4k, False: 8.43k]
  |  Branch (1573:43): [True: 20.2k, False: 2.19k]
  ------------------
 1574|  20.2k|      _cycle_buffers(&_src, &_dest, &_tmp);
 1575|  20.2k|    }
 1576|  30.8k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1576:9): [True: 5.97k, False: 24.9k]
  ------------------
 1577|  5.97k|      break;
 1578|  5.97k|    }
 1579|  30.8k|  }
 1580|       |
 1581|  5.97k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1581:7): [True: 5.97k, False: 0]
  |  Branch (1581:38): [True: 390, False: 5.58k]
  ------------------
 1582|    390|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1583|    390|  }
 1584|       |
 1585|       |  /* Postfilter function */
 1586|  5.97k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1586:7): [True: 0, False: 5.97k]
  ------------------
 1587|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1588|      0|    blosc2_postfilter_params postparams;
 1589|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1590|      0|    postparams.input = _src;
 1591|      0|    postparams.output = dest + offset;
 1592|      0|    postparams.size = bsize;
 1593|      0|    postparams.typesize = typesize;
 1594|      0|    postparams.offset = nblock * context->blocksize;
 1595|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1595:25): [True: 0, False: 0]
  ------------------
 1596|      0|    postparams.nblock = nblock;
 1597|      0|    postparams.tid = thread_context->tid;
 1598|      0|    postparams.ttmp = thread_context->tmp;
 1599|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1600|      0|    postparams.ctx = context;
 1601|       |
 1602|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1602:9): [True: 0, False: 0]
  ------------------
 1603|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|      0|      return BLOSC2_ERROR_POSTFILTER;
 1605|      0|    }
 1606|      0|  }
 1607|       |
 1608|  5.97k|  return errcode;
 1609|  5.97k|}
free_thread_context:
 2294|  13.5k|void free_thread_context(struct thread_context* thread_context) {
 2295|  13.5k|  destroy_thread_context(thread_context);
 2296|  13.5k|  my_free(thread_context);
 2297|  13.5k|}
check_nthreads:
 2300|  13.5k|int check_nthreads(blosc2_context* context) {
 2301|  13.5k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2301:7): [True: 0, False: 13.5k]
  |  Branch (2301:53): [True: 0, False: 0]
  ------------------
 2302|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2302|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2303|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2304|      0|  }
 2305|  13.5k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2305:7): [True: 0, False: 13.5k]
  ------------------
 2306|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2306|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2307|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2308|      0|  }
 2309|       |
 2310|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2311|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2312|       |   * clear it so the re-attach logic below creates a fresh one. */
 2313|  13.5k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|  27.1k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2313:7): [True: 0, False: 13.5k]
  ------------------
 2314|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2314:7): [True: 0, False: 0]
  ------------------
 2315|      0|    context->thread_pool = NULL;
 2316|      0|    context->threads_started = 0;
 2317|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2318|      0|  }
 2319|       |
 2320|  13.5k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2320:7): [True: 0, False: 13.5k]
  ------------------
 2321|      0|    release_thread_backend(context);
 2322|      0|    context->nthreads = context->new_nthreads;
 2323|      0|  }
 2324|  13.5k|  if (context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2324:7): [True: 0, False: 13.5k]
  |  Branch (2324:32): [True: 0, False: 0]
  ------------------
 2325|      0|    int rc;
 2326|      0|    if (threads_callback) {
  ------------------
  |  Branch (2326:9): [True: 0, False: 0]
  ------------------
 2327|      0|      rc = init_callback_threads(context);
 2328|      0|    }
 2329|      0|    else {
 2330|       |#if defined(_WIN32)
 2331|       |      rc = init_threadpool(context);
 2332|       |#else
 2333|      0|      rc = attach_shared_pool(context);
 2334|      0|#endif
 2335|      0|    }
 2336|      0|    if (rc < 0) {
  ------------------
  |  Branch (2336:9): [True: 0, False: 0]
  ------------------
 2337|      0|      return rc;
 2338|      0|    }
 2339|      0|  }
 2340|  13.5k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2340:7): [True: 13.5k, False: 0]
  ------------------
 2341|  13.5k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  13.5k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2342|  13.5k|  }
 2343|       |
 2344|  13.5k|  return context->nthreads;
 2345|  13.5k|}
blosc2_decompress:
 4202|  14.6k|int blosc2_decompress(const void* src, int32_t srcsize, void* dest, int32_t destsize) {
 4203|  14.6k|  int result;
 4204|  14.6k|  char* envvar;
 4205|  14.6k|  long nthreads;
 4206|  14.6k|  blosc2_context *dctx;
 4207|  14.6k|  blosc2_dparams dparams = BLOSC2_DPARAMS_DEFAULTS;
 4208|       |
 4209|       |  /* Check whether the library should be initialized */
 4210|  14.6k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (4210:7): [True: 0, False: 14.6k]
  ------------------
 4211|       |
 4212|       |  /* Check for a BLOSC_NTHREADS environment variable */
 4213|  14.6k|  envvar = getenv("BLOSC_NTHREADS");
 4214|  14.6k|  if (envvar != NULL) {
  ------------------
  |  Branch (4214:7): [True: 0, False: 14.6k]
  ------------------
 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|  14.6k|  envvar = getenv("BLOSC_NOLOCK");
 4233|  14.6k|  if (envvar != NULL) {
  ------------------
  |  Branch (4233:7): [True: 0, False: 14.6k]
  ------------------
 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|  14.6k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  14.6k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 4246|       |
 4247|  14.6k|  result = blosc_run_decompression_with_context(
 4248|  14.6k|          g_global_context, src, srcsize, dest, destsize);
 4249|       |
 4250|  14.6k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  14.6k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 4251|       |
 4252|  14.6k|  return result;
 4253|  14.6k|}
blosc2_set_nthreads:
 5619|  14.9k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5620|  14.9k|  int16_t ret;          /* the previous number of threads */
 5621|       |
 5622|       |  /* Check whether the library should be initialized */
 5623|  14.9k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5623:7): [True: 0, False: 14.9k]
  ------------------
 5624|       |
 5625|  14.9k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  14.9k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5626|  14.9k|  ret = g_nthreads;
 5627|  14.9k|  if (nthreads != ret) {
  ------------------
  |  Branch (5627:7): [True: 0, False: 14.9k]
  ------------------
 5628|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5629|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5630|      0|    g_nthreads = nthreads;
 5631|      0|    g_global_context->new_nthreads = nthreads;
 5632|      0|    int16_t ret2 = check_nthreads(g_global_context);
 5633|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5633:9): [True: 0, False: 0]
  ------------------
 5634|      0|      g_nthreads = ret;
 5635|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5636|      0|      g_global_context->nthreads = old_nthreads;
 5637|      0|      check_nthreads(g_global_context);
 5638|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5639|      0|      return ret2;
 5640|      0|    }
 5641|      0|  }
 5642|  14.9k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  14.9k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5643|       |
 5644|  14.9k|  return ret;
 5645|  14.9k|}
blosc1_cbuffer_sizes:
 5789|  14.9k|void blosc1_cbuffer_sizes(const void* cbuffer, size_t* nbytes, size_t* cbytes, size_t* blocksize) {
 5790|  14.9k|  int32_t nbytes32, cbytes32, blocksize32;
 5791|  14.9k|  blosc2_cbuffer_sizes(cbuffer, &nbytes32, &cbytes32, &blocksize32);
 5792|  14.9k|  *nbytes = nbytes32;
 5793|  14.9k|  *cbytes = cbytes32;
 5794|  14.9k|  *blocksize = blocksize32;
 5795|  14.9k|}
blosc2_cbuffer_sizes:
 5797|   182k|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 5798|   182k|  blosc_header header;
 5799|   182k|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 5800|   182k|  if (rc < 0) {
  ------------------
  |  Branch (5800:7): [True: 84, False: 182k]
  ------------------
 5801|       |    /* Return zeros if error reading header */
 5802|     84|    memset(&header, 0, sizeof(header));
 5803|     84|  }
 5804|       |
 5805|       |  /* Read the interesting values */
 5806|   182k|  if (nbytes != NULL)
  ------------------
  |  Branch (5806:7): [True: 182k, False: 0]
  ------------------
 5807|   182k|    *nbytes = header.nbytes;
 5808|   182k|  if (cbytes != NULL)
  ------------------
  |  Branch (5808:7): [True: 182k, False: 0]
  ------------------
 5809|   182k|    *cbytes = header.cbytes;
 5810|   182k|  if (blocksize != NULL)
  ------------------
  |  Branch (5810:7): [True: 14.9k, False: 167k]
  ------------------
 5811|  14.9k|    *blocksize = header.blocksize;
 5812|   182k|  return rc;
 5813|   182k|}
blosc1_cbuffer_validate:
 5815|  14.7k|int blosc1_cbuffer_validate(const void* cbuffer, size_t cbytes, size_t* nbytes) {
 5816|  14.7k|  int32_t header_cbytes;
 5817|  14.7k|  int32_t header_nbytes;
 5818|  14.7k|  if (cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (5818:7): [True: 0, False: 14.7k]
  ------------------
 5819|       |    /* Compressed data should contain enough space for header */
 5820|      0|    *nbytes = 0;
 5821|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 5822|      0|  }
 5823|  14.7k|  int rc = blosc2_cbuffer_sizes(cbuffer, &header_nbytes, &header_cbytes, NULL);
 5824|  14.7k|  if (rc < 0) {
  ------------------
  |  Branch (5824:7): [True: 0, False: 14.7k]
  ------------------
 5825|      0|    *nbytes = 0;
 5826|      0|    return rc;
 5827|      0|  }
 5828|  14.7k|  *nbytes = header_nbytes;
 5829|  14.7k|  if (header_cbytes != (int32_t)cbytes) {
  ------------------
  |  Branch (5829:7): [True: 0, False: 14.7k]
  ------------------
 5830|       |    /* Compressed size from header does not match `cbytes` */
 5831|      0|    *nbytes = 0;
 5832|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 5833|      0|  }
 5834|  14.7k|  if (*nbytes > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (5834:7): [True: 53, False: 14.6k]
  ------------------
 5835|       |    /* Uncompressed size is larger than allowed */
 5836|     53|    *nbytes = 0;
 5837|     53|    return BLOSC2_ERROR_MEMORY_ALLOC;
 5838|     53|  }
 5839|  14.6k|  return 0;
 5840|  14.7k|}
blosc2_init:
 5948|  14.9k|void blosc2_init(void) {
 5949|       |  /* Return if Blosc is already initialized */
 5950|  14.9k|  if (g_initlib) return;
  ------------------
  |  Branch (5950:7): [True: 0, False: 14.9k]
  ------------------
 5951|       |
 5952|  14.9k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 5953|  14.9k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 5954|  14.9k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 5955|  14.9k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 5956|  14.9k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 5957|  14.9k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 5958|  14.9k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 5959|  14.9k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 5960|  14.9k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 5961|  14.9k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 5962|       |
 5963|  14.9k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 5964|       |
 5965|  14.9k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 5966|  14.9k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 5967|  14.9k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 5968|  14.9k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 5969|  14.9k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 5970|  14.9k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 5971|  14.9k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 5972|  14.9k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 5973|  14.9k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 5974|  14.9k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 5975|       |
 5976|  14.9k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 5977|       |
 5978|  14.9k|  g_ncodecs = 0;
 5979|  14.9k|  g_nfilters = 0;
 5980|  14.9k|  g_ntuners = 0;
 5981|       |
 5982|  14.9k|#if defined(HAVE_PLUGINS)
 5983|  14.9k|  #include "blosc2/blosc2-common.h"
 5984|  14.9k|  #include "blosc2/blosc2-stdio.h"
 5985|  14.9k|  register_codecs();
 5986|  14.9k|  register_filters();
 5987|  14.9k|  register_tuners();
 5988|  14.9k|#endif
 5989|  14.9k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  14.9k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5990|  14.9k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  14.9k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5991|       |  /* Create a global context */
 5992|  14.9k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5993|  14.9k|  memset(g_global_context, 0, sizeof(blosc2_context));
 5994|  14.9k|  g_global_context->nthreads = g_nthreads;
 5995|  14.9k|  g_global_context->new_nthreads = g_nthreads;
 5996|  14.9k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  14.9k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5997|  14.9k|  g_initlib = 1;
 5998|  14.9k|}
blosc2_free_resources:
 6001|  14.9k|int blosc2_free_resources(void) {
 6002|       |  /* Return if Blosc is not initialized */
 6003|  14.9k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (6003:7): [True: 0, False: 14.9k]
  ------------------
 6004|       |
 6005|  14.9k|  return release_thread_backend(g_global_context);
 6006|  14.9k|}
blosc2_destroy:
 6009|  14.9k|void blosc2_destroy(void) {
 6010|       |  /* Return if Blosc is not initialized */
 6011|  14.9k|  if (!g_initlib) return;
  ------------------
  |  Branch (6011:7): [True: 0, False: 14.9k]
  ------------------
 6012|       |
 6013|  14.9k|  blosc2_free_resources();
 6014|  14.9k|  g_initlib = 0;
 6015|  14.9k|  blosc2_free_ctx(g_global_context);
 6016|       |
 6017|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 6018|       |   * Do this before freeing the pools so that release_thread_backend callers
 6019|       |   * that race with us will take the "skip" path rather than locking the
 6020|       |   * soon-to-be-destroyed pool_registry_mutex. */
 6021|  14.9k|  g_destroy_count++;
 6022|       |
 6023|       |  /* Tear down any remaining shared pools */
 6024|  14.9k|  struct blosc_shared_pool *pool = shared_pools;
 6025|  14.9k|  while (pool != NULL) {
  ------------------
  |  Branch (6025:10): [True: 0, False: 14.9k]
  ------------------
 6026|      0|    struct blosc_shared_pool *next = pool->next;
 6027|      0|    destroy_shared_pool(pool);
 6028|      0|    pool = next;
 6029|      0|  }
 6030|  14.9k|  shared_pools = NULL;
 6031|  14.9k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  14.9k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6032|       |
 6033|  14.9k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  14.9k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6034|  14.9k|}
blosc2_free_ctx:
 6290|  14.9k|void blosc2_free_ctx(blosc2_context* context) {
 6291|  14.9k|  if (g_initlib ||
  ------------------
  |  Branch (6291:7): [True: 0, False: 14.9k]
  ------------------
 6292|  14.9k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  29.8k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6292:7): [True: 0, False: 14.9k]
  ------------------
 6293|  14.9k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  14.9k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6293:7): [True: 0, False: 14.9k]
  ------------------
 6294|      0|    release_thread_backend(context);
 6295|      0|  }
 6296|  14.9k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6296:7): [True: 13.5k, False: 1.35k]
  ------------------
 6297|  13.5k|    free_thread_context(context->serial_context);
 6298|  13.5k|  }
 6299|  14.9k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  14.9k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6300|  14.9k|  release_context_dict_buffer(context);
 6301|  14.9k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6301:7): [True: 0, False: 14.9k]
  ------------------
 6302|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6302:9): [True: 0, False: 0]
  ------------------
 6303|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6304|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6304:16): [True: 0, False: 0]
  ------------------
 6305|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6306|      0|    }
 6307|      0|#ifdef HAVE_ZSTD
 6308|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6308:14): [True: 0, False: 0]
  ------------------
 6309|      0|      ZSTD_freeCDict(context->dict_cdict);
 6310|      0|    }
 6311|      0|#endif
 6312|      0|  }
 6313|  14.9k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6313:7): [True: 2.82k, False: 12.0k]
  ------------------
 6314|  2.82k|#ifdef HAVE_ZSTD
 6315|  2.82k|    ZSTD_freeDDict(context->dict_ddict);
 6316|  2.82k|#endif
 6317|  2.82k|  }
 6318|  14.9k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6318:7): [True: 0, False: 14.9k]
  ------------------
 6319|      0|    int rc;
 6320|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6320:9): [True: 0, False: 0]
  |  Branch (6320:49): [True: 0, False: 0]
  ------------------
 6321|      0|      rc = blosc_stune_free(context);
 6322|      0|    } else {
 6323|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6323:23): [True: 0, False: 0]
  ------------------
 6324|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6324:13): [True: 0, False: 0]
  ------------------
 6325|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6325:15): [True: 0, False: 0]
  ------------------
 6326|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6326:17): [True: 0, False: 0]
  ------------------
 6327|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6328|      0|              return;
 6329|      0|            }
 6330|      0|          }
 6331|      0|          rc = g_tuners[i].free(context);
 6332|      0|          goto urtunersuccess;
 6333|      0|        }
 6334|      0|      }
 6335|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6336|      0|      return;
 6337|      0|      urtunersuccess:;
 6338|      0|    }
 6339|      0|    if (rc < 0) {
  ------------------
  |  Branch (6339:9): [True: 0, False: 0]
  ------------------
 6340|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6341|      0|      return;
 6342|      0|    }
 6343|      0|  }
 6344|       |  /* May be needed if codec_params ever contains nested objects
 6345|       |  if (context->codec_params != NULL) {
 6346|       |    int rc;
 6347|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6348|       |      if (g_codecs[i].compcode == context->compcode) {
 6349|       |        if (g_codecs[i].free == NULL) {
 6350|       |          // Dynamically load codec plugin
 6351|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6352|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6353|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6354|       |          }
 6355|       |        }
 6356|       |        if (g_codecs[i].free == NULL){
 6357|       |          // no free func, codec_params is simple
 6358|       |          my_free(context->codec_params);
 6359|       |        }
 6360|       |        else{ // has free function for codec_params (e.g. openzl)
 6361|       |        rc = g_codecs[i].free(context->codec_params);
 6362|       |          goto urcodecsuccess;
 6363|       |        }
 6364|       |      }
 6365|       |    }
 6366|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6367|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6368|       |    urcodecsuccess:;
 6369|       |    if (rc < 0) {
 6370|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6371|       |      return;
 6372|       |    }
 6373|       |  }
 6374|       |  */
 6375|  14.9k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6375:7): [True: 0, False: 14.9k]
  ------------------
 6376|      0|    my_free(context->preparams);
 6377|      0|  }
 6378|  14.9k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6378:7): [True: 0, False: 14.9k]
  ------------------
 6379|      0|    my_free(context->postparams);
 6380|      0|  }
 6381|       |
 6382|  14.9k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6382:7): [True: 0, False: 14.9k]
  ------------------
 6383|      0|    free(context->block_maskout);
 6384|      0|  }
 6385|  14.9k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6385:7): [True: 255, False: 14.6k]
  ------------------
 6386|    255|    free(context->blocknbytes);
 6387|    255|  }
 6388|  14.9k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6388:7): [True: 255, False: 14.6k]
  ------------------
 6389|    255|    free(context->blockoffsets);
 6390|    255|  }
 6391|  14.9k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6391:7): [True: 255, False: 14.6k]
  ------------------
 6392|    255|    free(context->blockcbytes);
 6393|    255|  }
 6394|  14.9k|  my_free(context);
 6395|  14.9k|}
blosc2_ctx_get_dparams:
 6422|  3.91k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6423|  3.91k|  dparams->nthreads = ctx->nthreads;
 6424|  3.91k|  dparams->schunk = ctx->schunk;
 6425|  3.91k|  dparams->postfilter = ctx->postfilter;
 6426|  3.91k|  dparams->postparams = ctx->postparams;
 6427|  3.91k|  dparams->typesize = ctx->typesize;
 6428|       |
 6429|  3.91k|  return BLOSC2_ERROR_SUCCESS;
 6430|  3.91k|}
register_filter_private:
 6642|  74.5k|int register_filter_private(blosc2_filter *filter) {
 6643|  74.5k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  74.5k|    do {                                            \
  |  |  105|  74.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 74.5k]
  |  |  ------------------
  |  |  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|  74.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 74.5k]
  |  |  ------------------
  ------------------
 6644|  74.5k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6644:9): [True: 0, False: 74.5k]
  ------------------
 6645|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6646|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6647|      0|    }
 6648|  74.5k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6648:9): [True: 0, False: 74.5k]
  ------------------
 6649|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6650|      0|        return BLOSC2_ERROR_FAILURE;
 6651|      0|    }
 6652|       |    /* This condition can never be fulfilled
 6653|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6654|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6655|       |        return BLOSC2_ERROR_FAILURE;
 6656|       |    }
 6657|       |    */
 6658|       |
 6659|   223k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6659:26): [True: 149k, False: 74.5k]
  ------------------
 6660|   149k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6660:11): [True: 0, False: 149k]
  ------------------
 6661|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6661:13): [True: 0, False: 0]
  ------------------
 6662|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6663|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6664|      0|          return BLOSC2_ERROR_FAILURE;
 6665|      0|        }
 6666|      0|        else {
 6667|       |          // Already registered, so no more actions needed
 6668|      0|          return BLOSC2_ERROR_SUCCESS;
 6669|      0|        }
 6670|      0|      }
 6671|   149k|    }
 6672|       |
 6673|  74.5k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6674|  74.5k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6675|       |
 6676|  74.5k|    return BLOSC2_ERROR_SUCCESS;
 6677|  74.5k|}
register_codec_private:
 6692|   134k|int register_codec_private(blosc2_codec *codec) {
 6693|   134k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|   134k|    do {                                            \
  |  |  105|   134k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 134k]
  |  |  ------------------
  |  |  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|   134k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 134k]
  |  |  ------------------
  ------------------
 6694|   134k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6694:9): [True: 0, False: 134k]
  ------------------
 6695|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6696|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6697|      0|    }
 6698|   134k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6698:9): [True: 0, False: 134k]
  ------------------
 6699|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6700|      0|      return BLOSC2_ERROR_FAILURE;
 6701|      0|    }
 6702|       |    /* This condition can never be fulfilled
 6703|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 6704|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 6705|       |      return BLOSC2_ERROR_FAILURE;
 6706|       |    }
 6707|       |     */
 6708|       |
 6709|   671k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (6709:21): [True: 537k, False: 134k]
  ------------------
 6710|   537k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (6710:11): [True: 0, False: 537k]
  ------------------
 6711|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (6711:13): [True: 0, False: 0]
  ------------------
 6712|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6713|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 6714|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 6715|      0|        }
 6716|      0|        else {
 6717|       |          // Already registered, so no more actions needed
 6718|      0|          return BLOSC2_ERROR_SUCCESS;
 6719|      0|        }
 6720|      0|      }
 6721|   537k|    }
 6722|       |
 6723|   134k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 6724|   134k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 6725|       |
 6726|   134k|    return BLOSC2_ERROR_SUCCESS;
 6727|   134k|}
register_tuner_private:
 6742|  14.9k|int register_tuner_private(blosc2_tuner *tuner) {
 6743|  14.9k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  14.9k|    do {                                            \
  |  |  105|  14.9k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 14.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|  14.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 14.9k]
  |  |  ------------------
  ------------------
 6744|  14.9k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (6744:7): [True: 0, False: 14.9k]
  ------------------
 6745|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6746|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 6747|      0|  }
 6748|  14.9k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (6748:7): [True: 0, False: 14.9k]
  ------------------
 6749|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6750|      0|    return BLOSC2_ERROR_FAILURE;
 6751|      0|  }
 6752|       |
 6753|  14.9k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6753:19): [True: 0, False: 14.9k]
  ------------------
 6754|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (6754:9): [True: 0, False: 0]
  ------------------
 6755|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (6755:11): [True: 0, False: 0]
  ------------------
 6756|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6757|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 6758|      0|        return BLOSC2_ERROR_FAILURE;
 6759|      0|      }
 6760|      0|      else {
 6761|       |        // Already registered, so no more actions needed
 6762|      0|        return BLOSC2_ERROR_SUCCESS;
 6763|      0|      }
 6764|      0|    }
 6765|      0|  }
 6766|       |
 6767|  14.9k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 6768|  14.9k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 6769|       |
 6770|  14.9k|  return BLOSC2_ERROR_SUCCESS;
 6771|  14.9k|}
_blosc2_register_io_cb:
 6784|  29.8k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 6785|       |
 6786|  44.7k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6786:24): [True: 44.7k, False: 2]
  ------------------
 6787|  44.7k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (6787:9): [True: 29.8k, False: 14.9k]
  ------------------
 6788|  29.8k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (6788:11): [True: 0, False: 29.8k]
  ------------------
 6789|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6790|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 6791|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 6792|      0|      }
 6793|  29.8k|      else {
 6794|       |        // Already registered, so no more actions needed
 6795|  29.8k|        return BLOSC2_ERROR_SUCCESS;
 6796|  29.8k|      }
 6797|  29.8k|    }
 6798|  44.7k|  }
 6799|       |
 6800|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 6801|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 6802|       |
 6803|      2|  return BLOSC2_ERROR_SUCCESS;
 6804|  29.8k|}
blosc2_error_string:
 6916|     19|const char *blosc2_error_string(int error_code) {
 6917|     19|  switch (error_code) {
 6918|     15|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (6918:5): [True: 15, False: 4]
  ------------------
 6919|     15|      return "Generic failure";
 6920|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (6920:5): [True: 0, False: 19]
  ------------------
 6921|      0|      return "Bad stream";
 6922|      0|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (6922:5): [True: 0, False: 19]
  ------------------
 6923|      0|      return "Invalid data";
 6924|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (6924:5): [True: 0, False: 19]
  ------------------
 6925|      0|      return "Memory alloc/realloc failure";
 6926|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (6926:5): [True: 0, False: 19]
  ------------------
 6927|      0|      return "Not enough space to read";
 6928|      4|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (6928:5): [True: 4, False: 15]
  ------------------
 6929|      4|      return "Not enough space to write";
 6930|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (6930:5): [True: 0, False: 19]
  ------------------
 6931|      0|      return "Codec not supported";
 6932|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (6932:5): [True: 0, False: 19]
  ------------------
 6933|      0|      return "Invalid parameter supplied to codec";
 6934|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (6934:5): [True: 0, False: 19]
  ------------------
 6935|      0|      return "Codec dictionary error";
 6936|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (6936:5): [True: 0, False: 19]
  ------------------
 6937|      0|      return "Version not supported";
 6938|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (6938:5): [True: 0, False: 19]
  ------------------
 6939|      0|      return "Invalid value in header";
 6940|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (6940:5): [True: 0, False: 19]
  ------------------
 6941|      0|      return "Invalid parameter supplied to function";
 6942|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (6942:5): [True: 0, False: 19]
  ------------------
 6943|      0|      return "File read failure";
 6944|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (6944:5): [True: 0, False: 19]
  ------------------
 6945|      0|      return "File write failure";
 6946|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (6946:5): [True: 0, False: 19]
  ------------------
 6947|      0|      return "File open failure";
 6948|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (6948:5): [True: 0, False: 19]
  ------------------
 6949|      0|      return "Not found";
 6950|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (6950:5): [True: 0, False: 19]
  ------------------
 6951|      0|      return "Bad run length encoding";
 6952|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (6952:5): [True: 0, False: 19]
  ------------------
 6953|      0|      return "Filter pipeline error";
 6954|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (6954:5): [True: 0, False: 19]
  ------------------
 6955|      0|      return "Chunk insert failure";
 6956|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (6956:5): [True: 0, False: 19]
  ------------------
 6957|      0|      return "Chunk append failure";
 6958|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (6958:5): [True: 0, False: 19]
  ------------------
 6959|      0|      return "Chunk update failure";
 6960|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (6960:5): [True: 0, False: 19]
  ------------------
 6961|      0|      return "Sizes larger than 2gb not supported";
 6962|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (6962:5): [True: 0, False: 19]
  ------------------
 6963|      0|      return "Super-chunk copy failure";
 6964|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (6964:5): [True: 0, False: 19]
  ------------------
 6965|      0|      return "Wrong type for frame";
 6966|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (6966:5): [True: 0, False: 19]
  ------------------
 6967|      0|      return "File truncate failure";
 6968|      0|    case BLOSC2_ERROR_LOCK:
  ------------------
  |  Branch (6968:5): [True: 0, False: 19]
  ------------------
 6969|      0|      return "Frame lock failure";
 6970|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (6970:5): [True: 0, False: 19]
  ------------------
 6971|      0|      return "Thread or thread context creation failure";
 6972|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (6972:5): [True: 0, False: 19]
  ------------------
 6973|      0|      return "Postfilter failure";
 6974|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (6974:5): [True: 0, False: 19]
  ------------------
 6975|      0|      return "Special frame failure";
 6976|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (6976:5): [True: 0, False: 19]
  ------------------
 6977|      0|      return "Special super-chunk failure";
 6978|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (6978:5): [True: 0, False: 19]
  ------------------
 6979|      0|      return "IO plugin error";
 6980|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (6980:5): [True: 0, False: 19]
  ------------------
 6981|      0|      return "Remove file failure";
 6982|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (6982:5): [True: 0, False: 19]
  ------------------
 6983|      0|      return "Pointer is null";
 6984|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (6984:5): [True: 0, False: 19]
  ------------------
 6985|      0|      return "Invalid index";
 6986|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (6986:5): [True: 0, False: 19]
  ------------------
 6987|      0|      return "Metalayer has not been found";
 6988|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (6988:5): [True: 0, False: 19]
  ------------------
 6989|      0|      return "Maximum buffersize exceeded";
 6990|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (6990:5): [True: 0, False: 19]
  ------------------
 6991|      0|      return "Tuner failure";
 6992|      0|    default:
  ------------------
  |  Branch (6992:5): [True: 0, False: 19]
  ------------------
 6993|      0|      return "Unknown error";
 6994|     19|  }
 6995|     19|}
blosc2.c:flags_to_filters:
  687|   199k|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  688|       |  /* Initialize the filter pipeline */
  689|   199k|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  690|       |  /* Fill the filter pipeline */
  691|   199k|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (691:7): [True: 164k, False: 34.3k]
  ------------------
  692|   164k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  693|   199k|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (693:7): [True: 167k, False: 31.9k]
  ------------------
  694|   167k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  695|   199k|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (695:7): [True: 33.1k, False: 165k]
  ------------------
  696|  33.1k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  697|   199k|}
blosc2.c:destroy_thread_context:
 2276|  13.5k|static void destroy_thread_context(struct thread_context* thread_context) {
 2277|  13.5k|  my_free(thread_context->tmp);
 2278|  13.5k|#if defined(HAVE_ZSTD)
 2279|  13.5k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2279:7): [True: 0, False: 13.5k]
  ------------------
 2280|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2281|      0|  }
 2282|  13.5k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2282:7): [True: 9.35k, False: 4.20k]
  ------------------
 2283|  9.35k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2284|  9.35k|  }
 2285|  13.5k|#endif
 2286|  13.5k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2286:7): [True: 0, False: 13.5k]
  ------------------
 2287|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2288|      0|  }
 2289|  13.5k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2289:7): [True: 0, False: 13.5k]
  ------------------
 2290|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2291|      0|  }
 2292|  13.5k|}
blosc2.c:my_free:
  272|  42.0k|static void my_free(void* block) {
  273|       |#if defined(_WIN32)
  274|       |  _aligned_free(block);
  275|       |#else
  276|  42.0k|  free(block);
  277|  42.0k|#endif  /* _WIN32 */
  278|  42.0k|}
blosc2.c:filters_to_flags:
  664|  6.31k|static uint8_t filters_to_flags(const uint8_t* filters) {
  665|  6.31k|  uint8_t flags = 0;
  666|       |
  667|  44.1k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (667:19): [True: 37.8k, False: 6.31k]
  ------------------
  668|  37.8k|    switch (filters[i]) {
  669|  2.48k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (669:7): [True: 2.48k, False: 35.3k]
  ------------------
  670|  2.48k|        flags |= BLOSC_DOSHUFFLE;
  671|  2.48k|        break;
  672|  1.49k|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (672:7): [True: 1.49k, False: 36.3k]
  ------------------
  673|  1.49k|        flags |= BLOSC_DOBITSHUFFLE;
  674|  1.49k|        break;
  675|  2.33k|      case BLOSC_DELTA:
  ------------------
  |  Branch (675:7): [True: 2.33k, False: 35.5k]
  ------------------
  676|  2.33k|        flags |= BLOSC_DODELTA;
  677|  2.33k|        break;
  678|  31.5k|      default :
  ------------------
  |  Branch (678:7): [True: 31.5k, False: 6.31k]
  ------------------
  679|  31.5k|        break;
  680|  37.8k|    }
  681|  37.8k|  }
  682|  6.31k|  return flags;
  683|  6.31k|}
blosc2.c:blosc2_calculate_blocks:
  854|  14.1k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  855|       |  /* Compute number of blocks in buffer */
  856|  14.1k|  context->nblocks = context->sourcesize / context->blocksize;
  857|  14.1k|  context->leftover = context->sourcesize % context->blocksize;
  858|  14.1k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (858:22): [True: 3.53k, False: 10.6k]
  ------------------
  859|  10.6k|                     (context->nblocks + 1) : context->nblocks;
  860|  14.1k|}
blosc2.c:clibcode_to_clibname:
  305|      9|static const char* clibcode_to_clibname(int clibcode) {
  306|      9|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (306:7): [True: 0, False: 9]
  ------------------
  307|      9|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (307:7): [True: 0, False: 9]
  ------------------
  308|      9|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (308:7): [True: 0, False: 9]
  ------------------
  309|      9|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (309:7): [True: 0, False: 9]
  ------------------
  310|     90|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (310:19): [True: 81, False: 9]
  ------------------
  311|     81|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (311:9): [True: 0, False: 81]
  ------------------
  312|      0|      return g_codecs[i].compname;
  313|     81|  }
  314|      9|  return NULL;                  /* should never happen */
  315|      9|}
blosc2.c:blosc_run_decompression_with_context:
 3911|  14.6k|                                                void* dest, int32_t destsize) {
 3912|  14.6k|  blosc_header header;
 3913|  14.6k|  int32_t ntbytes;
 3914|  14.6k|  int rc;
 3915|       |
 3916|  14.6k|  rc = read_chunk_header(src, srcsize, true, &header);
 3917|  14.6k|  if (rc < 0) {
  ------------------
  |  Branch (3917:7): [True: 81, False: 14.5k]
  ------------------
 3918|     81|    return rc;
 3919|     81|  }
 3920|       |
 3921|  14.5k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (3921:7): [True: 83, False: 14.5k]
  ------------------
 3922|       |    // Not enough space for writing into the destination
 3923|     83|    return BLOSC2_ERROR_WRITE_BUFFER;
 3924|     83|  }
 3925|       |
 3926|  14.5k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 3927|  14.5k|  if (rc < 0) {
  ------------------
  |  Branch (3927:7): [True: 948, False: 13.5k]
  ------------------
 3928|    948|    return rc;
 3929|    948|  }
 3930|       |
 3931|       |  /* Do the actual decompression */
 3932|  13.5k|  ntbytes = do_job(context);
 3933|  13.5k|  if (ntbytes < 0) {
  ------------------
  |  Branch (3933:7): [True: 12.7k, False: 818]
  ------------------
 3934|  12.7k|    return ntbytes;
 3935|  12.7k|  }
 3936|       |
 3937|  13.5k|  assert(ntbytes <= (int32_t)destsize);
 3938|    818|  return ntbytes;
 3939|  13.5k|}
blosc2.c:initialize_context_decompression:
 2689|  14.5k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2690|  14.5k|  int32_t bstarts_end;
 2691|  14.5k|  bool vlblocks;
 2692|       |
 2693|  14.5k|  context->do_compress = 0;
 2694|  14.5k|  context->src = (const uint8_t*)src;
 2695|  14.5k|  context->srcsize = srcsize;
 2696|  14.5k|  context->dest = (uint8_t*)dest;
 2697|  14.5k|  context->destsize = destsize;
 2698|  14.5k|  context->output_bytes = 0;
 2699|  14.5k|  context->vlblock_sources = NULL;
 2700|  14.5k|  context->vlblock_dests = NULL;
 2701|  14.5k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2701:7): [True: 0, False: 14.5k]
  ------------------
 2702|      0|    free(context->blocknbytes);
 2703|      0|    context->blocknbytes = NULL;
 2704|      0|  }
 2705|  14.5k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2705:7): [True: 0, False: 14.5k]
  ------------------
 2706|      0|    free(context->blockoffsets);
 2707|      0|    context->blockoffsets = NULL;
 2708|      0|  }
 2709|  14.5k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2709:7): [True: 0, False: 14.5k]
  ------------------
 2710|      0|    free(context->blockcbytes);
 2711|      0|    context->blockcbytes = NULL;
 2712|      0|  }
 2713|       |
 2714|  14.5k|  int rc = blosc2_initialize_context_from_header(context, header);
 2715|  14.5k|  if (rc < 0) {
  ------------------
  |  Branch (2715:7): [True: 0, False: 14.5k]
  ------------------
 2716|      0|    return rc;
 2717|      0|  }
 2718|  14.5k|  clear_context_decompression_dict(context);
 2719|  14.5k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2720|  14.5k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2720:19): [True: 6.31k, False: 8.19k]
  ------------------
 2721|  6.31k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2721:19): [True: 181, False: 6.13k]
  ------------------
 2722|       |
 2723|       |  /* Check that we have enough space to decompress */
 2724|  14.5k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2724:7): [True: 0, False: 14.5k]
  ------------------
 2725|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2726|      0|  }
 2727|       |
 2728|  14.5k|  if (context->block_maskout != NULL && context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2728:7): [True: 0, False: 14.5k]
  |  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|  14.5k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2736|  14.5k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2736:7): [True: 2, False: 14.5k]
  ------------------
 2737|      2|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|      2|                      context->special_type);
 2739|      2|    return BLOSC2_ERROR_DATA;
 2740|      2|  }
 2741|       |
 2742|  14.5k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2743|  14.5k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2743:7): [True: 52, False: 14.4k]
  |  Branch (2743:19): [True: 30, False: 22]
  ------------------
 2744|     30|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   93|     30|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     30|    do {                                            \
  |  |  |  |   98|     30|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     30|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 30, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     30|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2745|     30|    return BLOSC2_ERROR_DATA;
 2746|     30|  }
 2747|       |
 2748|  14.4k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2748:7): [True: 0, False: 14.4k]
  |  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|  14.4k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2755|  14.4k|  bstarts_end = context->header_overhead;
 2756|  14.4k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2756:7): [True: 14.3k, False: 172]
  |  Branch (2756:33): [True: 14.2k, False: 20]
  ------------------
 2757|  14.2k|    size_t bstarts_end_tmp;
 2758|  14.2k|    size_t bstarts_nbytes;
 2759|  14.2k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2759:9): [True: 0, False: 14.2k]
  ------------------
 2760|  14.2k|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2760:9): [True: 0, False: 14.2k]
  ------------------
 2761|  14.2k|        !checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2761:9): [True: 0, False: 14.2k]
  ------------------
 2762|  14.2k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2762:9): [True: 0, False: 14.2k]
  ------------------
 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|  14.2k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2768|  14.2k|  }
 2769|       |
 2770|  14.4k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2770:7): [True: 73, False: 14.4k]
  ------------------
 2771|     73|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|     73|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     73|    do {                                            \
  |  |  |  |   98|     73|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     73|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 73, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     73|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2772|     73|    return BLOSC2_ERROR_READ_BUFFER;
 2773|     73|  }
 2774|       |
 2775|  14.4k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2775:7): [True: 267, False: 14.1k]
  |  Branch (2775:19): [True: 100, False: 167]
  |  Branch (2775:30): [True: 100, False: 0]
  |  Branch (2775:56): [True: 100, False: 0]
  ------------------
 2776|    100|    size_t block_csizes_nbytes;
 2777|    100|    size_t trailer_meta_nbytes;
 2778|    100|    size_t lazy_trailer_end;
 2779|    100|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2779:9): [True: 0, False: 100]
  |  Branch (2779:33): [True: 0, False: 100]
  ------------------
 2780|    100|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2780:9): [True: 0, False: 100]
  ------------------
 2781|    100|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2781:9): [True: 0, False: 100]
  ------------------
 2782|    100|        !checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2782:9): [True: 0, False: 100]
  ------------------
 2783|    100|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2783:9): [True: 10, False: 90]
  ------------------
 2784|     10|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2785|     10|      return BLOSC2_ERROR_READ_BUFFER;
 2786|     10|    }
 2787|    100|  }
 2788|  14.3k|  srcsize -= bstarts_end;
 2789|       |
 2790|       |  /* Read optional dictionary if flag set */
 2791|  14.3k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2791:7): [True: 3.87k, False: 10.5k]
  |  Branch (2791:51): [True: 3.86k, False: 12]
  ------------------
 2792|  3.86k|    context->use_dict = 1;
 2793|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2794|  3.86k|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2794:9): [True: 3, False: 3.86k]
  ------------------
 2795|      3|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2796|      3|      return BLOSC2_ERROR_READ_BUFFER;
 2797|      3|    }
 2798|  3.86k|    srcsize -= sizeof(int32_t);
 2799|       |    // Read dictionary size
 2800|  3.86k|    context->dict_size = sw32_(context->src + bstarts_end);
 2801|  3.86k|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2801:9): [True: 33, False: 3.82k]
  |  Branch (2801:36): [True: 20, False: 3.80k]
  ------------------
 2802|     53|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|     53|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     53|    do {                                            \
  |  |  |  |   98|     53|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     53|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 53, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     53|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2803|     53|      return BLOSC2_ERROR_CODEC_DICT;
 2804|     53|    }
 2805|  3.80k|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2805:9): [True: 18, False: 3.78k]
  ------------------
 2806|     18|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   93|     18|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     18|    do {                                            \
  |  |  |  |   98|     18|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     18|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     18|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2807|     18|      return BLOSC2_ERROR_READ_BUFFER;
 2808|     18|    }
 2809|  3.78k|    srcsize -= context->dict_size;
 2810|       |    // dict_buffer points directly into the source chunk — no copy needed
 2811|  3.78k|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2812|  3.78k|    context->dict_buffer_owned = false;
 2813|  3.78k|#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|  3.78k|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2816:9): [True: 3.32k, False: 461]
  ------------------
 2817|  3.32k|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2818|  3.32k|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2818:11): [True: 499, False: 2.82k]
  ------------------
 2819|    499|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|    499|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    499|    do {                                            \
  |  |  |  |   98|    499|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    499|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 499, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    499|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2820|    499|        return BLOSC2_ERROR_CODEC_DICT;
 2821|    499|      }
 2822|  3.32k|    }
 2823|  3.78k|#endif   // HAVE_ZSTD
 2824|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2825|  3.78k|  }
 2826|  10.5k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2826:12): [True: 12, False: 10.5k]
  |  Branch (2826:56): [True: 12, False: 0]
  ------------------
 2827|     12|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2828|     12|    if (rc < 0) {
  ------------------
  |  Branch (2828:9): [True: 12, False: 0]
  ------------------
 2829|     12|      return rc;
 2830|     12|    }
 2831|     12|  }
 2832|       |
 2833|  13.8k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2833:7): [True: 255, False: 13.5k]
  |  Branch (2833:19): [True: 255, False: 0]
  |  Branch (2833:45): [True: 255, False: 0]
  ------------------
 2834|    255|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2835|    255|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    255|    do {                                            \
  |  |  105|    255|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 255]
  |  |  ------------------
  |  |  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|    255|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 255]
  |  |  ------------------
  ------------------
 2836|    255|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2837|    255|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    255|    do {                                            \
  |  |  105|    255|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 255]
  |  |  ------------------
  |  |  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|    255|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 255]
  |  |  ------------------
  ------------------
 2838|    255|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2839|    255|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    255|    do {                                            \
  |  |  105|    255|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 255]
  |  |  ------------------
  |  |  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|    255|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 255]
  |  |  ------------------
  ------------------
 2840|       |
 2841|    255|    if (is_lazy) {
  ------------------
  |  Branch (2841:9): [True: 89, False: 166]
  ------------------
 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|     89|      int32_t max_csize = 0;
 2846|    113|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2846:27): [True: 108, False: 5]
  ------------------
 2847|    108|        int32_t bstart = sw32_(context->bstarts + i);
 2848|    108|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2848:31): [True: 78, False: 30]
  ------------------
 2849|     78|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2850|    108|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2850:13): [True: 8, False: 100]
  |  Branch (2850:37): [True: 31, False: 69]
  ------------------
 2851|     84|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2851:13): [True: 45, False: 24]
  ------------------
 2852|     84|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   93|     84|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     84|    do {                                            \
  |  |  |  |   98|     84|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     84|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 84, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     84|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2853|     84|          return BLOSC2_ERROR_INVALID_HEADER;
 2854|     84|        }
 2855|     24|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2856|     24|        context->blockoffsets[i] = 0;  // unknown
 2857|     24|        context->blockcbytes[i] = next_bstart - bstart;
 2858|     24|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2858:13): [True: 13, False: 11]
  ------------------
 2859|     13|          max_csize = context->blockcbytes[i];
 2860|     13|        }
 2861|     24|      }
 2862|      5|      context->blocksize = max_csize;
 2863|      5|      context->leftover = 0;
 2864|      5|    }
 2865|    166|    else {
 2866|    166|      int32_t max_blocksize = 0;
 2867|    166|      int64_t total_nbytes = 0;
 2868|    166|      int32_t prev_bstart = 0;
 2869|    185|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2869:27): [True: 177, False: 8]
  ------------------
 2870|    177|        int32_t bstart = sw32_(context->bstarts + i);
 2871|    177|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2871:31): [True: 79, False: 98]
  ------------------
 2872|     98|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2873|    177|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2873:13): [True: 6, False: 171]
  |  Branch (2873:37): [True: 0, False: 171]
  |  Branch (2873:62): [True: 41, False: 130]
  ------------------
 2874|    130|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2874:13): [True: 49, False: 81]
  |  Branch (2874:45): [True: 2, False: 79]
  ------------------
 2875|     98|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|     98|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     98|    do {                                            \
  |  |  |  |   98|     98|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     98|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 98, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     98|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2876|     98|          return BLOSC2_ERROR_INVALID_HEADER;
 2877|     98|        }
 2878|     79|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2879|     79|        context->blockcbytes[i] = next_bstart - bstart;
 2880|     79|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2880:13): [True: 14, False: 65]
  ------------------
 2881|     14|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2882|     14|          return BLOSC2_ERROR_INVALID_HEADER;
 2883|     14|        }
 2884|     65|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2884:13): [True: 0, False: 65]
  ------------------
 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|     65|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2889|     65|        total_nbytes += context->blocknbytes[i];
 2890|     65|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2890:13): [True: 46, False: 19]
  ------------------
 2891|     46|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   93|     46|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     46|    do {                                            \
  |  |  |  |   98|     46|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     46|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 46, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     46|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2892|     46|          return BLOSC2_ERROR_INVALID_HEADER;
 2893|     46|        }
 2894|     19|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2894:13): [True: 15, False: 4]
  ------------------
 2895|     15|          max_blocksize = context->blocknbytes[i];
 2896|     15|        }
 2897|     19|        prev_bstart = bstart;
 2898|     19|      }
 2899|      8|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2899:11): [True: 6, False: 2]
  ------------------
 2900|      6|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2901|      6|        return BLOSC2_ERROR_INVALID_HEADER;
 2902|      6|      }
 2903|      2|      context->blocksize = max_blocksize;
 2904|      2|      context->leftover = 0;
 2905|      2|    }
 2906|    255|  }
 2907|       |
 2908|  13.5k|  return 0;
 2909|  13.8k|}
blosc2.c:load_lazy_chunk_dict:
 2635|     12|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 2636|     12|  int32_t dict_offset = bstarts_end;
 2637|     12|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2637:7): [True: 1, False: 11]
  ------------------
 2638|      1|    BLOSC_TRACE_ERROR("Lazy chunk dictionary header exceeds chunk length.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2639|      1|    return BLOSC2_ERROR_INVALID_HEADER;
 2640|      1|  }
 2641|       |
 2642|     11|  uint8_t dict_size_buf[sizeof(int32_t)];
 2643|     11|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 2644|     11|                                 "Cannot open frame file for lazy chunk dictionary read.",
 2645|     11|                                 "Cannot read lazy chunk dictionary size from disk.");
 2646|     11|  if (rc < 0) {
  ------------------
  |  Branch (2646:7): [True: 11, False: 0]
  ------------------
 2647|     11|    return rc;
 2648|     11|  }
 2649|       |
 2650|      0|  context->dict_size = sw32_(dict_size_buf);
 2651|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2651:7): [True: 0, False: 0]
  |  Branch (2651:34): [True: 0, False: 0]
  ------------------
 2652|      0|    BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2653|      0|    return BLOSC2_ERROR_CODEC_DICT;
 2654|      0|  }
 2655|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (2655:7): [True: 0, False: 0]
  ------------------
 2656|      0|    BLOSC_TRACE_ERROR("Lazy chunk dictionary exceeds chunk length.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2657|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2658|      0|  }
 2659|       |
 2660|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 2661|      0|  BLOSC_ERROR_NULL(context->dict_buffer, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2662|      0|  context->dict_buffer_owned = true;
 2663|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 2664|      0|                             context->dict_buffer, context->dict_size,
 2665|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 2666|      0|                             "Cannot read lazy chunk dictionary from disk.");
 2667|      0|  if (rc < 0) {
  ------------------
  |  Branch (2667:7): [True: 0, False: 0]
  ------------------
 2668|      0|    release_context_dict_buffer(context);
 2669|      0|    return rc;
 2670|      0|  }
 2671|       |
 2672|      0|  context->use_dict = 1;
 2673|      0|#if defined(HAVE_ZSTD)
 2674|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2674:7): [True: 0, False: 0]
  ------------------
 2675|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2676|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2676:9): [True: 0, False: 0]
  ------------------
 2677|      0|      release_context_dict_buffer(context);
 2678|      0|      BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for lazy chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2679|      0|      return BLOSC2_ERROR_CODEC_DICT;
 2680|      0|    }
 2681|      0|  }
 2682|      0|#endif
 2683|       |
 2684|      0|  return 0;
 2685|      0|}
blosc2.c:read_lazy_chunk_bytes:
 2565|     11|                                 const char* open_error, const char* read_error) {
 2566|     11|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (2566:7): [True: 11, False: 0]
  |  Branch (2566:34): [True: 0, False: 0]
  ------------------
 2567|     11|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2568|     11|    return BLOSC2_ERROR_INVALID_PARAM;
 2569|     11|  }
 2570|       |
 2571|      0|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2572|      0|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2573|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (2573:7): [True: 0, False: 0]
  ------------------
 2574|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2575|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 2576|      0|  }
 2577|       |
 2578|      0|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 2579|      0|                           context->nblocks * (int32_t)sizeof(int32_t);
 2580|      0|  int32_t nchunk_lazy;
 2581|      0|  int64_t chunk_offset;
 2582|      0|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 2583|      0|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 2584|       |
 2585|      0|  void* fp = NULL;
 2586|      0|  int64_t io_pos;
 2587|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2587:7): [True: 0, False: 0]
  ------------------
 2588|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 2589|      0|    io_pos = offset;
 2590|      0|  }
 2591|      0|  else {
 2592|      0|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (2592:9): [True: 0, False: 0]
  |  Branch (2592:29): [True: 0, False: 0]
  ------------------
 2593|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2594|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2595|      0|    }
 2596|      0|    fp = frame_reader_acquire(frame, context->schunk->storage->io);
 2597|      0|    if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (2597:9): [True: 0, False: 0]
  ------------------
 2598|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2599|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2599:11): [True: 0, False: 0]
  ------------------
 2600|      0|        frame_reader_release(frame, io_cb, fp);
 2601|      0|      }
 2602|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2603|      0|    }
 2604|      0|    io_pos = frame->file_offset + chunk_offset;
 2605|      0|    if (io_pos > INT64_MAX - offset) {
  ------------------
  |  Branch (2605:9): [True: 0, False: 0]
  ------------------
 2606|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2607|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2607:11): [True: 0, False: 0]
  ------------------
 2608|      0|        frame_reader_release(frame, io_cb, fp);
 2609|      0|      }
 2610|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2611|      0|    }
 2612|      0|    io_pos += offset;
 2613|      0|  }
 2614|      0|  if (fp == NULL) {
  ------------------
  |  Branch (2614:7): [True: 0, False: 0]
  ------------------
 2615|      0|    BLOSC_TRACE_ERROR("%s", open_error);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2616|      0|    return BLOSC2_ERROR_FILE_OPEN;
 2617|      0|  }
 2618|       |
 2619|      0|  uint8_t* read_buffer = buffer;
 2620|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 2621|      0|  frame_reader_release(frame, io_cb, fp);
 2622|      0|  if (read_buffer != buffer) {
  ------------------
  |  Branch (2622:7): [True: 0, False: 0]
  ------------------
 2623|      0|    memcpy(buffer, read_buffer, (size_t)nbytes);
 2624|      0|    free(read_buffer);
 2625|      0|  }
 2626|      0|  if (rbytes != nbytes) {
  ------------------
  |  Branch (2626:7): [True: 0, False: 0]
  ------------------
 2627|      0|    BLOSC_TRACE_ERROR("%s", read_error);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2628|      0|    return BLOSC2_ERROR_FILE_READ;
 2629|      0|  }
 2630|       |
 2631|      0|  return 0;
 2632|      0|}
blosc2.c:do_job:
 2349|  13.5k|static int do_job(blosc2_context* context) {
 2350|  13.5k|  int32_t ntbytes;
 2351|       |
 2352|       |  /* Set sentinels */
 2353|  13.5k|  context->dref_not_init = 1;
 2354|       |
 2355|       |  /* Check whether we need to restart threads.  If the thread backend could
 2356|       |     not be set up (e.g. shared-pool creation failed under thread/resource
 2357|       |     exhaustion), rc < 0 and context->thread_pool stays NULL; fall back to the
 2358|       |     serial path below instead of dereferencing a NULL pool in parallel_blosc.
 2359|       |     The failed pool creation already emitted a TRACE_ERROR, and the next
 2360|       |     do_job() re-attempts the attach, so the fallback is self-healing. */
 2361|  13.5k|  int rc = check_nthreads(context);
 2362|       |
 2363|       |  /* Run the serial version when nthreads is 1, when the buffers are not larger
 2364|       |     than blocksize, or when the parallel backend failed to start */
 2365|  13.5k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1 || rc < 0) {
  ------------------
  |  Branch (2365:7): [True: 13.5k, False: 0]
  |  Branch (2365:33): [True: 0, False: 0]
  |  Branch (2365:84): [True: 0, False: 0]
  ------------------
 2366|       |    /* The context for this 'thread' has no been initialized yet */
 2367|  13.5k|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2367:9): [True: 13.5k, False: 0]
  ------------------
 2368|  13.5k|      context->serial_context = create_thread_context(context, 0);
 2369|  13.5k|    }
 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|  13.5k|    BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  13.5k|    do {                                            \
  |  |  105|  13.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 13.5k]
  |  |  ------------------
  |  |  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|  13.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 13.5k]
  |  |  ------------------
  ------------------
 2375|  13.5k|    ntbytes = serial_blosc(context->serial_context);
 2376|  13.5k|  }
 2377|      0|  else {
 2378|      0|    ntbytes = parallel_blosc(context);
 2379|      0|  }
 2380|       |
 2381|  13.5k|  return ntbytes;
 2382|  13.5k|}
blosc2.c:serial_blosc:
 2161|  13.5k|static int serial_blosc(struct thread_context* thread_context) {
 2162|  13.5k|  blosc2_context* context = thread_context->parent_context;
 2163|  13.5k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2164|  13.5k|  int32_t j, bsize, leftoverblock;
 2165|  13.5k|  int32_t cbytes;
 2166|  13.5k|  int32_t ntbytes = context->output_bytes;
 2167|  13.5k|  int32_t* bstarts = context->bstarts;
 2168|  13.5k|  uint8_t* tmp = thread_context->tmp;
 2169|  13.5k|  uint8_t* tmp2 = thread_context->tmp2;
 2170|  13.5k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2170:23): [True: 3.28k, False: 10.2k]
  |  Branch (2170:44): [True: 3.28k, False: 0]
  ------------------
 2171|  13.5k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2172|  13.5k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2172:7): [True: 13.5k, False: 0]
  |  Branch (2172:32): [True: 142, False: 13.4k]
  ------------------
 2173|       |    // Fake a runlen as if it was a memcpyed chunk
 2174|    142|    memcpyed = true;
 2175|    142|  }
 2176|       |
 2177|   153k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2177:15): [True: 153k, False: 818]
  ------------------
 2178|   153k|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2178:9): [True: 0, False: 153k]
  |  Branch (2178:33): [True: 0, False: 0]
  |  Branch (2178:46): [True: 0, False: 0]
  ------------------
 2179|      0|      _sw32(bstarts + j, ntbytes);
 2180|      0|    }
 2181|   153k|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2181:13): [True: 7, False: 152k]
  ------------------
 2182|   153k|    leftoverblock = 0;
 2183|   153k|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2183:9): [True: 152k, False: 7]
  |  Branch (2183:22): [True: 10.4k, False: 142k]
  |  Branch (2183:53): [True: 409, False: 10.0k]
  ------------------
 2184|    409|      bsize = context->leftover;
 2185|    409|      leftoverblock = 1;
 2186|    409|    }
 2187|   153k|    if (context->do_compress) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 153k]
  ------------------
 2188|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2188:11): [True: 0, False: 0]
  |  Branch (2188:23): [True: 0, False: 0]
  ------------------
 2189|       |        /* We want to memcpy only */
 2190|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2191|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2192|      0|        cbytes = (int32_t)bsize;
 2193|      0|      }
 2194|      0|      else {
 2195|       |        /* Regular compression */
 2196|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2197|      0|                         context->destsize,
 2198|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2198:26): [True: 0, False: 0]
  ------------------
 2199|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2199:26): [True: 0, False: 0]
  ------------------
 2200|      0|                         context->dest + ntbytes, tmp, tmp2);
 2201|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2201:13): [True: 0, False: 0]
  ------------------
 2202|      0|          ntbytes = 0;              /* incompressible data */
 2203|      0|          break;
 2204|      0|        }
 2205|      0|      }
 2206|      0|    }
 2207|   153k|    else {
 2208|       |      /* Regular decompression */
 2209|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2210|   153k|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2210:28): [True: 133k, False: 19.9k]
  ------------------
 2211|   133k|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2212|   153k|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2212:30): [True: 7, False: 152k]
  |  Branch (2212:42): [True: 0, False: 7]
  ------------------
 2213|   153k|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2213:30): [True: 7, False: 152k]
  |  Branch (2213:42): [True: 0, False: 7]
  ------------------
 2214|   153k|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2214:30): [True: 7, False: 152k]
  ------------------
 2215|   153k|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2216|   153k|                       context->src, context->srcsize, src_offset, j,
 2217|   153k|                       dest_block, dest_offset, tmp, tmp2);
 2218|   153k|    }
 2219|       |
 2220|   153k|    if (cbytes < 0) {
  ------------------
  |  Branch (2220:9): [True: 12.7k, False: 140k]
  ------------------
 2221|  12.7k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2222|  12.7k|      break;
 2223|  12.7k|    }
 2224|   140k|    ntbytes += cbytes;
 2225|   140k|  }
 2226|       |
 2227|  13.5k|  return ntbytes;
 2228|  13.5k|}
blosc2.c:set_values:
 1644|    201|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 1645|       |#if defined(BLOSC_STRICT_ALIGN)
 1646|       |  if (destsize % typesize != 0) {
 1647|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 1648|       |  }
 1649|       |  int32_t nitems = destsize / typesize;
 1650|       |  if (nitems == 0) {
 1651|       |    return 0;
 1652|       |  }
 1653|       |  for (int i = 0; i < nitems; i++) {
 1654|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1655|       |  }
 1656|       |#else
 1657|    201|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1657:7): [True: 1, False: 200]
  ------------------
 1658|      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]
  |  |  ------------------
  ------------------
 1659|      1|  }
 1660|    200|  int32_t nitems = destsize / typesize;
 1661|    200|  if (nitems == 0) {
  ------------------
  |  Branch (1661:7): [True: 0, False: 200]
  ------------------
 1662|      0|    return 0;
 1663|      0|  }
 1664|       |
 1665|    200|  switch (typesize) {
 1666|     13|    case 8: {
  ------------------
  |  Branch (1666:5): [True: 13, False: 187]
  ------------------
 1667|     13|      int64_t val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1668|     13|      int64_t* dest8 = (int64_t*)dest;
 1669|     39|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1669:23): [True: 26, False: 13]
  ------------------
 1670|     26|        dest8[i] = val8;
 1671|     26|      }
 1672|     13|      break;
 1673|      0|    }
 1674|     23|    case 4: {
  ------------------
  |  Branch (1674:5): [True: 23, False: 177]
  ------------------
 1675|     23|      int32_t val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1676|     23|      int32_t* dest4 = (int32_t*)dest;
 1677|     84|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1677:23): [True: 61, False: 23]
  ------------------
 1678|     61|        dest4[i] = val4;
 1679|     61|      }
 1680|     23|      break;
 1681|      0|    }
 1682|     50|    case 2: {
  ------------------
  |  Branch (1682:5): [True: 50, False: 150]
  ------------------
 1683|     50|      int16_t val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1684|     50|      int16_t* dest2 = (int16_t*)dest;
 1685|    237|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1685:23): [True: 187, False: 50]
  ------------------
 1686|    187|        dest2[i] = val2;
 1687|    187|      }
 1688|     50|      break;
 1689|      0|    }
 1690|     93|    case 1: {
  ------------------
  |  Branch (1690:5): [True: 93, False: 107]
  ------------------
 1691|     93|      int8_t val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1692|     93|      int8_t* dest1 = (int8_t*)dest;
 1693|    367|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1693:23): [True: 274, False: 93]
  ------------------
 1694|    274|        dest1[i] = val1;
 1695|    274|      }
 1696|     93|      break;
 1697|      0|    }
 1698|     21|    default:
  ------------------
  |  Branch (1698:5): [True: 21, False: 179]
  ------------------
 1699|     72|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1699:23): [True: 51, False: 21]
  ------------------
 1700|     51|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1701|     51|      }
 1702|    200|  }
 1703|    200|#endif
 1704|       |
 1705|    200|  return nitems;
 1706|    200|}
blosc2.c:set_nans:
 1612|    395|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1613|    395|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1613:7): [True: 1, False: 394]
  ------------------
 1614|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|      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]
  |  |  ------------------
  ------------------
 1616|      1|  }
 1617|    394|  int32_t nitems = destsize / typesize;
 1618|    394|  if (nitems == 0) {
  ------------------
  |  Branch (1618:7): [True: 0, False: 394]
  ------------------
 1619|      0|    return 0;
 1620|      0|  }
 1621|       |
 1622|    394|  if (typesize == 4) {
  ------------------
  |  Branch (1622:7): [True: 225, False: 169]
  ------------------
 1623|    225|    float* dest_ = (float*)dest;
 1624|    225|    float val = nanf("");
 1625|  1.19k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1625:21): [True: 967, False: 225]
  ------------------
 1626|    967|      dest_[i] = val;
 1627|    967|    }
 1628|    225|    return nitems;
 1629|    225|  }
 1630|    169|  else if (typesize == 8) {
  ------------------
  |  Branch (1630:12): [True: 163, False: 6]
  ------------------
 1631|    163|    double* dest_ = (double*)dest;
 1632|    163|    double val = nan("");
 1633|    811|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1633:21): [True: 648, False: 163]
  ------------------
 1634|    648|      dest_[i] = val;
 1635|    648|    }
 1636|    163|    return nitems;
 1637|    163|  }
 1638|       |
 1639|      6|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1640|      6|  return BLOSC2_ERROR_DATA;
 1641|    394|}
blosc2.c:my_malloc:
  243|  42.0k|static uint8_t* my_malloc(size_t size) {
  244|  42.0k|  void* block = NULL;
  245|  42.0k|  int res = 0;
  246|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  247|  42.0k|  if (size == 0) {
  ------------------
  |  Branch (247:7): [True: 0, False: 42.0k]
  ------------------
  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|  42.0k|  res = posix_memalign(&block, 32, size);
  258|       |#else
  259|       |  block = malloc(size);
  260|       |#endif  /* _WIN32 */
  261|       |
  262|  42.0k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (262:7): [True: 0, False: 42.0k]
  |  Branch (262:24): [True: 0, False: 42.0k]
  ------------------
  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|  42.0k|  return (uint8_t*)block;
  268|  42.0k|}
blosc2.c:blosc_d:
 1713|   153k|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1714|   153k|  blosc2_context* context = thread_context->parent_context;
 1715|   153k|  uint8_t* filters = context->filters;
 1716|   153k|  uint8_t *tmp3 = thread_context->tmp4;
 1717|   153k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1718|   153k|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1719|   153k|  int dont_split = (context->header_flags & 0x10) >> 4;
 1720|   153k|  int32_t chunk_nbytes;
 1721|   153k|  int32_t chunk_cbytes;
 1722|   153k|  int nstreams;
 1723|   153k|  int32_t neblock;
 1724|   153k|  int32_t nbytes;                /* number of decompressed bytes in split */
 1725|   153k|  int32_t cbytes;                /* number of compressed bytes in split */
 1726|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1727|   153k|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1728|   153k|  uint8_t* _dest;
 1729|   153k|  int32_t typesize = context->typesize;
 1730|   153k|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1731|   153k|  const char* compname;
 1732|   153k|  int rc;
 1733|       |
 1734|   153k|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1734:7): [True: 0, False: 153k]
  |  Branch (1734:41): [True: 0, False: 0]
  ------------------
 1735|       |    // Do not decompress, but act as if we successfully decompressed everything
 1736|      0|    return bsize;
 1737|      0|  }
 1738|       |
 1739|   153k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1740|   153k|  if (rc < 0) {
  ------------------
  |  Branch (1740:7): [True: 0, False: 153k]
  ------------------
 1741|      0|    return rc;
 1742|      0|  }
 1743|   153k|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1743:7): [True: 201, False: 152k]
  ------------------
 1744|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1745|    201|    typesize = chunk_cbytes - context->header_overhead;
 1746|    201|  }
 1747|       |
 1748|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1749|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1750|   153k|  if (context->src == NULL) {
  ------------------
  |  Branch (1750:7): [True: 0, False: 153k]
  ------------------
 1751|      0|    context->src = src;
 1752|      0|  }
 1753|       |
 1754|       |  // Chunks with special values cannot be lazy
 1755|   153k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1755:19): [True: 143k, False: 9.26k]
  ------------------
 1756|   143k|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1756:11): [True: 583, False: 143k]
  |  Branch (1756:46): [True: 6, False: 577]
  ------------------
 1757|   153k|  if (is_lazy) {
  ------------------
  |  Branch (1757:7): [True: 6, False: 152k]
  ------------------
 1758|       |    // The chunk is on disk, so just lazily load the block
 1759|      6|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1759:9): [True: 6, False: 0]
  ------------------
 1760|      6|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1761|      6|      return BLOSC2_ERROR_INVALID_PARAM;
 1762|      6|    }
 1763|      0|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1763:9): [True: 0, False: 0]
  ------------------
 1764|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1765|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1766|      0|    }
 1767|      0|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1768|      0|    size_t bstarts_nbytes;
 1769|      0|    size_t trailer_offset;
 1770|      0|    size_t block_csizes_nbytes;
 1771|      0|    size_t trailer_meta_nbytes;
 1772|      0|    size_t lazy_trailer_end;
 1773|      0|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1773:9): [True: 0, False: 0]
  |  Branch (1773:24): [True: 0, False: 0]
  ------------------
 1774|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1774:9): [True: 0, False: 0]
  ------------------
 1775|      0|        !checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1775:9): [True: 0, False: 0]
  ------------------
 1776|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1776:9): [True: 0, False: 0]
  ------------------
 1777|      0|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1777:9): [True: 0, False: 0]
  ------------------
 1778|      0|        !checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1778:9): [True: 0, False: 0]
  ------------------
 1779|      0|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1779:9): [True: 0, False: 0]
  ------------------
 1780|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1781|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1782|      0|    }
 1783|      0|    int32_t nchunk;
 1784|      0|    int64_t chunk_offset;
 1785|       |    // The nchunk and the offset of the current chunk are in the trailer
 1786|      0|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1787|      0|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1788|       |    // Get the csize of the nblock
 1789|      0|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1789:9): [True: 0, False: 0]
  |  Branch (1789:23): [True: 0, False: 0]
  ------------------
 1790|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1791|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1792|      0|    }
 1793|      0|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1794|      0|    int32_t block_csize = block_csizes[nblock];
 1795|      0|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1796|      0|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1796:9): [True: 0, False: 0]
  |  Branch (1796:29): [True: 0, False: 0]
  ------------------
 1797|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1798|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1799|      0|    }
 1800|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1800:9): [True: 0, False: 0]
  |  Branch (1800:21): [True: 0, False: 0]
  ------------------
 1801|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1802|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1803|      0|    }
 1804|       |    // Read the lazy block on disk
 1805|      0|    void* fp = NULL;
 1806|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1807|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1807:9): [True: 0, False: 0]
  ------------------
 1808|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1809|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1810|      0|    }
 1811|       |
 1812|      0|    int64_t io_pos = 0;
 1813|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1813:9): [True: 0, False: 0]
  ------------------
 1814|       |      // The chunk is not in the frame
 1815|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1816|      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]
  |  |  ------------------
  ------------------
 1817|       |      // The offset of the block is src_offset
 1818|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1818:11): [True: 0, False: 0]
  ------------------
 1819|      0|        frame_reader_release(frame, io_cb, fp);
 1820|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1821|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1822|      0|      }
 1823|      0|      io_pos = src_offset;
 1824|      0|    }
 1825|      0|    else {
 1826|      0|      fp = frame_reader_acquire(frame, context->schunk->storage->io);
 1827|      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]
  |  |  ------------------
  ------------------
 1828|       |      // The offset of the block is src_offset
 1829|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1829:11): [True: 0, False: 0]
  ------------------
 1830|      0|        frame_reader_release(frame, io_cb, fp);
 1831|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1832|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1833|      0|      }
 1834|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1834:11): [True: 0, False: 0]
  ------------------
 1835|      0|        frame_reader_release(frame, io_cb, fp);
 1836|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1837|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1838|      0|      }
 1839|      0|      if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (1839:11): [True: 0, False: 0]
  ------------------
 1840|      0|        frame_reader_release(frame, io_cb, fp);
 1841|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1842|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1843|      0|      }
 1844|      0|      io_pos = frame->file_offset + chunk_offset;
 1845|      0|      if (io_pos > INT64_MAX - src_offset) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 0]
  ------------------
 1846|      0|        frame_reader_release(frame, io_cb, fp);
 1847|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1848|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1849|      0|      }
 1850|      0|      io_pos += src_offset;
 1851|      0|    }
 1852|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1853|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1854|      0|    frame_reader_release(frame, io_cb, fp);
 1855|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 0]
  ------------------
 1856|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1858|      0|    }
 1859|      0|    src = tmp3;
 1860|      0|    src_offset = 0;
 1861|      0|    srcsize = block_csize;
 1862|      0|  }
 1863|       |
 1864|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1865|   152k|  if (memcpyed) {
  ------------------
  |  Branch (1865:7): [True: 133k, False: 19.9k]
  ------------------
 1866|   133k|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1866:18): [True: 48, False: 132k]
  ------------------
 1867|   133k|    if (!context->special_type) {
  ------------------
  |  Branch (1867:9): [True: 571, False: 132k]
  ------------------
 1868|    571|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1868:11): [True: 0, False: 571]
  ------------------
 1869|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1870|      0|      }
 1871|    571|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1871:11): [True: 0, False: 571]
  ------------------
 1872|       |        /* Not enough input to copy block */
 1873|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1874|      0|      }
 1875|    571|    }
 1876|   133k|    if (!is_lazy) {
  ------------------
  |  Branch (1876:9): [True: 133k, False: 0]
  ------------------
 1877|   133k|      src += context->header_overhead + nblock * context->blocksize;
 1878|   133k|    }
 1879|   133k|    _dest = dest + dest_offset;
 1880|   133k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1880:9): [True: 0, False: 133k]
  ------------------
 1881|       |      // We are making use of a postfilter, so use a temp for destination
 1882|      0|      _dest = tmp;
 1883|      0|    }
 1884|   133k|    rc = 0;
 1885|   133k|    switch (context->special_type) {
 1886|    201|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1886:7): [True: 201, False: 132k]
  ------------------
 1887|       |        // All repeated values
 1888|    201|        rc = set_values(typesize, context->src, _dest, bsize_);
 1889|    201|        if (rc < 0) {
  ------------------
  |  Branch (1889:13): [True: 1, False: 200]
  ------------------
 1890|      1|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1891|      1|          return BLOSC2_ERROR_DATA;
 1892|      1|        }
 1893|    200|        break;
 1894|    395|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1894:7): [True: 395, False: 132k]
  ------------------
 1895|    395|        rc = set_nans(context->typesize, _dest, bsize_);
 1896|    395|        if (rc < 0) {
  ------------------
  |  Branch (1896:13): [True: 7, False: 388]
  ------------------
 1897|      7|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1898|      7|          return BLOSC2_ERROR_DATA;
 1899|      7|        }
 1900|    388|        break;
 1901|    388|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1901:7): [True: 308, False: 132k]
  ------------------
 1902|    308|        memset(_dest, 0, bsize_);
 1903|    308|        break;
 1904|   131k|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1904:7): [True: 131k, False: 1.47k]
  ------------------
 1905|       |        // We do nothing here
 1906|   131k|        break;
 1907|    571|      default:
  ------------------
  |  Branch (1907:7): [True: 571, False: 132k]
  ------------------
 1908|    571|        memcpy(_dest, src, bsize_);
 1909|   133k|    }
 1910|   133k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1910:9): [True: 0, False: 133k]
  ------------------
 1911|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1912|      0|      blosc2_postfilter_params postparams;
 1913|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1914|      0|      postparams.input = tmp;
 1915|      0|      postparams.output = dest + dest_offset;
 1916|      0|      postparams.size = bsize;
 1917|      0|      postparams.typesize = typesize;
 1918|      0|      postparams.offset = nblock * context->blocksize;
 1919|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1919:27): [True: 0, False: 0]
  ------------------
 1920|      0|      postparams.nblock = nblock;
 1921|      0|      postparams.tid = thread_context->tid;
 1922|      0|      postparams.ttmp = thread_context->tmp;
 1923|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1924|      0|      postparams.ctx = context;
 1925|       |
 1926|       |      // Execute the postfilter (the processed block will be copied to dest)
 1927|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1927:11): [True: 0, False: 0]
  ------------------
 1928|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1929|      0|        return BLOSC2_ERROR_POSTFILTER;
 1930|      0|      }
 1931|      0|    }
 1932|   133k|    thread_context->zfp_cell_nitems = 0;
 1933|       |
 1934|   133k|    return bsize_;
 1935|   133k|  }
 1936|       |
 1937|  19.9k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1937:7): [True: 19.9k, False: 0]
  |  Branch (1937:20): [True: 139, False: 19.8k]
  |  Branch (1937:39): [True: 314, False: 19.5k]
  ------------------
 1938|       |    /* Invalid block src offset encountered */
 1939|    453|    return BLOSC2_ERROR_DATA;
 1940|    453|  }
 1941|       |
 1942|  19.5k|  src += src_offset;
 1943|  19.5k|  if (vlblocks) {
  ------------------
  |  Branch (1943:7): [True: 2, False: 19.5k]
  ------------------
 1944|      2|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1944:9): [True: 0, False: 2]
  |  Branch (1944:41): [True: 0, False: 2]
  ------------------
 1945|      2|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1945:9): [True: 1, False: 1]
  ------------------
 1946|      1|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1946:9): [True: 0, False: 1]
  ------------------
 1947|      1|      return BLOSC2_ERROR_DATA;
 1948|      1|    }
 1949|      1|    srcsize = context->blockcbytes[nblock];
 1950|      1|  }
 1951|  19.5k|  else {
 1952|  19.5k|    srcsize -= src_offset;
 1953|  19.5k|  }
 1954|       |
 1955|  19.5k|  int last_filter_index = last_filter(filters, 'd');
 1956|  19.5k|  if (instr_codec) {
  ------------------
  |  Branch (1956:7): [True: 2.50k, False: 17.0k]
  ------------------
 1957|       |    // If instrumented, we don't want to run the filters
 1958|  2.50k|    _dest = dest + dest_offset;
 1959|  2.50k|  }
 1960|  17.0k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1960:13): [True: 13.8k, False: 3.14k]
  ------------------
 1961|  13.8k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1961:8): [True: 10.0k, False: 3.82k]
  ------------------
 1962|  10.0k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1962:5): [True: 0, False: 6.97k]
  ------------------
 1963|       |    // We are making use of some filter, so use a temp for destination
 1964|  10.0k|    _dest = tmp;
 1965|  10.0k|  }
 1966|  6.97k|  else {
 1967|       |    // If no filters, or only DELTA in pipeline
 1968|  6.97k|    _dest = dest + dest_offset;
 1969|  6.97k|  }
 1970|       |
 1971|       |  /* The number of compressed data streams for this block */
 1972|  19.5k|  if (vlblocks) {
  ------------------
  |  Branch (1972:7): [True: 1, False: 19.5k]
  ------------------
 1973|      1|    nstreams = 1;
 1974|      1|  }
 1975|  19.5k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1975:12): [True: 3.91k, False: 15.6k]
  |  Branch (1975:27): [True: 3.88k, False: 26]
  ------------------
 1976|  3.88k|    nstreams = context->typesize;
 1977|  3.88k|  }
 1978|  15.6k|  else {
 1979|  15.6k|    nstreams = 1;
 1980|  15.6k|  }
 1981|       |
 1982|  19.5k|  neblock = bsize / nstreams;
 1983|  19.5k|  if (neblock == 0) {
  ------------------
  |  Branch (1983:7): [True: 4, False: 19.5k]
  ------------------
 1984|       |    /* Not enough space to output bytes */
 1985|      4|    BLOSC_ERROR(BLOSC2_ERROR_WRITE_BUFFER);
  ------------------
  |  |  111|      4|    do {                                            \
  |  |  112|      4|        int rc_ = (rc);                             \
  |  |  113|      4|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 4, False: 0]
  |  |  ------------------
  |  |  114|      4|            char *error_msg = print_error(rc_);     \
  |  |  115|      4|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      4|            return rc_;                             \
  |  |  117|      4|        }                                           \
  |  |  118|      4|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1986|      4|  }
 1987|  27.5k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (1987:19): [True: 20.0k, False: 7.50k]
  ------------------
 1988|  20.0k|    if (vlblocks) {
  ------------------
  |  Branch (1988:9): [True: 1, False: 20.0k]
  ------------------
 1989|      1|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1989:11): [True: 0, False: 1]
  ------------------
 1990|       |        /* Not enough input to read compressed bytes */
 1991|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1992|      0|      }
 1993|      1|      neblock = sw32_(src);
 1994|      1|      if (neblock != bsize) {
  ------------------
  |  Branch (1994:11): [True: 0, False: 1]
  ------------------
 1995|      0|        return BLOSC2_ERROR_DATA;
 1996|      0|      }
 1997|      1|      src += sizeof(int32_t);
 1998|      1|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 1999|      1|      srcsize = 0;
 2000|      1|    }
 2001|  20.0k|    else {
 2002|  20.0k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2002:11): [True: 10, False: 20.0k]
  ------------------
 2003|       |        /* Not enough input to read compressed size */
 2004|     10|        return BLOSC2_ERROR_READ_BUFFER;
 2005|     10|      }
 2006|  20.0k|      srcsize -= sizeof(int32_t);
 2007|  20.0k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2008|  20.0k|      if (cbytes > 0) {
  ------------------
  |  Branch (2008:11): [True: 17.7k, False: 2.29k]
  ------------------
 2009|  17.7k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2009:13): [True: 98, False: 17.6k]
  ------------------
 2010|       |          /* Not enough input to read compressed bytes */
 2011|     98|          return BLOSC2_ERROR_READ_BUFFER;
 2012|     98|        }
 2013|  17.6k|        srcsize -= cbytes;
 2014|  17.6k|      }
 2015|  19.9k|      src += sizeof(int32_t);
 2016|  19.9k|    }
 2017|       |    // ctbytes += (signed)sizeof(int32_t);
 2018|       |
 2019|       |    /* Uncompress */
 2020|  19.9k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2020:9): [True: 19.9k, False: 1]
  |  Branch (2020:22): [True: 1.71k, False: 18.1k]
  ------------------
 2021|       |      // A run of 0's
 2022|  1.71k|      memset(_dest, 0, (unsigned int)neblock);
 2023|  1.71k|      nbytes = neblock;
 2024|  1.71k|    }
 2025|  18.1k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2025:14): [True: 18.1k, False: 1]
  |  Branch (2025:27): [True: 584, False: 17.6k]
  ------------------
 2026|       |      // A negative number means some encoding depending on the token that comes next
 2027|    584|      uint8_t token;
 2028|       |
 2029|    584|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2029:11): [True: 15, False: 569]
  ------------------
 2030|       |        // Not enough input to read token */
 2031|     15|        return BLOSC2_ERROR_READ_BUFFER;
 2032|     15|      }
 2033|    569|      srcsize -= sizeof(uint8_t);
 2034|       |
 2035|    569|      token = src[0];
 2036|    569|      src += 1;
 2037|       |      // ctbytes += 1;
 2038|       |
 2039|    569|      if (token & 0x1) {
  ------------------
  |  Branch (2039:11): [True: 545, False: 24]
  ------------------
 2040|       |        // A run of bytes that are different than 0
 2041|    545|        if (cbytes < -255) {
  ------------------
  |  Branch (2041:13): [True: 65, False: 480]
  ------------------
 2042|       |          // Runs can only encode a byte
 2043|     65|          return BLOSC2_ERROR_RUN_LENGTH;
 2044|     65|        }
 2045|    480|        uint8_t value = -cbytes;
 2046|    480|        memset(_dest, value, (unsigned int)neblock);
 2047|    480|      } else {
 2048|     24|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   93|     24|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     24|    do {                                            \
  |  |  |  |   98|     24|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     24|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 24, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     24|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2049|     24|        return BLOSC2_ERROR_RUN_LENGTH;
 2050|     24|      }
 2051|    480|      nbytes = neblock;
 2052|    480|      cbytes = 0;  // everything is encoded in the cbytes token
 2053|    480|    }
 2054|  17.6k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2054:14): [True: 3.51k, False: 14.0k]
  ------------------
 2055|  3.51k|      memcpy(_dest, src, (unsigned int)neblock);
 2056|  3.51k|      nbytes = (int32_t)neblock;
 2057|  3.51k|    }
 2058|  14.0k|    else {
 2059|  14.0k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2059:11): [True: 562, False: 13.5k]
  ------------------
 2060|    562|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2061|    562|      }
 2062|  13.5k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2062:16): [True: 1.02k, False: 12.5k]
  ------------------
 2063|  1.02k|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2064|  1.02k|                                     (char*)_dest, (size_t)neblock,
 2065|  1.02k|                                     thread_context);
 2066|  1.02k|      }
 2067|  12.5k|  #if defined(HAVE_ZLIB)
 2068|  12.5k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2068:16): [True: 1.04k, False: 11.4k]
  ------------------
 2069|  1.04k|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2070|  1.04k|                                      (char*)_dest, (size_t)neblock);
 2071|  1.04k|      }
 2072|  11.4k|  #endif /*  HAVE_ZLIB */
 2073|  11.4k|  #if defined(HAVE_ZSTD)
 2074|  11.4k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2074:16): [True: 10.5k, False: 886]
  ------------------
 2075|  10.5k|        nbytes = zstd_wrap_decompress(thread_context,
 2076|  10.5k|                                      (char*)src, (size_t)cbytes,
 2077|  10.5k|                                      (char*)_dest, (size_t)neblock);
 2078|  10.5k|      }
 2079|    886|  #endif /*  HAVE_ZSTD */
 2080|    886|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2080:16): [True: 877, False: 9]
  ------------------
 2081|    877|        bool getcell = false;
 2082|       |
 2083|    877|#if defined(HAVE_ZFP)
 2084|    877|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2084:13): [True: 1, False: 876]
  ------------------
 2085|      1|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2085:13): [True: 0, False: 1]
  ------------------
 2086|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2087|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2087:15): [True: 0, False: 0]
  ------------------
 2088|      0|            return BLOSC2_ERROR_DATA;
 2089|      0|          }
 2090|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2090:15): [True: 0, False: 0]
  ------------------
 2091|      0|            getcell = true;
 2092|      0|          }
 2093|      0|        }
 2094|    877|#endif /* HAVE_ZFP */
 2095|    877|        if (!getcell) {
  ------------------
  |  Branch (2095:13): [True: 877, False: 0]
  ------------------
 2096|    877|          thread_context->zfp_cell_nitems = 0;
 2097|  1.03k|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2097:27): [True: 1.01k, False: 14]
  ------------------
 2098|  1.01k|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2098:17): [True: 863, False: 154]
  ------------------
 2099|    863|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2099:19): [True: 4, False: 859]
  ------------------
 2100|       |                // Dynamically load codec plugin
 2101|      4|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2101:21): [True: 4, False: 0]
  ------------------
 2102|      4|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2103|      4|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2104|      4|                }
 2105|      4|              }
 2106|    859|              blosc2_dparams dparams;
 2107|    859|              blosc2_ctx_get_dparams(context, &dparams);
 2108|    859|              nbytes = g_codecs[i].decoder(src,
 2109|    859|                                           cbytes,
 2110|    859|                                           _dest,
 2111|    859|                                           neblock,
 2112|    859|                                           context->compcode_meta,
 2113|    859|                                           &dparams,
 2114|    859|                                           context->src);
 2115|    859|              goto urcodecsuccess;
 2116|    863|            }
 2117|  1.01k|          }
 2118|     14|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2119|     14|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2120|    877|        }
 2121|    859|      urcodecsuccess:
 2122|    859|        ;
 2123|    859|      }
 2124|      9|      else {
 2125|      9|        compname = clibcode_to_clibname(compformat);
 2126|      9|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   93|      9|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      9|    do {                                            \
  |  |  |  |   98|      9|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      9|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      9|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2127|      9|                "Blosc has not been compiled with decompression "
 2128|      9|                "support for '%s' format.  "
 2129|      9|                "Please recompile for adding this support.", compname);
 2130|      9|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2131|      9|      }
 2132|       |
 2133|       |      /* Check that decompressed bytes number is correct */
 2134|  14.0k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2134:11): [True: 11.7k, False: 2.27k]
  |  Branch (2134:34): [True: 11.7k, False: 0]
  ------------------
 2135|  11.7k|        return BLOSC2_ERROR_DATA;
 2136|  11.7k|      }
 2137|       |
 2138|  14.0k|    }
 2139|  7.99k|    src += cbytes;
 2140|       |    // ctbytes += cbytes;
 2141|  7.99k|    _dest += nbytes;
 2142|  7.99k|    ntbytes += nbytes;
 2143|  7.99k|  } /* Closes j < nstreams */
 2144|       |
 2145|  7.50k|  if (!instr_codec) {
  ------------------
  |  Branch (2145:7): [True: 6.55k, False: 956]
  ------------------
 2146|  6.55k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2146:9): [True: 6.14k, False: 410]
  |  Branch (2146:35): [True: 0, False: 410]
  ------------------
 2147|       |      /* Apply regular filter pipeline */
 2148|  6.14k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2149|  6.14k|                                      last_filter_index, nblock);
 2150|  6.14k|      if (errcode < 0)
  ------------------
  |  Branch (2150:11): [True: 252, False: 5.88k]
  ------------------
 2151|    252|        return errcode;
 2152|  6.14k|    }
 2153|  6.55k|  }
 2154|       |
 2155|       |  /* Return the number of uncompressed bytes */
 2156|  7.25k|  return (int)ntbytes;
 2157|  7.50k|}
blosc2.c:lz4_wrap_decompress:
  501|  1.02k|                               struct thread_context* thread_context) {
  502|  1.02k|  int nbytes;
  503|  1.02k|  blosc2_context* context = thread_context->parent_context;
  504|  1.02k|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (504:7): [True: 393, False: 628]
  |  Branch (504:28): [True: 393, False: 0]
  |  Branch (504:60): [True: 393, False: 0]
  ------------------
  505|    393|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  506|    393|                                           (int)compressed_length, (int)maxout,
  507|    393|                                           (const char*)context->dict_buffer,
  508|    393|                                           (int)context->dict_size);
  509|    628|  } else {
  510|    628|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  511|    628|  }
  512|  1.02k|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (512:7): [True: 822, False: 199]
  ------------------
  513|    822|    return 0;
  514|    822|  }
  515|    199|  return (int)maxout;
  516|  1.02k|}
blosc2.c:zlib_wrap_decompress:
  540|  1.04k|                                char* output, size_t maxout) {
  541|  1.04k|  int status;
  542|  1.04k|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  543|  1.04k|  size_t ul = maxout;
  544|  1.04k|  status = zng_uncompress(
  545|  1.04k|      (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|  1.04k|  if (status != Z_OK) {
  ------------------
  |  |  180|  1.04k|#define Z_OK            0
  ------------------
  |  Branch (551:7): [True: 1.04k, False: 1]
  ------------------
  552|  1.04k|    return 0;
  553|  1.04k|  }
  554|      1|  return (int)ul;
  555|  1.04k|}
blosc2.c:zstd_wrap_decompress:
  592|  10.5k|                                char* output, size_t maxout) {
  593|  10.5k|  size_t code;
  594|  10.5k|  blosc2_context* context = thread_context->parent_context;
  595|       |
  596|  10.5k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (596:7): [True: 9.35k, False: 1.21k]
  ------------------
  597|  9.35k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  598|  9.35k|  }
  599|       |
  600|  10.5k|  if (context->use_dict) {
  ------------------
  |  Branch (600:7): [True: 3.01k, False: 7.55k]
  ------------------
  601|  3.01k|    assert(context->dict_ddict != NULL);
  602|  3.01k|    code = ZSTD_decompress_usingDDict(
  603|  3.01k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  604|  3.01k|            compressed_length, context->dict_ddict);
  605|  7.55k|  } else {
  606|  7.55k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  607|  7.55k|        (void*)output, maxout, (void*)input, compressed_length);
  608|  7.55k|  }
  609|  10.5k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (609:7): [True: 9.14k, False: 1.42k]
  ------------------
  610|  9.14k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  9.14k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  9.14k|    do {                                            \
  |  |  |  |   98|  9.14k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  9.14k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 9.14k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  9.14k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  611|  9.14k|                      ZDICT_getErrorName(code));
  612|  9.14k|    return 0;
  613|  9.14k|  }
  614|  1.42k|  return (int)code;
  615|  10.5k|}
blosc2.c:blosc2_initialize_context_from_header:
  862|  14.5k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  863|  14.5k|  context->header_flags = header->flags;
  864|  14.5k|  context->typesize = header->typesize;
  865|  14.5k|  context->sourcesize = header->nbytes;
  866|  14.5k|  context->header_blocksize = header->blocksize;
  867|  14.5k|  context->blocksize = header->blocksize;
  868|  14.5k|  context->blosc2_flags2 = header->blosc2_flags2;
  869|  14.5k|  context->blosc2_flags = header->blosc2_flags;
  870|  14.5k|  context->compcode = header->flags >> 5;
  871|  14.5k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (871:7): [True: 834, False: 13.6k]
  ------------------
  872|    834|    context->compcode = header->udcompcode;
  873|    834|  }
  874|  14.5k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (874:7): [True: 331, False: 14.1k]
  ------------------
  875|    331|    context->nblocks = header->blocksize;
  876|    331|    context->leftover = 0;
  877|    331|    context->blocksize = 0;
  878|    331|  }
  879|  14.1k|  else {
  880|  14.1k|    blosc2_calculate_blocks(context);
  881|  14.1k|  }
  882|       |
  883|  14.5k|  bool is_lazy = false;
  884|  14.5k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (884:7): [True: 7.81k, False: 6.69k]
  ------------------
  885|  7.81k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (885:7): [True: 6.31k, False: 1.49k]
  ------------------
  886|       |    /* Extended header */
  887|  6.31k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  888|       |
  889|  6.31k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  890|  6.31k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  891|  6.31k|    context->compcode_meta = header->compcode_meta;
  892|       |
  893|  6.31k|    context->filter_flags = filters_to_flags(header->filters);
  894|  6.31k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  895|       |
  896|  6.31k|    is_lazy = (context->blosc2_flags & 0x08u);
  897|  6.31k|  }
  898|  8.19k|  else {
  899|  8.19k|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  900|  8.19k|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  901|  8.19k|    flags_to_filters(context->header_flags, context->filters);
  902|  8.19k|  }
  903|       |
  904|       |  // Some checks for malformed headers
  905|  14.5k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (905:7): [True: 14.3k, False: 181]
  |  Branch (905:19): [True: 0, False: 14.3k]
  ------------------
  906|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  907|      0|  }
  908|       |
  909|  14.5k|  return 0;
  910|  14.5k|}
blosc2.c:get_filter_flags:
  702|  8.19k|                                const int32_t typesize) {
  703|  8.19k|  uint8_t flags = 0;
  704|       |
  705|  8.19k|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (705:7): [True: 1.49k, False: 6.69k]
  |  Branch (705:43): [True: 1.15k, False: 343]
  ------------------
  706|  1.15k|    flags |= BLOSC_DOSHUFFLE;
  707|  1.15k|  }
  708|  8.19k|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (708:7): [True: 2.01k, False: 6.18k]
  ------------------
  709|  2.01k|    flags |= BLOSC_DOBITSHUFFLE;
  710|  2.01k|  }
  711|  8.19k|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (711:7): [True: 3.05k, False: 5.14k]
  ------------------
  712|  3.05k|    flags |= BLOSC_DODELTA;
  713|  3.05k|  }
  714|  8.19k|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (714:7): [True: 44, False: 8.15k]
  ------------------
  715|     44|    flags |= BLOSC_MEMCPYED;
  716|     44|  }
  717|  8.19k|  return flags;
  718|  8.19k|}
blosc2.c:clear_context_decompression_dict:
 2550|  14.5k|static void clear_context_decompression_dict(blosc2_context* context) {
 2551|  14.5k|  context->use_dict = 0;
 2552|  14.5k|  release_context_dict_buffer(context);
 2553|  14.5k|#if defined(HAVE_ZSTD)
 2554|  14.5k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2554:7): [True: 0, False: 14.5k]
  ------------------
 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|  14.5k|}
blosc2.c:checked_mul_size:
  152|  14.3k|static inline bool checked_mul_size(size_t a, size_t b, size_t* out) {
  153|  14.3k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (153:7): [True: 14.3k, False: 0]
  |  Branch (153:17): [True: 0, False: 14.3k]
  ------------------
  154|      0|    return false;
  155|      0|  }
  156|  14.3k|  *out = a * b;
  157|       |  return true;
  158|  14.3k|}
blosc2.c:checked_add_size:
  160|  14.4k|static inline bool checked_add_size(size_t a, size_t b, size_t* out) {
  161|  14.4k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (161:7): [True: 0, False: 14.4k]
  ------------------
  162|      0|    return false;
  163|      0|  }
  164|  14.4k|  *out = a + b;
  165|       |  return true;
  166|  14.4k|}
blosc2.c:create_thread_context:
 2264|  13.5k|create_thread_context(blosc2_context* context, int32_t tid) {
 2265|  13.5k|  struct thread_context* thread_context;
 2266|  13.5k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2267|  13.5k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  13.5k|    do {                                            \
  |  |  105|  13.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 13.5k]
  |  |  ------------------
  |  |  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|  13.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 13.5k]
  |  |  ------------------
  ------------------
 2268|  13.5k|  int rc = init_thread_context(thread_context, context, tid);
 2269|  13.5k|  if (rc < 0) {
  ------------------
  |  Branch (2269:7): [True: 0, False: 13.5k]
  ------------------
 2270|      0|    return NULL;
 2271|      0|  }
 2272|  13.5k|  return thread_context;
 2273|  13.5k|}
blosc2.c:init_thread_context:
 2234|  13.5k|{
 2235|  13.5k|  int32_t ebsize;
 2236|       |
 2237|  13.5k|  thread_context->parent_context = context;
 2238|  13.5k|  thread_context->owner_pool = NULL;
 2239|  13.5k|  thread_context->tid = tid;
 2240|       |
 2241|  13.5k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2241:23): [True: 13.5k, False: 0]
  ------------------
 2242|  13.5k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2242:22): [True: 13.5k, False: 0]
  ------------------
 2243|  13.5k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2244|  13.5k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2245|  13.5k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2246|  13.5k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  13.5k|    do {                                            \
  |  |  105|  13.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 13.5k]
  |  |  ------------------
  |  |  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|  13.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 13.5k]
  |  |  ------------------
  ------------------
 2247|  13.5k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2248|  13.5k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2249|  13.5k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2250|  13.5k|  thread_context->tmp_blocksize = blocksize;
 2251|  13.5k|  thread_context->zfp_cell_nitems = 0;
 2252|  13.5k|  thread_context->zfp_cell_start = 0;
 2253|  13.5k|  #if defined(HAVE_ZSTD)
 2254|  13.5k|  thread_context->zstd_cctx = NULL;
 2255|  13.5k|  thread_context->zstd_dctx = NULL;
 2256|  13.5k|  #endif
 2257|  13.5k|  thread_context->lz4_cstream = NULL;
 2258|  13.5k|  thread_context->lz4hc_cstream = NULL;
 2259|       |
 2260|  13.5k|  return 0;
 2261|  13.5k|}
blosc2.c:release_thread_backend:
 5416|  14.9k|static int release_thread_backend(blosc2_context *context) {
 5417|  14.9k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|  29.8k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5417:7): [True: 0, False: 14.9k]
  |  Branch (5417:60): [True: 0, False: 0]
  ------------------
 5418|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5418:25): [True: 0, False: 0]
  ------------------
 5419|      0|      destroy_thread_context(context->thread_contexts + t);
 5420|      0|    }
 5421|      0|    my_free(context->thread_contexts);
 5422|      0|    context->thread_contexts = NULL;
 5423|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5424|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5425|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5426|      0|  }
 5427|       |#if defined(_WIN32)
 5428|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5429|       |    /* Signal all workers to exit. */
 5430|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5431|       |    context->end_threads = 1;
 5432|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5433|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5434|       |
 5435|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5436|       |      blosc2_pthread_join(context->threads[t], NULL);
 5437|       |    }
 5438|       |    my_free(context->threads);
 5439|       |    context->threads = NULL;
 5440|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5441|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5442|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5443|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5444|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5445|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5446|       |  }
 5447|       |#endif  /* _WIN32 */
 5448|  14.9k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|  29.8k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5448:12): [True: 0, False: 14.9k]
  |  Branch (5448:68): [True: 0, False: 0]
  ------------------
 5449|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5450|      0|    struct blosc_shared_pool **prev;
 5451|      0|    bool destroy_pool = false;
 5452|       |
 5453|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5453:9): [True: 0, False: 0]
  ------------------
 5454|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5455|       |       * Just clear the dangling pointer; nothing else to do. */
 5456|      0|      context->thread_pool = NULL;
 5457|      0|      context->threads_started = 0;
 5458|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5459|      0|      return 0;
 5460|      0|    }
 5461|       |
 5462|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5463|      0|    pool->context_refs--;
 5464|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5464:9): [True: 0, False: 0]
  ------------------
 5465|       |      /* Check pool-internal state under the pool's own mutex */
 5466|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5467|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5467:20): [True: 0, False: 0]
  |  Branch (5467:46): [True: 0, False: 0]
  ------------------
 5468|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5469|      0|      if (idle) {
  ------------------
  |  Branch (5469:11): [True: 0, False: 0]
  ------------------
 5470|      0|        prev = &shared_pools;
 5471|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5471:16): [True: 0, False: 0]
  |  Branch (5471:33): [True: 0, False: 0]
  ------------------
 5472|      0|          prev = &(*prev)->next;
 5473|      0|        }
 5474|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5474:13): [True: 0, False: 0]
  ------------------
 5475|      0|          *prev = pool->next;
 5476|      0|        }
 5477|      0|        destroy_pool = true;
 5478|      0|      }
 5479|      0|    }
 5480|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5481|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5481:9): [True: 0, False: 0]
  ------------------
 5482|      0|      destroy_shared_pool(pool);
 5483|      0|    }
 5484|      0|    context->thread_pool = NULL;
 5485|      0|  }
 5486|       |
 5487|  14.9k|  context->threads_started = 0;
 5488|  14.9k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  14.9k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5489|  14.9k|  return 0;
 5490|  14.9k|}
blosc2.c:release_context_dict_buffer:
 2540|  29.4k|static void release_context_dict_buffer(blosc2_context* context) {
 2541|  29.4k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2541:7): [True: 0, False: 29.4k]
  |  Branch (2541:37): [True: 0, False: 0]
  ------------------
 2542|      0|    free(context->dict_buffer);
 2543|      0|  }
 2544|  29.4k|  context->dict_buffer = NULL;
 2545|       |  context->dict_buffer_owned = false;
 2546|  29.4k|  context->dict_size = 0;
 2547|  29.4k|}

blosclz_decompress:
  685|    562|int blosclz_decompress(const void* input, int length, void* output, int maxout) {
  686|    562|  const uint8_t* ip = (const uint8_t*)input;
  687|    562|  const uint8_t* ip_limit = ip + length;
  688|    562|  uint8_t* op = (uint8_t*)output;
  689|    562|  uint32_t ctrl;
  690|    562|  uint8_t* op_limit = op + maxout;
  691|    562|  if (BLOSCLZ_UNLIKELY(length == 0)) {
  ------------------
  |  |   35|    562|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 0, False: 562]
  |  |  ------------------
  ------------------
  692|      0|    return 0;
  693|      0|  }
  694|    562|  ctrl = (*ip++) & 31U;
  695|       |
  696|  1.05M|  while (1) {
  ------------------
  |  Branch (696:10): [True: 1.05M, Folded]
  ------------------
  697|  1.05M|    if (ctrl >= 32) {
  ------------------
  |  Branch (697:9): [True: 176k, False: 878k]
  ------------------
  698|       |      // match
  699|   176k|      int32_t len = (int32_t)(ctrl >> 5U) - 1 ;
  700|   176k|      int32_t ofs = (int32_t)(ctrl & 31U) << 8U;
  701|   176k|      uint8_t code;
  702|   176k|      const uint8_t* ref = op - ofs;
  703|       |
  704|   176k|      if (len == 7 - 1) {
  ------------------
  |  Branch (704:11): [True: 48.9k, False: 127k]
  ------------------
  705|  59.0k|        do {
  706|  59.0k|          if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|  59.0k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 15, False: 58.9k]
  |  |  ------------------
  ------------------
  707|     15|            return 0;
  708|     15|          }
  709|  58.9k|          code = *ip++;
  710|  58.9k|          len += code;
  711|  58.9k|        } while (code == 255);
  ------------------
  |  Branch (711:18): [True: 10.0k, False: 48.9k]
  ------------------
  712|  48.9k|      }
  713|   127k|      else {
  714|   127k|        if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|   127k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 29, False: 127k]
  |  |  ------------------
  ------------------
  715|     29|          return 0;
  716|     29|        }
  717|   127k|      }
  718|   176k|      code = *ip++;
  719|   176k|      len += 3;
  720|   176k|      ref -= code;
  721|       |
  722|       |      /* match from 16-bit distance */
  723|   176k|      if (BLOSCLZ_UNLIKELY(code == 255)) {
  ------------------
  |  |   35|   176k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 12.7k, False: 163k]
  |  |  ------------------
  ------------------
  724|  12.7k|        if (ofs == (31U << 8U)) {
  ------------------
  |  Branch (724:13): [True: 979, False: 11.7k]
  ------------------
  725|    979|          if (ip + 1 >= ip_limit) {
  ------------------
  |  Branch (725:15): [True: 2, False: 977]
  ------------------
  726|      2|            return 0;
  727|      2|          }
  728|    977|          ofs = (*ip++) << 8U;
  729|    977|          ofs += *ip++;
  730|    977|          ref = op - ofs - MAX_DISTANCE;
  ------------------
  |  |   46|    977|#define MAX_DISTANCE 8191
  ------------------
  731|    977|        }
  732|  12.7k|      }
  733|       |
  734|   176k|      if (BLOSCLZ_UNLIKELY(op + len > op_limit)) {
  ------------------
  |  |   35|   176k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 85, False: 176k]
  |  |  ------------------
  ------------------
  735|     85|        return 0;
  736|     85|      }
  737|       |
  738|   176k|      if (BLOSCLZ_UNLIKELY(ref - 1 < (uint8_t*)output)) {
  ------------------
  |  |   35|   176k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 38, False: 176k]
  |  |  ------------------
  ------------------
  739|     38|        return 0;
  740|     38|      }
  741|       |
  742|   176k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|   176k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 1, False: 176k]
  |  |  ------------------
  ------------------
  743|   176k|      ctrl = *ip++;
  744|       |
  745|   176k|      ref--;
  746|   176k|      if (ref == op - 1) {
  ------------------
  |  Branch (746:11): [True: 24.9k, False: 151k]
  ------------------
  747|       |        /* optimized copy for a run */
  748|  24.9k|        memset(op, *ref, len);
  749|  24.9k|        op += len;
  750|  24.9k|      }
  751|   151k|      else if ((op - ref >= 8) && (op_limit - op >= len + 8)) {
  ------------------
  |  Branch (751:16): [True: 102k, False: 48.9k]
  |  Branch (751:35): [True: 102k, False: 281]
  ------------------
  752|       |        // copy with an overlap not larger than 8
  753|   102k|        wild_copy(op, ref, op + len);
  754|   102k|        op += len;
  755|   102k|      }
  756|  49.2k|      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|  49.2k|          op = copy_match(op, ref, (unsigned) len);
  767|       |#if 0 && defined(__AVX2__)
  768|       |        }
  769|       |#endif
  770|  49.2k|      }
  771|   176k|    }
  772|   878k|    else {
  773|       |      // literal
  774|   878k|      ctrl++;
  775|   878k|      if (BLOSCLZ_UNLIKELY(op + ctrl > op_limit)) {
  ------------------
  |  |   35|   878k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 50, False: 878k]
  |  |  ------------------
  ------------------
  776|     50|        return 0;
  777|     50|      }
  778|   878k|      if (BLOSCLZ_UNLIKELY(ip + ctrl > ip_limit)) {
  ------------------
  |  |   35|   878k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 11, False: 878k]
  |  |  ------------------
  ------------------
  779|     11|        return 0;
  780|     11|      }
  781|       |
  782|   878k|      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|   878k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|   878k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 331, False: 878k]
  |  |  ------------------
  ------------------
  790|   878k|      ctrl = *ip++;
  791|   878k|    }
  792|  1.05M|  }
  793|       |
  794|    332|  return (int)(op - (uint8_t*)output);
  795|    562|}
blosclz.c:wild_copy:
  677|   102k|static inline void wild_copy(uint8_t *out, const uint8_t* from, uint8_t* end) {
  678|   102k|  uint8_t* d = out;
  679|   102k|  const uint8_t* s = from;
  680|   102k|  uint8_t* const e = end;
  681|       |
  682|   614k|  do { memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  Branch (682:44): [True: 511k, False: 102k]
  ------------------
  683|   102k|}

delta_decoder:
   97|  12.3k|                   int32_t typesize, uint8_t* dest) {
   98|  12.3k|  int32_t i;
   99|       |
  100|  12.3k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 2.51k, False: 9.79k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|  2.51k|    switch (typesize) {
  103|    676|      case 1:
  ------------------
  |  Branch (103:7): [True: 676, False: 1.83k]
  ------------------
  104|  8.21M|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 8.21M, False: 676]
  ------------------
  105|  8.21M|          dest[i] ^= dref[i-1];
  106|  8.21M|        }
  107|    676|        break;
  108|    293|      case 2:
  ------------------
  |  Branch (108:7): [True: 293, False: 2.22k]
  ------------------
  109|  2.98M|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 2.98M, False: 293]
  ------------------
  110|  2.98M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|  2.98M|        }
  112|    293|        break;
  113|    259|      case 4:
  ------------------
  |  Branch (113:7): [True: 259, False: 2.25k]
  ------------------
  114|  1.33M|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 1.33M, False: 259]
  ------------------
  115|  1.33M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|  1.33M|        }
  117|    259|        break;
  118|    549|      case 8:
  ------------------
  |  Branch (118:7): [True: 549, False: 1.96k]
  ------------------
  119|   820k|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 820k, False: 549]
  ------------------
  120|   820k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   820k|        }
  122|    549|        break;
  123|    737|      default:
  ------------------
  |  Branch (123:7): [True: 737, False: 1.77k]
  ------------------
  124|    737|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 311, False: 426]
  ------------------
  125|    311|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|    426|        } else {
  127|    426|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|    426|        }
  129|  2.51k|    }
  130|  9.79k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  9.79k|    switch (typesize) {
  133|  2.54k|      case 1:
  ------------------
  |  Branch (133:7): [True: 2.54k, False: 7.25k]
  ------------------
  134|   910k|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 907k, False: 2.54k]
  ------------------
  135|   907k|          dest[i] ^= dref[i];
  136|   907k|        }
  137|  2.54k|        break;
  138|  1.12k|      case 2:
  ------------------
  |  Branch (138:7): [True: 1.12k, False: 8.67k]
  ------------------
  139|  1.32M|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 1.31M, False: 1.12k]
  ------------------
  140|  1.31M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  1.31M|        }
  142|  1.12k|        break;
  143|    841|      case 4:
  ------------------
  |  Branch (143:7): [True: 841, False: 8.95k]
  ------------------
  144|   617k|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 616k, False: 841]
  ------------------
  145|   616k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   616k|        }
  147|    841|        break;
  148|  2.23k|      case 8:
  ------------------
  |  Branch (148:7): [True: 2.23k, False: 7.56k]
  ------------------
  149|   177k|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 174k, False: 2.23k]
  ------------------
  150|   174k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   174k|        }
  152|  2.23k|        break;
  153|  3.05k|      default:
  ------------------
  |  Branch (153:7): [True: 3.05k, False: 6.74k]
  ------------------
  154|  3.05k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 1.02k, False: 2.02k]
  ------------------
  155|  1.02k|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  2.02k|        } else {
  157|  2.02k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  2.02k|        }
  159|  9.79k|    }
  160|  9.79k|  }
  161|  12.3k|}

fastcopy:
  504|    107|unsigned char *fastcopy(unsigned char *out, const unsigned char *from, unsigned len) {
  505|    107|  switch (len) {
  506|     10|    case 32:
  ------------------
  |  Branch (506:5): [True: 10, False: 97]
  ------------------
  507|     10|      return copy_32_bytes(out, from);
  508|      3|    case 16:
  ------------------
  |  Branch (508:5): [True: 3, False: 104]
  ------------------
  509|      3|      return copy_16_bytes(out, from);
  510|      6|    case 8:
  ------------------
  |  Branch (510:5): [True: 6, False: 101]
  ------------------
  511|      6|      return copy_8_bytes(out, from);
  512|     88|    default: {
  ------------------
  |  Branch (512:5): [True: 88, False: 19]
  ------------------
  513|     88|    }
  514|    107|  }
  515|     88|  if (len < 8) {
  ------------------
  |  Branch (515:7): [True: 67, False: 21]
  ------------------
  516|     67|    return copy_bytes(out, from, len);
  517|     67|  }
  518|     21|#if defined(__SSE2__)
  519|     21|  if (len < 16) {
  ------------------
  |  Branch (519:7): [True: 1, False: 20]
  ------------------
  520|      1|    return chunk_memcpy(out, from, len);
  521|      1|  }
  522|     20|#if !defined(__AVX2__)
  523|     20|  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|     21|}
copy_match:
  537|  49.2k|unsigned char* copy_match(unsigned char *out, const unsigned char *from, unsigned len) {
  538|       |#if defined(__AVX2__)
  539|       |  unsigned sz = sizeof(__m256i);
  540|       |#elif defined(__SSE2__)
  541|       |  unsigned sz = sizeof(__m128i);
  542|       |#else
  543|       |  unsigned sz = sizeof(uint64_t);
  544|       |#endif
  545|       |
  546|       |#if ((defined(__GNUC__) && BLOSC_GCC_VERSION < 800) && !defined(__clang__) && !defined(__ICC) && !defined(__ICL))
  547|       |  // GCC < 8 in fully optimization mode seems to have problems with the code further below so stop here
  548|       |  for (; len > 0; len--) {
  549|       |    *out++ = *from++;
  550|       |  }
  551|       |  return out;
  552|       |#endif
  553|       |
  554|       |  // If out and from are away more than the size of the copy, then a fastcopy is safe
  555|  49.2k|  unsigned overlap_dist = (unsigned) (out - from);
  556|  49.2k|  if (overlap_dist > sz) {
  ------------------
  |  Branch (556:7): [True: 107, False: 49.1k]
  ------------------
  557|    107|    return fastcopy(out, from, len);
  558|    107|  }
  559|       |
  560|       |  // Otherwise we need to be more careful so as not to overwrite destination
  561|  49.1k|  switch (overlap_dist) {
  562|      0|    case 32:
  ------------------
  |  Branch (562:5): [True: 0, False: 49.1k]
  ------------------
  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: 49.1k]
  ------------------
  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: 49.1k]
  ------------------
  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: 49.1k]
  ------------------
  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: 49.1k]
  ------------------
  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: 49.1k]
  ------------------
  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: 49.1k]
  ------------------
  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: 49.1k]
  ------------------
  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|     62|    case 16:
  ------------------
  |  Branch (614:5): [True: 62, False: 49.0k]
  ------------------
  615|    418|      for (; len >= 16; len -= 16) {
  ------------------
  |  Branch (615:14): [True: 356, False: 62]
  ------------------
  616|    356|        out = copy_16_bytes(out, from);
  617|    356|      }
  618|     62|      break;
  619|     96|    case 8:
  ------------------
  |  Branch (619:5): [True: 96, False: 49.0k]
  ------------------
  620|  1.35k|      for (; len >= 8; len -= 8) {
  ------------------
  |  Branch (620:14): [True: 1.25k, False: 96]
  ------------------
  621|  1.25k|        out = copy_8_bytes(out, from);
  622|  1.25k|      }
  623|     96|      break;
  624|  10.7k|    case 4:
  ------------------
  |  Branch (624:5): [True: 10.7k, False: 38.3k]
  ------------------
  625|   200k|      for (; len >= 4; len -= 4) {
  ------------------
  |  Branch (625:14): [True: 190k, False: 10.7k]
  ------------------
  626|   190k|        out = copy_4_bytes(out, from);
  627|   190k|      }
  628|  10.7k|      break;
  629|  16.8k|    case 2:
  ------------------
  |  Branch (629:5): [True: 16.8k, False: 32.3k]
  ------------------
  630|   249k|      for (; len >= 2; len -= 2) {
  ------------------
  |  Branch (630:14): [True: 233k, False: 16.8k]
  ------------------
  631|   233k|        out = copy_2_bytes(out, from);
  632|   233k|      }
  633|  16.8k|      break;
  634|  21.3k|    default:
  ------------------
  |  Branch (634:5): [True: 21.3k, False: 27.7k]
  ------------------
  635|   274k|      for (; len > 0; len--) {
  ------------------
  |  Branch (635:14): [True: 252k, False: 21.3k]
  ------------------
  636|   252k|        *out++ = *from++;
  637|   252k|      }
  638|  49.1k|  }
  639|       |
  640|       |  // Copy the leftovers
  641|  82.2k|  for (; len > 0; len--) {
  ------------------
  |  Branch (641:10): [True: 33.1k, False: 49.1k]
  ------------------
  642|  33.1k|    *out++ = *from++;
  643|  33.1k|  }
  644|       |
  645|  49.1k|  return out;
  646|  49.1k|}
fastcopy.c:copy_32_bytes:
  118|     10|static inline unsigned char *copy_32_bytes(unsigned char *out, const unsigned char *from) {
  119|       |#if defined(__AVX2__)
  120|       |  __m256i chunk;
  121|       |  chunk = _mm256_loadu_si256((__m256i*)from);
  122|       |  _mm256_storeu_si256((__m256i*)out, chunk);
  123|       |  out += 32;
  124|       |#elif defined(__SSE2__)
  125|       |  __m128i chunk;
  126|     10|  chunk = _mm_loadu_si128((__m128i*)from);
  127|     10|  _mm_storeu_si128((__m128i*)out, chunk);
  128|     10|  from += 16; out += 16;
  129|     10|  chunk = _mm_loadu_si128((__m128i*)from);
  130|     10|  _mm_storeu_si128((__m128i*)out, chunk);
  131|     10|  out += 16;
  132|       |#elif !defined(BLOSC_STRICT_ALIGN)
  133|       |  *(uint64_t*)out = *(uint64_t*)from;
  134|       |  from += 8; out += 8;
  135|       |  *(uint64_t*)out = *(uint64_t*)from;
  136|       |  from += 8; out += 8;
  137|       |  *(uint64_t*)out = *(uint64_t*)from;
  138|       |  from += 8; out += 8;
  139|       |  *(uint64_t*)out = *(uint64_t*)from;
  140|       |  from += 8; out += 8;
  141|       |#else
  142|       |  int i;
  143|       |  for (i = 0; i < 32; i++) {
  144|       |    *out++ = *from++;
  145|       |  }
  146|       |#endif
  147|     10|  return out;
  148|     10|}
fastcopy.c:copy_16_bytes:
   98|  1.23k|static inline unsigned char *copy_16_bytes(unsigned char *out, const unsigned char *from) {
   99|  1.23k|#if defined(__SSE2__)
  100|  1.23k|  __m128i chunk;
  101|  1.23k|  chunk = _mm_loadu_si128((__m128i*)from);
  102|  1.23k|  _mm_storeu_si128((__m128i*)out, chunk);
  103|  1.23k|  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.23k|  return out;
  116|  1.23k|}
fastcopy.c:copy_8_bytes:
   86|  1.26k|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.26k|  *(uint64_t *) out = *(uint64_t *) from;
   93|  1.26k|#endif
   94|  1.26k|  return out + 8;
   95|  1.26k|}
fastcopy.c:copy_bytes:
  161|     67|static inline unsigned char *copy_bytes(unsigned char *out, const unsigned char *from, unsigned len) {
  162|     67|  assert(len < 8);
  163|       |
  164|       |#ifdef BLOSC_STRICT_ALIGN
  165|       |  while (len--) {
  166|       |    *out++ = *from++;
  167|       |  }
  168|       |#else
  169|     67|  switch (len) {
  170|      6|    case 7:
  ------------------
  |  Branch (170:5): [True: 6, False: 61]
  ------------------
  171|      6|      return copy_7_bytes(out, from);
  172|     13|    case 6:
  ------------------
  |  Branch (172:5): [True: 13, False: 54]
  ------------------
  173|     13|      return copy_6_bytes(out, from);
  174|     13|    case 5:
  ------------------
  |  Branch (174:5): [True: 13, False: 54]
  ------------------
  175|     13|      return copy_5_bytes(out, from);
  176|      6|    case 4:
  ------------------
  |  Branch (176:5): [True: 6, False: 61]
  ------------------
  177|      6|      return copy_4_bytes(out, from);
  178|     29|    case 3:
  ------------------
  |  Branch (178:5): [True: 29, False: 38]
  ------------------
  179|     29|      return copy_3_bytes(out, from);
  180|      0|    case 2:
  ------------------
  |  Branch (180:5): [True: 0, False: 67]
  ------------------
  181|      0|      return copy_2_bytes(out, from);
  182|      0|    case 1:
  ------------------
  |  Branch (182:5): [True: 0, False: 67]
  ------------------
  183|      0|      return copy_1_bytes(out, from);
  184|      0|    case 0:
  ------------------
  |  Branch (184:5): [True: 0, False: 67]
  ------------------
  185|      0|      return out;
  186|      0|    default:
  ------------------
  |  Branch (186:5): [True: 0, False: 67]
  ------------------
  187|      0|      assert(0);
  188|     67|  }
  189|      0|#endif /* BLOSC_STRICT_ALIGN */
  190|      0|  return out;
  191|     67|}
fastcopy.c:copy_7_bytes:
   80|      6|static inline unsigned char *copy_7_bytes(unsigned char *out, const unsigned char *from) {
   81|      6|  out = copy_3_bytes(out, from);
   82|      6|  return copy_4_bytes(out, from + 3);
   83|      6|}
fastcopy.c:copy_6_bytes:
   75|     13|static inline unsigned char *copy_6_bytes(unsigned char *out, const unsigned char *from) {
   76|     13|  out = copy_2_bytes(out, from);
   77|     13|  return copy_4_bytes(out, from + 2);
   78|     13|}
fastcopy.c:copy_5_bytes:
   70|     13|static inline unsigned char *copy_5_bytes(unsigned char *out, const unsigned char *from) {
   71|     13|  out = copy_1_bytes(out, from);
   72|     13|  return copy_4_bytes(out, from + 1);
   73|     13|}
fastcopy.c:copy_3_bytes:
   65|     35|static inline unsigned char *copy_3_bytes(unsigned char *out, const unsigned char *from) {
   66|     35|  out = copy_1_bytes(out, from);
   67|     35|  return copy_2_bytes(out, from + 1);
   68|     35|}
fastcopy.c:copy_1_bytes:
   60|     48|static inline unsigned char *copy_1_bytes(unsigned char *out, const unsigned char *from) {
   61|     48|  *out++ = *from;
   62|     48|  return out;
   63|     48|}
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|     20|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|     20|#endif
  416|     20|  unsigned rem = len % sz;
  417|     20|  unsigned ilen;
  418|       |
  419|     20|  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|     20|#endif
  427|       |
  428|     20|  len /= sz;
  429|     20|  out += rem;
  430|     20|  from += rem;
  431|       |
  432|    876|  for (ilen = 0; ilen < len; ilen++) {
  ------------------
  |  Branch (432:18): [True: 856, False: 20]
  ------------------
  433|       |#if defined(__AVX2__)
  434|       |    copy_32_bytes(out, from);
  435|       |#elif defined(__SSE2__)
  436|       |    copy_16_bytes(out, from);
  437|    856|#endif
  438|    856|    out += sz;
  439|    856|    from += sz;
  440|    856|  }
  441|       |
  442|     20|  return out;
  443|     20|}
fastcopy.c:copy_4_bytes:
   48|   190k|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|   190k|  *(uint32_t *) out = *(uint32_t *) from;
   55|   190k|#endif
   56|   190k|  return out + 4;
   57|   190k|}
fastcopy.c:copy_2_bytes:
   37|   233k|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|   233k|  *(uint16_t *) out = *(uint16_t *) from;
   44|   233k|#endif
   45|   233k|  return out + 2;
   46|   233k|}

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

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

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

blosc2_unshuffle:
  436|  4.99k|                 const void* src, void* dest) {
  437|       |  /* Initialize the shuffle implementation if necessary. */
  438|  4.99k|  init_shuffle_implementation();
  439|       |
  440|  4.99k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (440:7): [True: 0, False: 4.99k]
  |  Branch (440:23): [True: 0, False: 4.99k]
  |  Branch (440:41): [True: 0, False: 4.99k]
  ------------------
  441|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  442|      0|  }
  443|       |
  444|       |  /* The implementation is initialized.
  445|       |     Dispatch to it's unshuffle routine. */
  446|  4.99k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  447|       |
  448|  4.99k|  return blocksize;
  449|  4.99k|}
bitunshuffle:
  484|  3.55k|                     const uint8_t format_version) {
  485|       |  /* Initialize the shuffle implementation if necessary. */
  486|  3.55k|  init_shuffle_implementation();
  487|  3.55k|  size_t size = blocksize / typesize;
  488|       |
  489|  3.55k|  if (format_version == 2) {
  ------------------
  |  Branch (489:7): [True: 1.10k, False: 2.45k]
  ------------------
  490|       |    /* Starting from version 3, bitshuffle() works differently */
  491|  1.10k|    if ((size % 8) == 0) {
  ------------------
  |  Branch (491:9): [True: 643, False: 457]
  ------------------
  492|       |      /* The number of elems is a multiple of 8 which is supported by
  493|       |         bitshuffle. */
  494|    643|      int ret = (int) (host_implementation.bitunshuffle)
  495|    643|          ((const void *) src, (void *) dest, blocksize / typesize, typesize);
  496|    643|      if (ret < 0) {
  ------------------
  |  Branch (496:11): [True: 0, False: 643]
  ------------------
  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|    643|    }
  502|    457|    else {
  503|    457|      memcpy(dest, src, blocksize);
  504|    457|    }
  505|  1.10k|  }
  506|  2.45k|  else {
  507|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  508|  2.45k|    size -= size % 8;
  509|  2.45k|    int ret = (int) (host_implementation.bitunshuffle)(src, dest, size, typesize);
  510|  2.45k|    if (ret < 0) {
  ------------------
  |  Branch (510:9): [True: 0, False: 2.45k]
  ------------------
  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.45k|    size_t offset = size * typesize;
  517|  2.45k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  518|  2.45k|  }
  519|       |
  520|  3.55k|  return blocksize;
  521|  3.55k|}
shuffle.c:init_shuffle_implementation:
  391|  8.54k|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|  8.54k|#if defined(__GNUC__) || defined(__clang__)
  401|  8.54k|  if (__builtin_expect(!implementation_initialized, 0)) {
  ------------------
  |  Branch (401:7): [True: 1, False: 8.54k]
  ------------------
  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|  8.54k|}
shuffle.c:get_shuffle_implementation:
  290|      1|static shuffle_implementation_t get_shuffle_implementation(void) {
  291|      1|#if defined(SHUFFLE_AVX512_ENABLED) || defined(SHUFFLE_AVX2_ENABLED) || defined(SHUFFLE_SSE2_ENABLED) || defined(SHUFFLE_NEON_ENABLED) || defined(SHUFFLE_ALTIVEC_ENABLED)
  292|      1|  blosc_cpu_features cpu_features = blosc_get_cpu_features();
  293|      1|#endif
  294|      1|#if defined(SHUFFLE_AVX512_ENABLED)
  295|      1|  if (cpu_features & BLOSC_HAVE_AVX512 && is_shuffle_avx2 && is_bshuf_AVX512) {
  ------------------
  |  Branch (295:7): [True: 0, False: 1]
  |  Branch (295:43): [True: 0, False: 0]
  |  Branch (295:62): [True: 0, False: 0]
  ------------------
  296|      0|    shuffle_implementation_t impl_avx512;
  297|      0|    impl_avx512.name = "avx512";
  298|      0|    impl_avx512.shuffle = (shuffle_func)shuffle_avx2;
  299|      0|    impl_avx512.unshuffle = (unshuffle_func)unshuffle_avx2;
  300|      0|    impl_avx512.bitshuffle = (bitshuffle_func) bshuf_trans_bit_elem_AVX512;
  301|      0|    impl_avx512.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_AVX512;
  302|      0|    return impl_avx512;
  303|      0|  }
  304|      1|#endif  /* defined(SHUFFLE_AVX512_ENABLED) */
  305|       |
  306|      1|#if defined(SHUFFLE_AVX2_ENABLED)
  307|      1|  if (cpu_features & BLOSC_HAVE_AVX2 && is_shuffle_avx2 && is_bshuf_AVX) {
  ------------------
  |  Branch (307:7): [True: 1, False: 0]
  |  Branch (307:41): [True: 1, False: 0]
  |  Branch (307:60): [True: 1, False: 0]
  ------------------
  308|      1|    shuffle_implementation_t impl_avx2;
  309|      1|    impl_avx2.name = "avx2";
  310|      1|    impl_avx2.shuffle = (shuffle_func)shuffle_avx2;
  311|      1|    impl_avx2.unshuffle = (unshuffle_func)unshuffle_avx2;
  312|      1|    impl_avx2.bitshuffle = (bitshuffle_func) bshuf_trans_bit_elem_AVX;
  313|      1|    impl_avx2.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_AVX;
  314|      1|    return impl_avx2;
  315|      1|  }
  316|      0|#endif  /* defined(SHUFFLE_AVX2_ENABLED) */
  317|       |
  318|      0|#if defined(SHUFFLE_SSE2_ENABLED)
  319|      0|  if (cpu_features & BLOSC_HAVE_SSE2 && is_shuffle_sse2 && is_bshuf_SSE) {
  ------------------
  |  Branch (319:7): [True: 0, False: 0]
  |  Branch (319:41): [True: 0, False: 0]
  |  Branch (319:60): [True: 0, False: 0]
  ------------------
  320|      0|    shuffle_implementation_t impl_sse2;
  321|      0|    impl_sse2.name = "sse2";
  322|      0|    impl_sse2.shuffle = (shuffle_func)shuffle_sse2;
  323|      0|    impl_sse2.unshuffle = (unshuffle_func)unshuffle_sse2;
  324|      0|    impl_sse2.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_SSE;
  325|      0|    impl_sse2.bitunshuffle = (bitunshuffle_func) bshuf_untrans_bit_elem_SSE;
  326|      0|    return impl_sse2;
  327|      0|  }
  328|      0|#endif  /* defined(SHUFFLE_SSE2_ENABLED) */
  329|       |
  330|       |#if defined(SHUFFLE_NEON_ENABLED)
  331|       |  if (cpu_features & BLOSC_HAVE_NEON && is_shuffle_neon) { // && is_bshuf_NEON if using NEON bitshuffle
  332|       |    shuffle_implementation_t impl_neon;
  333|       |    impl_neon.name = "neon";
  334|       |    impl_neon.shuffle = (shuffle_func)shuffle_neon;
  335|       |    impl_neon.unshuffle = (unshuffle_func)unshuffle_neon;
  336|       |    //impl_neon.shuffle = (shuffle_func)shuffle_generic;
  337|       |    //impl_neon.unshuffle = (unshuffle_func)unshuffle_generic;
  338|       |    //impl_neon.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_NEON;
  339|       |    //impl_neon.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_NEON;
  340|       |    // The current bitshuffle optimized for NEON is not any faster
  341|       |    // (in fact, it is pretty much slower) than the scalar implementation.
  342|       |    // So, let's use the scalar one, which is pretty fast, at least on a M1 CPU.
  343|       |    impl_neon.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_scal;
  344|       |    impl_neon.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_scal;
  345|       |    return impl_neon;
  346|       |  }
  347|       |#endif  /* defined(SHUFFLE_NEON_ENABLED) */
  348|       |
  349|       |#if defined(SHUFFLE_ALTIVEC_ENABLED)
  350|       |  if (cpu_features & BLOSC_HAVE_ALTIVEC && is_shuffle_altivec && is_bshuf_altivec) {
  351|       |    shuffle_implementation_t impl_altivec;
  352|       |    impl_altivec.name = "altivec";
  353|       |    impl_altivec.shuffle = (shuffle_func)shuffle_altivec;
  354|       |    impl_altivec.unshuffle = (unshuffle_func)unshuffle_altivec;
  355|       |    impl_altivec.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_altivec;
  356|       |    impl_altivec.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_altivec;
  357|       |    return impl_altivec;
  358|       |  }
  359|       |#endif  /* defined(SHUFFLE_ALTIVEC_ENABLED) */
  360|       |
  361|       |  /* Processor doesn't support any of the hardware-accelerated implementations,
  362|       |     so use the generic implementation. */
  363|      0|  shuffle_implementation_t impl_generic;
  364|      0|  impl_generic.name = "generic";
  365|      0|  impl_generic.shuffle = (shuffle_func)shuffle_generic;
  366|      0|  impl_generic.unshuffle = (unshuffle_func)unshuffle_generic;
  367|      0|  impl_generic.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_scal;
  368|      0|  impl_generic.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_scal;
  369|      0|  return impl_generic;
  370|      0|}
shuffle.c:blosc_get_cpu_features:
  100|      1|static blosc_cpu_features blosc_get_cpu_features(void) {
  101|      1|  blosc_cpu_features cpu_features = BLOSC_HAVE_NOTHING;
  102|      1|  if (__builtin_cpu_supports("sse2")) {
  ------------------
  |  Branch (102:7): [True: 1, False: 0]
  ------------------
  103|      1|    cpu_features |= BLOSC_HAVE_SSE2;
  104|      1|  }
  105|      1|  if (__builtin_cpu_supports("avx2")) {
  ------------------
  |  Branch (105:7): [True: 1, False: 0]
  ------------------
  106|      1|    cpu_features |= BLOSC_HAVE_AVX2;
  107|      1|  }
  108|      1|  if (__builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512bw")) {
  ------------------
  |  Branch (108:7): [True: 0, False: 1]
  |  Branch (108:44): [True: 0, False: 0]
  ------------------
  109|      0|    cpu_features |= BLOSC_HAVE_AVX512;
  110|      0|  }
  111|      1|  return cpu_features;
  112|      1|}

blosc2.c:print_error:
  525|      6|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|      6|  return (char *) blosc2_error_string(rc);
  528|      6|}
ndcell.c:blosc2_meta_get:
 2447|      8|                                  int32_t *content_len) {
 2448|      8|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2448:7): [True: 8, False: 0]
  |  Branch (2448:25): [True: 0, False: 0]
  |  Branch (2448:41): [True: 0, False: 0]
  |  Branch (2448:60): [True: 0, False: 0]
  ------------------
 2449|      8|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|      8|    return BLOSC2_ERROR_INVALID_PARAM;
 2451|      8|  }
 2452|       |
 2453|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2454|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2454:7): [True: 0, False: 0]
  ------------------
 2455|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2456|      0|    return nmetalayer;
 2457|      0|  }
 2458|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2459|      0|  if (len < 0) {
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2461|      0|    return BLOSC2_ERROR_DATA;
 2462|      0|  }
 2463|      0|  *content_len = len;
 2464|      0|  if (len == 0) {
  ------------------
  |  Branch (2464:7): [True: 0, False: 0]
  ------------------
 2465|      0|    *content = NULL;
 2466|      0|    return nmetalayer;
 2467|      0|  }
 2468|      0|  *content = (uint8_t*)malloc((size_t)len);
 2469|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2469:7): [True: 0, False: 0]
  ------------------
 2470|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2471|      0|    *content_len = 0;
 2472|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2473|      0|  }
 2474|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2474:7): [True: 0, False: 0]
  |  Branch (2474:18): [True: 0, False: 0]
  ------------------
 2475|      0|    free(*content);
 2476|      0|    *content = NULL;
 2477|      0|    *content_len = 0;
 2478|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|    return BLOSC2_ERROR_DATA;
 2480|      0|  }
 2481|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2482|      0|  return nmetalayer;
 2483|      0|}
ndmean.c:blosc2_meta_get:
 2447|      7|                                  int32_t *content_len) {
 2448|      7|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2448:7): [True: 7, False: 0]
  |  Branch (2448:25): [True: 0, False: 0]
  |  Branch (2448:41): [True: 0, False: 0]
  |  Branch (2448:60): [True: 0, False: 0]
  ------------------
 2449|      7|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|      7|    return BLOSC2_ERROR_INVALID_PARAM;
 2451|      7|  }
 2452|       |
 2453|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2454|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2454:7): [True: 0, False: 0]
  ------------------
 2455|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2456|      0|    return nmetalayer;
 2457|      0|  }
 2458|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2459|      0|  if (len < 0) {
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2461|      0|    return BLOSC2_ERROR_DATA;
 2462|      0|  }
 2463|      0|  *content_len = len;
 2464|      0|  if (len == 0) {
  ------------------
  |  Branch (2464:7): [True: 0, False: 0]
  ------------------
 2465|      0|    *content = NULL;
 2466|      0|    return nmetalayer;
 2467|      0|  }
 2468|      0|  *content = (uint8_t*)malloc((size_t)len);
 2469|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2469:7): [True: 0, False: 0]
  ------------------
 2470|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2471|      0|    *content_len = 0;
 2472|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2473|      0|  }
 2474|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2474:7): [True: 0, False: 0]
  |  Branch (2474:18): [True: 0, False: 0]
  ------------------
 2475|      0|    free(*content);
 2476|      0|    *content = NULL;
 2477|      0|    *content_len = 0;
 2478|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|    return BLOSC2_ERROR_DATA;
 2480|      0|  }
 2481|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2482|      0|  return nmetalayer;
 2483|      0|}
bytedelta.c:print_error:
  525|     13|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     13|  return (char *) blosc2_error_string(rc);
  528|     13|}

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

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

ndlz4_decompress:
  526|    449|                     uint8_t meta, blosc2_dparams *dparams) {
  527|    449|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    449|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  528|    449|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    449|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  529|    449|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    449|    do {                                            \
  |  |  105|    449|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 449]
  |  |  ------------------
  |  |  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|    449|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 449]
  |  |  ------------------
  ------------------
  530|    449|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    449|    do {                                            \
  |  |  105|    449|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 449]
  |  |  ------------------
  |  |  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|    449|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 449]
  |  |  ------------------
  ------------------
  531|       |
  532|    449|  uint8_t *ip = (uint8_t *) input;
  533|    449|  uint8_t *op = (uint8_t *) output;
  534|    449|  uint8_t ndim;
  535|    449|  int32_t blockshape[2];
  536|    449|  int32_t eshape[2];
  537|    449|  uint8_t *buffercpy;
  538|    449|  uint8_t local_buffer[16];
  539|    449|  uint8_t token;
  540|       |  // The fixed header is 1 (ndim) + 2 * int32 (blockshape) = 9 bytes.  Reject any
  541|       |  // input too short to hold it -- the previous `< 8` check let an 8-byte input
  542|       |  // through and the header parse below then read a 9th byte.  The cast keeps the
  543|       |  // comparison signed so a negative `input_len` is rejected here, before the
  544|       |  // `ip + input_len` pointer arithmetic (which would otherwise be UB) is reached.
  545|    449|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    449|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 39, False: 410]
  |  |  ------------------
  ------------------
  546|     39|    return 0;
  547|     39|  }
  548|    410|  uint8_t *ip_limit = ip + input_len;
  549|       |
  550|       |  // Validate that a read of `len` bytes starting at byte offset `pos` (measured
  551|       |  // from the start of `input`) lies fully within the compressed buffer.  A
  552|       |  // crafted token `offset` otherwise makes a back-reference point before
  553|       |  // `input`, and the cell-fill memcpy then leaks out-of-bounds heap memory into
  554|       |  // the (attacker-visible) output buffer -- CWE-125.  The per-cell `ip > ip_limit`
  555|       |  // check is not enough because each cell reads a 2-byte offset and literal bytes
  556|       |  // past that point.  All arithmetic is done on integer offsets so we never form
  557|       |  // an out-of-bounds pointer (which is undefined behaviour in C, even when the
  558|       |  // pointer is only compared and not dereferenced).
  559|    410|#define NDLZ4_CHECK_RANGE(pos, len)                                              \
  560|    410|  do {                                                                           \
  561|    410|    int64_t _pos = (int64_t) (pos);                                              \
  562|    410|    int64_t _len = (int64_t) (len);                                              \
  563|    410|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  564|    410|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  565|    410|      return BLOSC2_ERROR_FAILURE;                                               \
  566|    410|    }                                                                            \
  567|    410|  } while (0)
  568|       |
  569|       |  /* we start with literal copy */
  570|    410|  ndim = *ip;
  571|    410|  ip++;
  572|    410|  if (ndim != 2) {
  ------------------
  |  Branch (572:7): [True: 2, False: 408]
  ------------------
  573|      2|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      2|    return BLOSC2_ERROR_FAILURE;
  575|      2|  }
  576|    408|  memcpy(&blockshape[0], ip, 4);
  577|    408|  ip += 4;
  578|    408|  memcpy(&blockshape[1], ip, 4);
  579|    408|  ip += 4;
  580|       |
  581|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  582|    408|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (582:7): [True: 0, False: 408]
  |  Branch (582:25): [True: 13, False: 395]
  |  Branch (582:46): [True: 27, False: 368]
  ------------------
  583|     40|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     40|    return BLOSC2_ERROR_FAILURE;
  585|     40|  }
  586|       |
  587|    368|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  588|    368|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  589|       |
  590|    368|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    368|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 68, False: 300]
  |  |  ------------------
  ------------------
  591|     68|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     68|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     68|    do {                                            \
  |  |  |  |   98|     68|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     68|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 68, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     68|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     68|    return 0;
  593|     68|  }
  594|    300|  memset(op, 0, blockshape[0] * blockshape[1]);
  595|       |
  596|    300|  uint32_t i_stop[2];
  597|    900|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (597:19): [True: 600, False: 300]
  ------------------
  598|    600|    i_stop[i] = eshape[i] / 4;
  599|    600|  }
  600|       |
  601|       |  /* main loop */
  602|    300|  uint32_t ii[2];
  603|    300|  uint32_t padding[2] = {0};
  604|    300|  uint32_t ind = 0;
  605|    300|  uint8_t cell_aux[16];
  606|  5.95G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (606:19): [True: 5.95G, False: 231]
  ------------------
  607|  5.95G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (607:21): [True: 573, False: 5.95G]
  ------------------
  608|    573|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    573|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 573]
  |  |  ------------------
  ------------------
  609|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      0|        return BLOSC2_ERROR_FAILURE;
  611|      0|      }
  612|    573|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (612:11): [True: 509, False: 64]
  ------------------
  613|    509|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (613:22): [True: 15, False: 494]
  ------------------
  614|    509|      } else {
  615|     64|        padding[0] = 4;
  616|     64|      }
  617|    573|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (617:11): [True: 304, False: 269]
  ------------------
  618|    304|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (618:22): [True: 32, False: 272]
  ------------------
  619|    304|      } else {
  620|    269|        padding[1] = 4;
  621|    269|      }
  622|    573|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  623|    573|      NDLZ4_CHECK_RANGE(cur, 1);
  ------------------
  |  |  560|    573|  do {                                                                           \
  |  |  561|    573|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    573|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    573|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 573]
  |  |  |  Branch (563:21): [True: 0, False: 573]
  |  |  |  Branch (563:33): [True: 0, False: 573]
  |  |  ------------------
  |  |  564|      0|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      0|    }                                                                            \
  |  |  567|    573|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 573]
  |  |  ------------------
  ------------------
  624|    573|      token = *ip++;
  625|    573|      if (token == 0) {    // no match
  ------------------
  |  Branch (625:11): [True: 145, False: 428]
  ------------------
  626|    145|        NDLZ4_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    145|  do {                                                                           \
  |  |  561|    145|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    145|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    145|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 145]
  |  |  |  Branch (563:21): [True: 0, False: 145]
  |  |  |  Branch (563:33): [True: 3, False: 142]
  |  |  ------------------
  |  |  564|      3|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      3|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      3|    }                                                                            \
  |  |  567|    145|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 142]
  |  |  ------------------
  ------------------
  627|    142|        buffercpy = ip;
  628|    142|        ip += padding[0] * padding[1];
  629|    428|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (629:18): [True: 85, False: 343]
  ------------------
  630|     85|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|     85|  do {                                                                           \
  |  |  561|     85|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     85|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     85|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 85]
  |  |  |  Branch (563:21): [True: 0, False: 85]
  |  |  |  Branch (563:33): [True: 0, False: 85]
  |  |  ------------------
  |  |  564|      0|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      0|    }                                                                            \
  |  |  567|     85|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 85]
  |  |  ------------------
  ------------------
  631|     85|        uint16_t offset;
  632|     85|        memcpy(&offset, ip, sizeof(offset));
  633|     85|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;   // back-reference start offset
  634|     85|        NDLZ4_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|     85|  do {                                                                           \
  |  |  561|     85|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     85|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     85|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 85]
  |  |  |  Branch (563:21): [True: 0, False: 85]
  |  |  |  Branch (563:33): [True: 0, False: 85]
  |  |  ------------------
  |  |  564|      0|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      0|    }                                                                            \
  |  |  567|     85|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 85]
  |  |  ------------------
  ------------------
  635|     85|        buffercpy = (uint8_t *) input + bpos;
  636|     85|        ip += 2;
  637|    343|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (637:18): [True: 77, False: 266]
  ------------------
  638|     77|        NDLZ4_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  560|     77|  do {                                                                           \
  |  |  561|     77|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     77|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     77|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 77]
  |  |  |  Branch (563:21): [True: 0, False: 77]
  |  |  |  Branch (563:33): [True: 1, False: 76]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|     77|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 76]
  |  |  ------------------
  ------------------
  639|     76|        buffercpy = cell_aux;
  640|     76|        memset(buffercpy, *ip, 16);
  641|     76|        ip++;
  642|    266|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (642:18): [True: 45, False: 221]
  ------------------
  643|     45|        buffercpy = local_buffer;
  644|     45|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|     45|  do {                                                                           \
  |  |  561|     45|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     45|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     45|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 45]
  |  |  |  Branch (563:21): [True: 0, False: 45]
  |  |  |  Branch (563:33): [True: 0, False: 45]
  |  |  ------------------
  |  |  564|      0|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      0|    }                                                                            \
  |  |  567|     45|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 45]
  |  |  ------------------
  ------------------
  645|     45|        uint16_t offset;
  646|     45|        memcpy(&offset, ip, sizeof(offset));
  647|     45|        offset += 3;
  648|     45|        ip += 2;
  649|     45|        int i, j, k;
  650|     45|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (650:13): [True: 9, False: 36]
  ------------------
  651|      9|          i = 1;
  652|      9|          j = 2;
  653|      9|          k = 3;
  654|     36|        } else {
  655|     36|          i = 0;
  656|     36|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (656:15): [True: 3, False: 33]
  ------------------
  657|      3|            j = 1;
  658|      3|            k = 2;
  659|     33|          } else {
  660|     33|            k = 3;
  661|     33|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (661:17): [True: 4, False: 29]
  ------------------
  662|      4|              j = 1;
  663|     29|            } else {
  664|     29|              j = 2;
  665|     29|            }
  666|     33|          }
  667|     36|        }
  668|     45|        int64_t bpos = (cur + 3) - (int64_t) offset;   // == (ip - offset) as an offset
  669|     45|        NDLZ4_CHECK_RANGE(bpos, 12);
  ------------------
  |  |  560|     45|  do {                                                                           \
  |  |  561|     45|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     45|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     45|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 9, False: 36]
  |  |  |  Branch (563:21): [True: 0, False: 36]
  |  |  |  Branch (563:33): [True: 13, False: 23]
  |  |  ------------------
  |  |  564|     22|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     22|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     22|    do {                                            \
  |  |  |  |  |  |   98|     22|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     22|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 22, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     22|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     22|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     22|    }                                                                            \
  |  |  567|     45|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 23]
  |  |  ------------------
  ------------------
  670|     23|        const uint8_t *ref = (const uint8_t *) input + bpos;
  671|     23|        memcpy(&buffercpy[i * 4], ref, 4);
  672|     23|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  673|     23|        memcpy(&buffercpy[k * 4], ref + 8, 4);
  674|     45|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (674:25): [True: 45, False: 0]
  ------------------
  675|     45|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (675:15): [True: 23, False: 22]
  |  Branch (675:27): [True: 23, False: 0]
  |  Branch (675:39): [True: 23, False: 0]
  ------------------
  676|     23|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|     23|  do {                                                                           \
  |  |  561|     23|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     23|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     23|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 23]
  |  |  |  Branch (563:21): [True: 0, False: 23]
  |  |  |  Branch (563:33): [True: 0, False: 23]
  |  |  ------------------
  |  |  564|      0|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      0|    }                                                                            \
  |  |  567|     23|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 23]
  |  |  ------------------
  ------------------
  677|     23|            memcpy(&buffercpy[l * 4], ip, 4);
  678|     23|            ip += 4;
  679|     23|            break;
  680|     23|          }
  681|     45|        }
  682|       |
  683|    221|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (683:18): [True: 145, False: 76]
  |  Branch (683:36): [True: 143, False: 2]
  ------------------
  684|    143|        buffercpy = local_buffer;
  685|    143|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    143|  do {                                                                           \
  |  |  561|    143|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    143|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    143|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 143]
  |  |  |  Branch (563:21): [True: 0, False: 143]
  |  |  |  Branch (563:33): [True: 0, False: 143]
  |  |  ------------------
  |  |  564|      0|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      0|    }                                                                            \
  |  |  567|    143|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 143]
  |  |  ------------------
  ------------------
  686|    143|        uint16_t offset;
  687|    143|        memcpy(&offset, ip, sizeof(offset));
  688|    143|        offset += 3;
  689|    143|        ip += 2;
  690|    143|        int i, j;
  691|    143|        if (token == 128) {
  ------------------
  |  Branch (691:13): [True: 5, False: 138]
  ------------------
  692|      5|          i = 2;
  693|      5|          j = 3;
  694|    138|        } else {
  695|    138|          i = (token - 128) >> 5U;
  696|    138|          j = ((token - 128) >> 3U) - (i << 2U);
  697|    138|        }
  698|    143|        int64_t bpos = (cur + 3) - (int64_t) offset;
  699|    143|        NDLZ4_CHECK_RANGE(bpos, 8);
  ------------------
  |  |  560|    143|  do {                                                                           \
  |  |  561|    143|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    143|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    143|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 10, False: 133]
  |  |  |  Branch (563:21): [True: 0, False: 133]
  |  |  |  Branch (563:33): [True: 6, False: 127]
  |  |  ------------------
  |  |  564|     16|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     16|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     16|    do {                                            \
  |  |  |  |  |  |   98|     16|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     16|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 16, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     16|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     16|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     16|    }                                                                            \
  |  |  567|    143|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 127]
  |  |  ------------------
  ------------------
  700|    127|        const uint8_t *ref = (const uint8_t *) input + bpos;
  701|    127|        memcpy(&buffercpy[i * 4], ref, 4);
  702|    127|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  703|    632|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (703:25): [True: 506, False: 126]
  ------------------
  704|    506|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (704:15): [True: 380, False: 126]
  |  Branch (704:27): [True: 255, False: 125]
  ------------------
  705|    255|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    255|  do {                                                                           \
  |  |  561|    255|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    255|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    255|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 255]
  |  |  |  Branch (563:21): [True: 0, False: 255]
  |  |  |  Branch (563:33): [True: 1, False: 254]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    255|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 254]
  |  |  ------------------
  ------------------
  706|    254|            memcpy(&buffercpy[k * 4], ip, 4);
  707|    254|            ip += 4;
  708|    254|          }
  709|    506|        }
  710|    127|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (710:18): [True: 72, False: 6]
  |  Branch (710:35): [True: 66, False: 6]
  ------------------
  711|     66|        buffercpy = local_buffer;
  712|     66|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|     66|  do {                                                                           \
  |  |  561|     66|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     66|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     66|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 66]
  |  |  |  Branch (563:21): [True: 0, False: 66]
  |  |  |  Branch (563:33): [True: 1, False: 65]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|     66|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 65]
  |  |  ------------------
  ------------------
  713|     65|        uint16_t offset_1;
  714|     65|        memcpy(&offset_1, ip, sizeof(offset_1));
  715|     65|        offset_1 += 5;
  716|     65|        ip += 2;
  717|     65|        NDLZ4_CHECK_RANGE(cur + 3, 2);
  ------------------
  |  |  560|     65|  do {                                                                           \
  |  |  561|     65|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     65|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     65|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 65]
  |  |  |  Branch (563:21): [True: 0, False: 65]
  |  |  |  Branch (563:33): [True: 8, False: 57]
  |  |  ------------------
  |  |  564|      8|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      8|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      8|    }                                                                            \
  |  |  567|     65|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 57]
  |  |  ------------------
  ------------------
  718|     57|        uint16_t offset_2;
  719|     57|        memcpy(&offset_2, ip, sizeof(offset_2));
  720|     57|        offset_2 += 5;
  721|     57|        ip += 2;
  722|     57|        int i, j, k, l, m;
  723|     57|        i = 0;
  724|     57|        j = ((token - 32) >> 3U);
  725|     57|        l = -1;
  726|    228|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (726:21): [True: 171, False: 57]
  ------------------
  727|    171|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (727:15): [True: 171, False: 0]
  |  Branch (727:27): [True: 114, False: 57]
  ------------------
  728|    114|            if (l == -1) {
  ------------------
  |  Branch (728:17): [True: 57, False: 57]
  ------------------
  729|     57|              l = k;
  730|     57|            } else {
  731|     57|              m = k;
  732|     57|            }
  733|    114|          }
  734|    171|        }
  735|     57|        int64_t bpos1 = (cur + 5) - (int64_t) offset_1;
  736|     57|        NDLZ4_CHECK_RANGE(bpos1, 8);
  ------------------
  |  |  560|     57|  do {                                                                           \
  |  |  561|     57|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     57|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     57|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 3, False: 54]
  |  |  |  Branch (563:21): [True: 0, False: 54]
  |  |  |  Branch (563:33): [True: 1, False: 53]
  |  |  ------------------
  |  |  564|      4|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      4|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      4|    }                                                                            \
  |  |  567|     57|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 53]
  |  |  ------------------
  ------------------
  737|     53|        const uint8_t *ref1 = (const uint8_t *) input + bpos1;
  738|     53|        memcpy(&buffercpy[i * 4], ref1, 4);
  739|     53|        memcpy(&buffercpy[j * 4], ref1 + 4, 4);
  740|     53|        int64_t bpos2 = (cur + 5) - (int64_t) offset_2;
  741|     53|        NDLZ4_CHECK_RANGE(bpos2, 8);
  ------------------
  |  |  560|     53|  do {                                                                           \
  |  |  561|     53|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     53|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     53|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 1, False: 52]
  |  |  |  Branch (563:21): [True: 0, False: 52]
  |  |  |  Branch (563:33): [True: 0, False: 52]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|     53|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 52]
  |  |  ------------------
  ------------------
  742|     52|        const uint8_t *ref2 = (const uint8_t *) input + bpos2;
  743|     52|        memcpy(&buffercpy[l * 4], ref2, 4);
  744|     52|        memcpy(&buffercpy[m * 4], ref2 + 4, 4);
  745|       |
  746|     52|      } else {
  747|     12|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|     12|        return BLOSC2_ERROR_FAILURE;
  749|     12|      }
  750|       |      // fill op with buffercpy
  751|    504|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  752|  2.52k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (752:28): [True: 2.01k, False: 504]
  ------------------
  753|  2.01k|        if (i < padding[0]) {
  ------------------
  |  Branch (753:13): [True: 692, False: 1.32k]
  ------------------
  754|    692|          ind = orig + i * blockshape[1];
  755|    692|          memcpy(&op[ind], buffercpy, padding[1]);
  756|       |          // Only advance over rows we actually consume.  For a literal cell
  757|       |          // (token == 0) buffercpy points into the input and only holds
  758|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  759|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  760|       |          // for the block's last cell.  The skipped rows are never read.
  761|    692|          buffercpy += padding[1];
  762|    692|        }
  763|  2.01k|      }
  764|    504|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (764:11): [True: 0, False: 504]
  ------------------
  765|      0|        BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|      0|        return BLOSC2_ERROR_FAILURE;
  767|      0|      }
  768|    504|    }
  769|  5.95G|  }
  770|    231|  ind += padding[1];
  771|       |
  772|    231|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (772:7): [True: 0, False: 231]
  ------------------
  773|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  774|      0|    return BLOSC2_ERROR_FAILURE;
  775|      0|  }
  776|    231|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (776:7): [True: 0, False: 231]
  ------------------
  777|      0|    BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|      0|    return BLOSC2_ERROR_FAILURE;
  779|      0|  }
  780|       |
  781|    231|  return (int) ind;
  782|    231|#undef NDLZ4_CHECK_RANGE
  783|    231|}

ndlz8_decompress:
  444|    402|                     uint8_t meta, blosc2_dparams *dparams) {
  445|    402|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    402|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  446|    402|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    402|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  447|    402|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    402|    do {                                            \
  |  |  105|    402|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 402]
  |  |  ------------------
  |  |  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|    402|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 402]
  |  |  ------------------
  ------------------
  448|    402|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    402|    do {                                            \
  |  |  105|    402|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 402]
  |  |  ------------------
  |  |  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|    402|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 402]
  |  |  ------------------
  ------------------
  449|       |
  450|    402|  const int cell_shape = 8;
  451|    402|  const int cell_size = 64;
  452|    402|  uint8_t *ip = (uint8_t *) input;
  453|    402|  uint8_t *op = (uint8_t *) output;
  454|    402|  uint8_t ndim;
  455|    402|  int32_t blockshape[2];
  456|    402|  int32_t eshape[2];
  457|    402|  uint8_t *buffercpy;
  458|    402|  uint8_t token;
  459|       |  // The fixed header is 1 (ndim) + 2 * int32 (blockshape) = 9 bytes.  Reject any
  460|       |  // input too short to hold it -- the previous `< 8` check let an 8-byte input
  461|       |  // through and the header parse below then read a 9th byte.  The cast keeps the
  462|       |  // comparison signed so a negative `input_len` is rejected here, before the
  463|       |  // `ip + input_len` pointer arithmetic (which would otherwise be UB) is reached.
  464|    402|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    402|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 32, False: 370]
  |  |  ------------------
  ------------------
  465|     32|    return 0;
  466|     32|  }
  467|    370|  uint8_t *ip_limit = ip + input_len;
  468|       |
  469|       |  /* we start with literal copy */
  470|    370|  ndim = *ip;
  471|    370|  ip++;
  472|    370|  if (ndim != 2) {
  ------------------
  |  Branch (472:7): [True: 3, False: 367]
  ------------------
  473|      3|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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 BLOSC2_ERROR_FAILURE;
  475|      3|  }
  476|    367|  memcpy(&blockshape[0], ip, 4);
  477|    367|  ip += 4;
  478|    367|  memcpy(&blockshape[1], ip, 4);
  479|    367|  ip += 4;
  480|       |
  481|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  482|    367|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 367]
  |  Branch (482:25): [True: 23, False: 344]
  |  Branch (482:46): [True: 19, False: 325]
  ------------------
  483|     42|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     42|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     42|    do {                                            \
  |  |  |  |   98|     42|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     42|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     42|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|     42|    return BLOSC2_ERROR_FAILURE;
  485|     42|  }
  486|       |
  487|    325|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  488|    325|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  489|       |
  490|    325|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    325|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 80, False: 245]
  |  |  ------------------
  ------------------
  491|     80|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     80|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     80|    do {                                            \
  |  |  |  |   98|     80|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     80|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 80, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     80|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|     80|    return 0;
  493|     80|  }
  494|    245|  memset(op, 0, blockshape[0] * blockshape[1]);
  495|       |
  496|    245|  int32_t i_stop[2];
  497|    735|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (497:19): [True: 490, False: 245]
  ------------------
  498|    490|    i_stop[i] = eshape[i] / cell_shape;
  499|    490|  }
  500|       |
  501|       |  /* main loop */
  502|    245|  int32_t ii[2];
  503|    245|  int32_t padding[2] = {0};
  504|    245|  int32_t ind = 0;
  505|    245|  uint8_t *local_buffer = malloc(cell_size);
  506|    245|  uint8_t *cell_aux = malloc(cell_size);
  507|       |
  508|       |  // Validate that a read of `len` bytes starting at byte offset `pos` (measured
  509|       |  // from the start of `input`) lies fully within the compressed buffer.  A
  510|       |  // crafted token `offset` otherwise makes a back-reference point before
  511|       |  // `input`, and the cell-fill memcpy then leaks out-of-bounds heap memory into
  512|       |  // the (attacker-visible) output -- CWE-125.  The per-cell `ip > ip_limit`
  513|       |  // check is not enough because each cell reads a 2-byte offset and literal
  514|       |  // bytes past that point.  All arithmetic is done on integer offsets so we
  515|       |  // never form an out-of-bounds pointer (undefined behaviour in C, even when the
  516|       |  // pointer is only compared and not dereferenced).
  517|    245|#define NDLZ8_CHECK_RANGE(pos, len)                                              \
  518|    245|  do {                                                                           \
  519|    245|    int64_t _pos = (int64_t) (pos);                                              \
  520|    245|    int64_t _len = (int64_t) (len);                                              \
  521|    245|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  522|    245|      free(local_buffer);                                                        \
  523|    245|      free(cell_aux);                                                            \
  524|    245|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  525|    245|      return BLOSC2_ERROR_FAILURE;                                               \
  526|    245|    }                                                                            \
  527|    245|  } while (0)
  528|       |
  529|  2.00G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (529:19): [True: 2.00G, False: 202]
  ------------------
  530|  2.00G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (530:21): [True: 348, False: 2.00G]
  ------------------
  531|    348|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    348|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 348]
  |  |  ------------------
  ------------------
  532|      0|        free(local_buffer);
  533|      0|        free(cell_aux);
  534|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|      0|        return BLOSC2_ERROR_FAILURE;
  536|      0|      }
  537|    348|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (537:11): [True: 294, False: 54]
  ------------------
  538|    294|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (538:22): [True: 2, False: 292]
  ------------------
  539|    294|      } else {
  540|     54|        padding[0] = cell_shape;
  541|     54|      }
  542|    348|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (542:11): [True: 244, False: 104]
  ------------------
  543|    244|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (543:22): [True: 3, False: 241]
  ------------------
  544|    244|      } else {
  545|    104|        padding[1] = cell_shape;
  546|    104|      }
  547|    348|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  548|    348|      NDLZ8_CHECK_RANGE(cur, 1);
  ------------------
  |  |  518|    348|  do {                                                                           \
  |  |  519|    348|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    348|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    348|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 348]
  |  |  |  Branch (521:21): [True: 0, False: 348]
  |  |  |  Branch (521:33): [True: 0, False: 348]
  |  |  ------------------
  |  |  522|      0|      free(local_buffer);                                                        \
  |  |  523|      0|      free(cell_aux);                                                            \
  |  |  524|      0|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      0|    }                                                                            \
  |  |  527|    348|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 348]
  |  |  ------------------
  ------------------
  549|    348|      token = *ip++;
  550|    348|      uint8_t match_type = (token >> 3U);
  551|    348|      if (token == 0) {    // no match
  ------------------
  |  Branch (551:11): [True: 107, False: 241]
  ------------------
  552|    107|        NDLZ8_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    107|  do {                                                                           \
  |  |  519|    107|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    107|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    107|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 107]
  |  |  |  Branch (521:21): [True: 0, False: 107]
  |  |  |  Branch (521:33): [True: 7, False: 100]
  |  |  ------------------
  |  |  522|      7|      free(local_buffer);                                                        \
  |  |  523|      7|      free(cell_aux);                                                            \
  |  |  524|      7|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      7|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      7|    }                                                                            \
  |  |  527|    107|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 100]
  |  |  ------------------
  ------------------
  553|    100|        buffercpy = ip;
  554|    100|        ip += padding[0] * padding[1];
  555|    241|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (555:18): [True: 76, False: 165]
  ------------------
  556|     76|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     76|  do {                                                                           \
  |  |  519|     76|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     76|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     76|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 76]
  |  |  |  Branch (521:21): [True: 0, False: 76]
  |  |  |  Branch (521:33): [True: 0, False: 76]
  |  |  ------------------
  |  |  522|      0|      free(local_buffer);                                                        \
  |  |  523|      0|      free(cell_aux);                                                            \
  |  |  524|      0|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      0|    }                                                                            \
  |  |  527|     76|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 76]
  |  |  ------------------
  ------------------
  557|     76|        uint16_t offset;
  558|     76|        memcpy(&offset, ip, sizeof(offset));
  559|     76|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;
  560|     76|        NDLZ8_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|     76|  do {                                                                           \
  |  |  519|     76|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     76|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     76|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 76]
  |  |  |  Branch (521:21): [True: 0, False: 76]
  |  |  |  Branch (521:33): [True: 1, False: 75]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|     76|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 75]
  |  |  ------------------
  ------------------
  561|     75|        buffercpy = (uint8_t *) input + bpos;
  562|     75|        ip += 2;
  563|    165|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (563:18): [True: 106, False: 59]
  ------------------
  564|    106|        NDLZ8_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  518|    106|  do {                                                                           \
  |  |  519|    106|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    106|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    106|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 106]
  |  |  |  Branch (521:21): [True: 0, False: 106]
  |  |  |  Branch (521:33): [True: 0, False: 106]
  |  |  ------------------
  |  |  522|      0|      free(local_buffer);                                                        \
  |  |  523|      0|      free(cell_aux);                                                            \
  |  |  524|      0|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      0|    }                                                                            \
  |  |  527|    106|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 106]
  |  |  ------------------
  ------------------
  565|    106|        buffercpy = cell_aux;
  566|    106|        memset(buffercpy, *ip, cell_size);
  567|    106|        ip++;
  568|    106|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (568:18): [True: 15, False: 44]
  ------------------
  569|     15|        buffercpy = local_buffer;
  570|     15|        int row = (int) (token & 7);
  571|     15|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (571:13): [True: 1, False: 14]
  ------------------
  572|      1|          free(local_buffer);
  573|      1|          free(cell_aux);
  574|      1|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      1|          return BLOSC2_ERROR_FAILURE;
  576|      1|        }
  577|     14|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     14|  do {                                                                           \
  |  |  519|     14|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     14|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     14|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 14]
  |  |  |  Branch (521:21): [True: 0, False: 14]
  |  |  |  Branch (521:33): [True: 0, False: 14]
  |  |  ------------------
  |  |  522|      0|      free(local_buffer);                                                        \
  |  |  523|      0|      free(cell_aux);                                                            \
  |  |  524|      0|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      0|    }                                                                            \
  |  |  527|     14|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 14]
  |  |  ------------------
  ------------------
  578|     14|        uint16_t offset;
  579|     14|        memcpy(&offset, ip, sizeof(offset));
  580|     14|        ip += 2;
  581|       |        // back-reference base == ip - sizeof(token) - sizeof(offset) - offset,
  582|       |        // i.e. (cur + 3) - 3 - offset == cur - offset, expressed as an offset.
  583|     14|        int64_t bpos = cur - (int64_t) offset;
  584|     14|        NDLZ8_CHECK_RANGE(bpos, 3 * cell_shape);
  ------------------
  |  |  518|     14|  do {                                                                           \
  |  |  519|     14|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     14|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     14|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 1, False: 13]
  |  |  |  Branch (521:21): [True: 0, False: 13]
  |  |  |  Branch (521:33): [True: 0, False: 13]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|     14|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 13]
  |  |  ------------------
  ------------------
  585|     13|        const uint8_t *ref = (const uint8_t *) input + bpos;
  586|     52|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (586:25): [True: 39, False: 13]
  ------------------
  587|     39|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  588|     39|        }
  589|    112|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (589:25): [True: 100, False: 12]
  ------------------
  590|    100|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (590:15): [True: 38, False: 62]
  |  Branch (590:28): [True: 26, False: 36]
  ------------------
  591|     64|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|     64|  do {                                                                           \
  |  |  519|     64|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     64|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     64|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 64]
  |  |  |  Branch (521:21): [True: 0, False: 64]
  |  |  |  Branch (521:33): [True: 1, False: 63]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|     64|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 63]
  |  |  ------------------
  ------------------
  592|     63|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  593|     63|            ip += cell_shape;
  594|     63|          }
  595|    100|        }
  596|     44|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (596:18): [True: 16, False: 28]
  ------------------
  597|     16|        buffercpy = local_buffer;
  598|     16|        int row = (int) (token & 7);
  599|     16|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (599:13): [True: 1, False: 15]
  ------------------
  600|      1|          free(local_buffer);
  601|      1|          free(cell_aux);
  602|      1|          BLOSC_TRACE_ERROR("Pair match row out of bounds");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|      1|          return BLOSC2_ERROR_FAILURE;
  604|      1|        }
  605|     15|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     15|  do {                                                                           \
  |  |  519|     15|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     15|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     15|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 15]
  |  |  |  Branch (521:21): [True: 0, False: 15]
  |  |  |  Branch (521:33): [True: 0, False: 15]
  |  |  ------------------
  |  |  522|      0|      free(local_buffer);                                                        \
  |  |  523|      0|      free(cell_aux);                                                            \
  |  |  524|      0|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      0|    }                                                                            \
  |  |  527|     15|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
  606|     15|        uint16_t offset;
  607|     15|        memcpy(&offset, ip, sizeof(offset));
  608|     15|        ip += 2;
  609|       |        // back-reference base == cur - offset (see triple-match note above).
  610|     15|        int64_t bpos = cur - (int64_t) offset;
  611|     15|        NDLZ8_CHECK_RANGE(bpos, 2 * cell_shape);
  ------------------
  |  |  518|     15|  do {                                                                           \
  |  |  519|     15|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     15|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     15|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 15]
  |  |  |  Branch (521:21): [True: 0, False: 15]
  |  |  |  Branch (521:33): [True: 0, False: 15]
  |  |  ------------------
  |  |  522|      0|      free(local_buffer);                                                        \
  |  |  523|      0|      free(cell_aux);                                                            \
  |  |  524|      0|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      0|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      0|    }                                                                            \
  |  |  527|     15|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
  612|     15|        const uint8_t *ref = (const uint8_t *) input + bpos;
  613|     45|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (613:25): [True: 30, False: 15]
  ------------------
  614|     30|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  615|     30|        }
  616|    123|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (616:25): [True: 111, False: 12]
  ------------------
  617|    111|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (617:15): [True: 55, False: 56]
  |  Branch (617:28): [True: 30, False: 26]
  ------------------
  618|     85|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|     85|  do {                                                                           \
  |  |  519|     85|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     85|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     85|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 85]
  |  |  |  Branch (521:21): [True: 0, False: 85]
  |  |  |  Branch (521:33): [True: 3, False: 82]
  |  |  ------------------
  |  |  522|      3|      free(local_buffer);                                                        \
  |  |  523|      3|      free(cell_aux);                                                            \
  |  |  524|      3|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      3|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      3|    }                                                                            \
  |  |  527|     85|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 82]
  |  |  ------------------
  ------------------
  619|     82|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  620|     82|            ip += cell_shape;
  621|     82|          }
  622|    111|        }
  623|     28|      } else {
  624|     28|        free(local_buffer);
  625|     28|        free(cell_aux);
  626|     28|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     28|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     28|    do {                                            \
  |  |  |  |   98|     28|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     28|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 28, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     28|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|     28|        return BLOSC2_ERROR_FAILURE;
  628|     28|      }
  629|       |
  630|    305|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  631|  2.74k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (631:27): [True: 2.44k, False: 305]
  ------------------
  632|  2.44k|        if (i < padding[0]) {
  ------------------
  |  Branch (632:13): [True: 1.31k, False: 1.12k]
  ------------------
  633|  1.31k|          ind = orig + i * blockshape[1];
  634|  1.31k|          memcpy(&op[ind], buffercpy, padding[1]);
  635|       |          // Only advance over rows we actually consume.  For a literal cell
  636|       |          // (token == 0) buffercpy points into the input and only holds
  637|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  638|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  639|       |          // for the block's last cell.  The skipped rows are never read.
  640|  1.31k|          buffercpy += padding[1];
  641|  1.31k|        }
  642|  2.44k|      }
  643|    305|      if (ind > output_len) {
  ------------------
  |  Branch (643:11): [True: 0, False: 305]
  ------------------
  644|      0|        free(local_buffer);
  645|      0|        free(cell_aux);
  646|      0|        BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  647|      0|        return BLOSC2_ERROR_FAILURE;
  648|      0|      }
  649|    305|    }
  650|  2.00G|  }
  651|    202|  ind += padding[1];
  652|       |
  653|    202|  free(cell_aux);
  654|    202|  free(local_buffer);
  655|       |
  656|    202|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (656:7): [True: 0, False: 202]
  ------------------
  657|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|      0|    return BLOSC2_ERROR_FAILURE;
  659|      0|  }
  660|    202|  if (ind > output_len) {
  ------------------
  |  Branch (660:7): [True: 0, False: 202]
  ------------------
  661|      0|    BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  662|      0|    return BLOSC2_ERROR_FAILURE;
  663|      0|  }
  664|       |
  665|    202|  return (int) ind;
  666|    202|#undef NDLZ8_CHECK_RANGE
  667|    202|}

zfp_acc_decompress:
  233|      1|                       int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  234|      1|  ZFP_ERROR_NULL(input);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  235|      1|  ZFP_ERROR_NULL(output);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  236|      1|  ZFP_ERROR_NULL(dparams);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  237|      1|  ZFP_ERROR_NULL(dparams->schunk);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   24|      1|      return 0;                 \
  |  |   25|      1|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  238|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  239|       |
  240|      0|  blosc2_schunk *sc = dparams->schunk;
  241|      0|  int32_t typesize = sc->typesize;
  242|       |
  243|      0|  double tol = (int8_t) meta;
  244|      0|  int8_t ndim;
  245|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  246|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  247|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  248|      0|  uint8_t *smeta;
  249|      0|  int32_t smeta_len;
  250|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (250:7): [True: 0, False: 0]
  ------------------
  251|      0|    BLOSC_TRACE_ERROR("Cannot access b2nd meta info");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|      0|    free(shape);
  253|      0|    free(chunkshape);
  254|      0|    free(blockshape);
  255|      0|    return BLOSC2_ERROR_FAILURE;
  256|      0|  }
  257|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  258|      0|  free(smeta);
  259|       |
  260|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (260:7): [True: 0, False: 0]
  ------------------
  261|      0|    free(shape);
  262|      0|    free(chunkshape);
  263|      0|    free(blockshape);
  264|      0|    return BLOSC2_ERROR_FAILURE;
  265|      0|  }
  266|       |
  267|      0|  zfp_type type;     /* array scalar type */
  268|      0|  zfp_field *field;  /* array meta data */
  269|      0|  zfp_stream *zfp;   /* compressed stream */
  270|      0|  bitstream *stream; /* bit stream to write to or read from */
  271|      0|  size_t zfpsize;    /* byte size of compressed stream */
  272|      0|  double tolerance = pow(10, tol);
  273|       |
  274|      0|  switch (typesize) {
  275|      0|    case sizeof(float):
  ------------------
  |  Branch (275:5): [True: 0, False: 0]
  ------------------
  276|      0|      type = zfp_type_float;
  277|      0|      break;
  278|      0|    case sizeof(double):
  ------------------
  |  Branch (278:5): [True: 0, False: 0]
  ------------------
  279|      0|      type = zfp_type_double;
  280|      0|      break;
  281|      0|    default:
  ------------------
  |  Branch (281:5): [True: 0, False: 0]
  ------------------
  282|      0|      free(shape);
  283|      0|      free(chunkshape);
  284|      0|      free(blockshape);
  285|      0|      BLOSC_TRACE_ERROR("ZFP is not available for typesize: %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|      0|      return BLOSC2_ERROR_FAILURE;
  287|      0|  }
  288|       |
  289|      0|  zfp = zfp_stream_open(NULL);
  290|      0|  zfp_stream_set_accuracy(zfp, tolerance);
  291|      0|  stream = stream_open((void *) input, input_len);
  292|      0|  zfp_stream_set_bit_stream(zfp, stream);
  293|      0|  zfp_stream_rewind(zfp);
  294|       |
  295|      0|  switch (ndim) {
  296|      0|    case 1:
  ------------------
  |  Branch (296:5): [True: 0, False: 0]
  ------------------
  297|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  298|      0|      break;
  299|      0|    case 2:
  ------------------
  |  Branch (299:5): [True: 0, False: 0]
  ------------------
  300|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  301|      0|      break;
  302|      0|    case 3:
  ------------------
  |  Branch (302:5): [True: 0, False: 0]
  ------------------
  303|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  304|      0|      break;
  305|      0|    case 4:
  ------------------
  |  Branch (305:5): [True: 0, False: 0]
  ------------------
  306|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  307|      0|      break;
  308|      0|    default:
  ------------------
  |  Branch (308:5): [True: 0, False: 0]
  ------------------
  309|      0|      free(shape);
  310|      0|      free(chunkshape);
  311|      0|      free(blockshape);
  312|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|      0|      return BLOSC2_ERROR_FAILURE;
  314|      0|  }
  315|       |
  316|      0|  zfpsize = zfp_decompress(zfp, field);
  317|       |
  318|       |  /* clean up */
  319|      0|  zfp_field_free(field);
  320|      0|  zfp_stream_close(zfp);
  321|      0|  stream_close(stream);
  322|      0|  free(shape);
  323|      0|  free(chunkshape);
  324|      0|  free(blockshape);
  325|       |
  326|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (326:7): [True: 0, False: 0]
  ------------------
  327|      0|    BLOSC_TRACE_ERROR("\n ZFP: Decompression failed\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  328|      0|    return (int) zfpsize;
  329|      0|  }
  330|       |
  331|      0|  return (int) output_len;
  332|      0|}
zfp_prec_decompress:
  509|      1|                        int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  510|      1|  ZFP_ERROR_NULL(input);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  511|      1|  ZFP_ERROR_NULL(output);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  512|      1|  ZFP_ERROR_NULL(dparams);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  513|      1|  ZFP_ERROR_NULL(dparams->schunk);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   24|      1|      return 0;                 \
  |  |   25|      1|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  514|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  515|       |
  516|      0|  blosc2_schunk *sc = dparams->schunk;
  517|      0|  int32_t typesize = sc->typesize;
  518|      0|  int8_t ndim;
  519|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  520|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  521|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  522|      0|  uint8_t *smeta;
  523|      0|  int32_t smeta_len;
  524|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (524:7): [True: 0, False: 0]
  ------------------
  525|      0|    BLOSC_TRACE_ERROR("Cannot access b2nd meta info");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  526|      0|    free(shape);
  527|      0|    free(chunkshape);
  528|      0|    free(blockshape);
  529|      0|    return BLOSC2_ERROR_FAILURE;
  530|      0|  }
  531|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  532|      0|  free(smeta);
  533|       |
  534|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (534:7): [True: 0, False: 0]
  ------------------
  535|      0|    free(shape);
  536|      0|    free(chunkshape);
  537|      0|    free(blockshape);
  538|      0|    return BLOSC2_ERROR_FAILURE;
  539|      0|  }
  540|       |
  541|      0|  zfp_type type;     /* array scalar type */
  542|      0|  zfp_field *field;  /* array meta data */
  543|      0|  zfp_stream *zfp;   /* compressed stream */
  544|      0|  bitstream *stream; /* bit stream to write to or read from */
  545|      0|  size_t zfpsize;    /* byte size of compressed stream */
  546|       |
  547|      0|  uint prec;
  548|      0|  switch (ndim) {
  549|      0|    case 1:
  ------------------
  |  Branch (549:5): [True: 0, False: 0]
  ------------------
  550|      0|      prec = meta + 5;
  551|      0|      break;
  552|      0|    case 2:
  ------------------
  |  Branch (552:5): [True: 0, False: 0]
  ------------------
  553|      0|      prec = meta + 7;
  554|      0|      break;
  555|      0|    case 3:
  ------------------
  |  Branch (555:5): [True: 0, False: 0]
  ------------------
  556|      0|      prec = meta + 9;
  557|      0|      break;
  558|      0|    case 4:
  ------------------
  |  Branch (558:5): [True: 0, False: 0]
  ------------------
  559|      0|      prec = meta + 11;
  560|      0|      break;
  561|      0|    default:
  ------------------
  |  Branch (561:5): [True: 0, False: 0]
  ------------------
  562|      0|      free(shape);
  563|      0|      free(chunkshape);
  564|      0|      free(blockshape);
  565|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|      0|      return BLOSC2_ERROR_FAILURE;
  567|      0|  }
  568|       |
  569|      0|  if (prec > ZFP_MAX_PREC) {
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  |  Branch (569:7): [True: 0, False: 0]
  ------------------
  570|      0|    BLOSC_TRACE_ERROR("Max precision for this codecs is %d", ZFP_MAX_PREC);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  570|      0|    BLOSC_TRACE_ERROR("Max precision for this codecs is %d", ZFP_MAX_PREC);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  571|      0|    prec = ZFP_MAX_PREC;
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  572|      0|  }
  573|       |
  574|      0|  switch (typesize) {
  575|      0|    case sizeof(float):
  ------------------
  |  Branch (575:5): [True: 0, False: 0]
  ------------------
  576|      0|      type = zfp_type_float;
  577|      0|      break;
  578|      0|    case sizeof(double):
  ------------------
  |  Branch (578:5): [True: 0, False: 0]
  ------------------
  579|      0|      type = zfp_type_double;
  580|      0|      break;
  581|      0|    default:
  ------------------
  |  Branch (581:5): [True: 0, False: 0]
  ------------------
  582|      0|      free(shape);
  583|      0|      free(chunkshape);
  584|      0|      free(blockshape);
  585|      0|      BLOSC_TRACE_ERROR("ZFP is not available for typesize: %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  586|      0|      return BLOSC2_ERROR_FAILURE;
  587|      0|  }
  588|       |
  589|      0|  zfp = zfp_stream_open(NULL);
  590|      0|  zfp_stream_set_precision(zfp, prec);
  591|      0|  stream = stream_open((void *) input, input_len);
  592|      0|  zfp_stream_set_bit_stream(zfp, stream);
  593|      0|  zfp_stream_rewind(zfp);
  594|       |
  595|      0|  switch (ndim) {
  596|      0|    case 1:
  ------------------
  |  Branch (596:5): [True: 0, False: 0]
  ------------------
  597|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  598|      0|      break;
  599|      0|    case 2:
  ------------------
  |  Branch (599:5): [True: 0, False: 0]
  ------------------
  600|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  601|      0|      break;
  602|      0|    case 3:
  ------------------
  |  Branch (602:5): [True: 0, False: 0]
  ------------------
  603|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  604|      0|      break;
  605|      0|    case 4:
  ------------------
  |  Branch (605:5): [True: 0, False: 0]
  ------------------
  606|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  607|      0|      break;
  608|      0|    default:
  ------------------
  |  Branch (608:5): [True: 0, False: 0]
  ------------------
  609|      0|      free(shape);
  610|      0|      free(chunkshape);
  611|      0|      free(blockshape);
  612|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|      0|      return BLOSC2_ERROR_FAILURE;
  614|      0|  }
  615|       |
  616|      0|  zfpsize = zfp_decompress(zfp, field);
  617|       |
  618|       |  /* clean up */
  619|      0|  zfp_field_free(field);
  620|      0|  zfp_stream_close(zfp);
  621|      0|  stream_close(stream);
  622|      0|  free(shape);
  623|      0|  free(chunkshape);
  624|      0|  free(blockshape);
  625|       |
  626|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (626:7): [True: 0, False: 0]
  ------------------
  627|      0|    BLOSC_TRACE_ERROR("\n ZFP: Decompression failed\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|      0|    return (int) zfpsize;
  629|      0|  }
  630|       |
  631|      0|  return (int) output_len;
  632|      0|}
zfp_rate_decompress:
  796|      1|                        int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  797|      1|  ZFP_ERROR_NULL(input);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  798|      1|  ZFP_ERROR_NULL(output);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  799|      1|  ZFP_ERROR_NULL(dparams);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  800|      1|  ZFP_ERROR_NULL(dparams->schunk);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   24|      1|      return 0;                 \
  |  |   25|      1|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  801|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  802|       |
  803|      0|  blosc2_schunk *sc = dparams->schunk;
  804|      0|  int32_t typesize = sc->typesize;
  805|       |
  806|      0|  double ratio = (double) meta / 100.0;
  807|      0|  int8_t ndim;
  808|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  809|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  810|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  811|      0|  uint8_t *smeta;
  812|      0|  int32_t smeta_len;
  813|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (813:7): [True: 0, False: 0]
  ------------------
  814|      0|    BLOSC_TRACE_ERROR("Cannot access b2nd meta info");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|      0|    free(shape);
  816|      0|    free(chunkshape);
  817|      0|    free(blockshape);
  818|      0|    return BLOSC2_ERROR_FAILURE;
  819|      0|  }
  820|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  821|      0|  free(smeta);
  822|       |
  823|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (823:7): [True: 0, False: 0]
  ------------------
  824|      0|    free(shape);
  825|      0|    free(chunkshape);
  826|      0|    free(blockshape);
  827|      0|    return BLOSC2_ERROR_FAILURE;
  828|      0|  }
  829|       |
  830|      0|  zfp_type type;     /* array scalar type */
  831|      0|  zfp_field *field;  /* array meta data */
  832|      0|  zfp_stream *zfp;   /* compressed stream */
  833|      0|  bitstream *stream; /* bit stream to write to or read from */
  834|      0|  size_t zfpsize;    /* byte size of compressed stream */
  835|       |
  836|      0|  switch (typesize) {
  837|      0|    case sizeof(float):
  ------------------
  |  Branch (837:5): [True: 0, False: 0]
  ------------------
  838|      0|      type = zfp_type_float;
  839|      0|      break;
  840|      0|    case sizeof(double):
  ------------------
  |  Branch (840:5): [True: 0, False: 0]
  ------------------
  841|      0|      type = zfp_type_double;
  842|      0|      break;
  843|      0|    default:
  ------------------
  |  Branch (843:5): [True: 0, False: 0]
  ------------------
  844|      0|      free(shape);
  845|      0|      free(chunkshape);
  846|      0|      free(blockshape);
  847|      0|      BLOSC_TRACE_ERROR("ZFP is not available for typesize: %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  848|      0|      return BLOSC2_ERROR_FAILURE;
  849|      0|  }
  850|      0|  double rate =
  851|      0|      ratio * (double) typesize * 8;     // convert from output size / input size to output bits per input value
  852|      0|  zfp = zfp_stream_open(NULL);
  853|      0|  zfp_stream_set_rate(zfp, rate, type, ndim, zfp_false);
  854|       |
  855|      0|  stream = stream_open((void *) input, input_len);
  856|      0|  zfp_stream_set_bit_stream(zfp, stream);
  857|      0|  zfp_stream_rewind(zfp);
  858|       |
  859|      0|  switch (ndim) {
  860|      0|    case 1:
  ------------------
  |  Branch (860:5): [True: 0, False: 0]
  ------------------
  861|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  862|      0|      break;
  863|      0|    case 2:
  ------------------
  |  Branch (863:5): [True: 0, False: 0]
  ------------------
  864|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  865|      0|      break;
  866|      0|    case 3:
  ------------------
  |  Branch (866:5): [True: 0, False: 0]
  ------------------
  867|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  868|      0|      break;
  869|      0|    case 4:
  ------------------
  |  Branch (869:5): [True: 0, False: 0]
  ------------------
  870|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  871|      0|      break;
  872|      0|    default:
  ------------------
  |  Branch (872:5): [True: 0, False: 0]
  ------------------
  873|      0|      free(shape);
  874|      0|      free(chunkshape);
  875|      0|      free(blockshape);
  876|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|      0|      return BLOSC2_ERROR_FAILURE;
  878|      0|  }
  879|       |
  880|      0|  zfpsize = zfp_decompress(zfp, field);
  881|       |
  882|       |  /* clean up */
  883|      0|  zfp_field_free(field);
  884|      0|  zfp_stream_close(zfp);
  885|      0|  stream_close(stream);
  886|      0|  free(shape);
  887|      0|  free(chunkshape);
  888|      0|  free(blockshape);
  889|       |
  890|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (890:7): [True: 0, False: 0]
  ------------------
  891|      0|    BLOSC_TRACE_ERROR("\n ZFP: Decompression failed\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  892|      0|    return (int) zfpsize;
  893|      0|  }
  894|       |
  895|      0|  return (int) output_len;
  896|      0|}

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

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

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

ndcell_backward:
  205|      8|                   uint8_t id) {
  206|      8|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      8|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  207|      8|  blosc2_schunk *schunk = dparams->schunk;
  208|      8|  int8_t ndim;
  209|      8|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      8|#define B2ND_MAX_DIM 16
  ------------------
  210|      8|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      8|#define B2ND_MAX_DIM 16
  ------------------
  211|      8|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      8|#define B2ND_MAX_DIM 16
  ------------------
  212|      8|  uint8_t *smeta;
  213|      8|  int32_t smeta_len;
  214|      8|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (214:7): [True: 8, False: 0]
  ------------------
  215|      8|    free(shape);
  216|      8|    free(chunkshape);
  217|      8|    free(blockshape);
  218|      8|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|      8|    return BLOSC2_ERROR_FAILURE;
  220|      8|  }
  221|      0|  if (b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL) < 0) {
  ------------------
  |  Branch (221:7): [True: 0, False: 0]
  ------------------
  222|      0|    free(smeta);
  223|      0|    free(shape);
  224|      0|    free(chunkshape);
  225|      0|    free(blockshape);
  226|      0|    return BLOSC2_ERROR_FAILURE;
  227|      0|  }
  228|      0|  free(smeta);
  229|      0|  if (ndim <= 0 || ndim > NDCELL_MAX_DIM) {
  ------------------
  |  |   16|      0|#define NDCELL_MAX_DIM 8
  ------------------
  |  Branch (229:7): [True: 0, False: 0]
  |  Branch (229:20): [True: 0, False: 0]
  ------------------
  230|      0|    free(shape);
  231|      0|    free(chunkshape);
  232|      0|    free(blockshape);
  233|      0|    BLOSC_TRACE_ERROR("ndim %d is out of range", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|      0|    return BLOSC2_ERROR_FAILURE;
  235|      0|  }
  236|       |
  237|       |  // `meta` is attacker-controlled in a crafted frame.  Interpret it as unsigned
  238|       |  // and reject 0: an (int8_t) cast would turn 128..255 into negative values and
  239|       |  // 0 would later divide by zero in `(blockshape[i] + cell_shape - 1) / cell_shape`.
  240|      0|  int cell_shape = (int) meta;
  241|      0|  if (cell_shape <= 0) {
  ------------------
  |  Branch (241:7): [True: 0, False: 0]
  ------------------
  242|      0|    free(shape);
  243|      0|    free(chunkshape);
  244|      0|    free(blockshape);
  245|      0|    BLOSC_TRACE_ERROR("Invalid cell_shape %d", cell_shape);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|      0|    return BLOSC2_ERROR_FAILURE;
  247|      0|  }
  248|       |  // See ndcell_forward(): compute cell_shape^ndim with checked 64-bit
  249|       |  // multiplication so an overflowing (int) pow() cannot bypass the
  250|       |  // "buffer smaller than cell" check below.
  251|      0|  int64_t cell_size = 1;
  252|      0|  for (int i = 0; i < ndim; i++) {
  ------------------
  |  Branch (252:19): [True: 0, False: 0]
  ------------------
  253|      0|    if (cell_size > INT64_MAX / cell_shape) {
  ------------------
  |  Branch (253:9): [True: 0, False: 0]
  ------------------
  254|      0|      free(shape);
  255|      0|      free(chunkshape);
  256|      0|      free(blockshape);
  257|      0|      BLOSC_TRACE_ERROR("cell_shape %d too large for ndim %d", cell_shape, ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  258|      0|      return BLOSC2_ERROR_FAILURE;
  259|      0|    }
  260|      0|    cell_size *= cell_shape;
  261|      0|  }
  262|      0|  int32_t typesize = schunk->typesize;
  263|      0|  uint8_t *ip = (uint8_t *) input;
  264|      0|  uint8_t *ip_limit = ip + length;
  265|      0|  uint8_t *op = (uint8_t *) output;
  266|      0|  if (typesize <= 0) {
  ------------------
  |  Branch (266:7): [True: 0, False: 0]
  ------------------
  267|      0|    free(shape);
  268|      0|    free(chunkshape);
  269|      0|    free(blockshape);
  270|      0|    BLOSC_TRACE_ERROR("Invalid typesize %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|      0|    return BLOSC2_ERROR_FAILURE;
  272|      0|  }
  273|       |  // The block geometry (blockshape) comes from the attacker-controlled "b2nd"
  274|       |  // metalayer and is NOT validated by b2nd_deserialize_meta().  Compute the
  275|       |  // block size in 64-bit and reject non-positive dimensions.  Otherwise a
  276|       |  // crafted blockshape whose 32-bit product wraps back onto `length` would pass
  277|       |  // the check below, while the scatter-write index arithmetic further down uses
  278|       |  // the true (huge) dimensions, writing past the `length`-sized output buffer
  279|       |  // (heap overflow).  Bailing as soon as the running product exceeds `length`
  280|       |  // also keeps the 64-bit multiply from overflowing (it stays
  281|       |  // <= length * INT32_MAX < INT64_MAX).
  282|      0|  int64_t blocksize = (int64_t) typesize;
  283|      0|  for (int i = 0; i < ndim; i++) {
  ------------------
  |  Branch (283:19): [True: 0, False: 0]
  ------------------
  284|      0|    if (blockshape[i] <= 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 0]
  ------------------
  285|      0|      free(shape);
  286|      0|      free(chunkshape);
  287|      0|      free(blockshape);
  288|      0|      BLOSC_TRACE_ERROR("Invalid blockshape[%d] = %d", i, blockshape[i]);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|      0|      return BLOSC2_ERROR_FAILURE;
  290|      0|    }
  291|      0|    blocksize *= blockshape[i];
  292|      0|    if (blocksize > (int64_t) length) {
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  ------------------
  293|      0|      free(shape);
  294|      0|      free(chunkshape);
  295|      0|      free(blockshape);
  296|      0|      BLOSC_TRACE_ERROR("blockshape too large for block of %d bytes", length);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  297|      0|      return BLOSC2_ERROR_FAILURE;
  298|      0|    }
  299|      0|  }
  300|       |
  301|      0|  if ((int64_t) length != blocksize) {
  ------------------
  |  Branch (301:7): [True: 0, False: 0]
  ------------------
  302|      0|    free(shape);
  303|      0|    free(chunkshape);
  304|      0|    free(blockshape);
  305|      0|    BLOSC_TRACE_ERROR("Length not equal to blocksize %d %lld", length, (long long) blocksize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|      0|    return BLOSC2_ERROR_FAILURE;
  307|      0|  }
  308|       |
  309|       |  // length is a multiple of typesize here (length == blocksize, checked above),
  310|       |  // so the division is exact; phrasing the check this way avoids overflowing the
  311|       |  // cell_size * typesize product.
  312|      0|  if (cell_size > (int64_t) length / typesize) {
  ------------------
  |  Branch (312:7): [True: 0, False: 0]
  ------------------
  313|      0|    free(shape);
  314|      0|    free(chunkshape);
  315|      0|    free(blockshape);
  316|      0|    BLOSC_TRACE_ERROR("input and output buffer cannot be smaller than cell size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|      0|    return BLOSC2_ERROR_FAILURE;
  318|      0|  }
  319|       |
  320|      0|  int64_t i_shape[NDCELL_MAX_DIM];
  321|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (321:19): [True: 0, False: 0]
  ------------------
  322|      0|    i_shape[i] = (blockshape[i] + cell_shape - 1) / cell_shape;
  323|      0|  }
  324|       |
  325|      0|  int64_t ncells = 1;
  326|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (326:19): [True: 0, False: 0]
  ------------------
  327|      0|    ncells *= i_shape[i];
  328|      0|  }
  329|       |
  330|       |  /* main loop */
  331|      0|  int64_t pad_shape[NDCELL_MAX_DIM] = {0};
  332|      0|  int64_t ii[NDCELL_MAX_DIM];
  333|      0|  int32_t ind = 0;
  334|      0|  for (int cell_ind = 0; cell_ind < ncells; cell_ind++) {      // for each cell
  ------------------
  |  Branch (334:26): [True: 0, False: 0]
  ------------------
  335|       |
  336|      0|    if (ip > ip_limit) {
  ------------------
  |  Branch (336:9): [True: 0, False: 0]
  ------------------
  337|      0|      free(shape);
  338|      0|      free(chunkshape);
  339|      0|      free(blockshape);
  340|      0|      BLOSC_TRACE_ERROR("Exceeding input length!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  341|      0|      return BLOSC2_ERROR_FAILURE;
  342|      0|    }
  343|      0|    blosc2_unidim_to_multidim(ndim, i_shape, cell_ind, ii);
  344|      0|    uint32_t orig = 0;
  345|      0|    int64_t nd_aux = (int64_t) cell_shape;
  346|      0|    for (int i = ndim - 1; i >= 0; i--) {
  ------------------
  |  Branch (346:28): [True: 0, False: 0]
  ------------------
  347|      0|      orig += ii[i] * nd_aux;
  348|      0|      nd_aux *= blockshape[i];
  349|      0|    }
  350|       |
  351|      0|    for (int dim_ind = 0; dim_ind < ndim; dim_ind++) {
  ------------------
  |  Branch (351:27): [True: 0, False: 0]
  ------------------
  352|      0|      if ((blockshape[dim_ind] % cell_shape != 0) && (ii[dim_ind] == i_shape[dim_ind] - 1)) {
  ------------------
  |  Branch (352:11): [True: 0, False: 0]
  |  Branch (352:54): [True: 0, False: 0]
  ------------------
  353|      0|        pad_shape[dim_ind] = blockshape[dim_ind] % cell_shape;
  354|      0|      } else {
  355|      0|        pad_shape[dim_ind] = (int64_t) cell_shape;
  356|      0|      }
  357|      0|    }
  358|       |
  359|      0|    int64_t ncopies = 1;
  360|      0|    for (int i = 0; i < ndim - 1; ++i) {
  ------------------
  |  Branch (360:21): [True: 0, False: 0]
  ------------------
  361|      0|      ncopies *= pad_shape[i];
  362|      0|    }
  363|      0|    int64_t kk[NDCELL_MAX_DIM];
  364|      0|    for (int copy_ind = 0; copy_ind < ncopies; ++copy_ind) {
  ------------------
  |  Branch (364:28): [True: 0, False: 0]
  ------------------
  365|      0|      blosc2_unidim_to_multidim(ndim - 1, pad_shape, copy_ind, kk);
  366|      0|      nd_aux = blockshape[ndim - 1];
  367|      0|      ind = (int32_t) orig;
  368|      0|      for (int i = ndim - 2; i >= 0; i--) {
  ------------------
  |  Branch (368:30): [True: 0, False: 0]
  ------------------
  369|      0|        ind += (int32_t) (kk[i] * nd_aux);
  370|      0|        nd_aux *= blockshape[i];
  371|      0|      }
  372|      0|      memcpy(&op[ind * typesize], ip, pad_shape[ndim - 1] * typesize);
  373|      0|      ip += pad_shape[ndim - 1] * typesize;
  374|      0|    }
  375|      0|  }
  376|      0|  ind += (int32_t) pad_shape[ndim - 1];
  377|       |
  378|       |
  379|      0|  if (ind != (int32_t) (blocksize / typesize)) {
  ------------------
  |  Branch (379:7): [True: 0, False: 0]
  ------------------
  380|      0|    free(shape);
  381|      0|    free(chunkshape);
  382|      0|    free(blockshape);
  383|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape ind %d %lld \n",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  384|      0|                      ind, (long long) (blocksize / typesize));
  385|      0|    return BLOSC2_ERROR_FAILURE;
  386|      0|  }
  387|       |
  388|      0|  free(shape);
  389|      0|  free(chunkshape);
  390|      0|  free(blockshape);
  391|       |
  392|      0|  return BLOSC2_ERROR_SUCCESS;
  393|      0|}

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

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

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

