LZ4_decompress_safe:
 2452|    327|{
 2453|    327|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2454|    327|                                  decode_full_block, noDict,
 2455|       |                                  (BYTE*)dest, NULL, 0);
 2456|    327|}
LZ4_decompress_safe_forceExtDict:
 2526|    318|{
 2527|    318|    DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict");
  ------------------
  |  |  289|    318|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2528|    318|    return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
 2529|    318|                                  decode_full_block, usingExtDict,
 2530|    318|                                  (BYTE*)dest, (const BYTE*)dictStart, dictSize);
 2531|    318|}
LZ4_decompress_safe_usingDict:
 2720|    318|{
 2721|    318|    if (dictSize==0)
  ------------------
  |  Branch (2721:9): [True: 0, False: 318]
  ------------------
 2722|      0|        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
 2723|    318|    if (dictStart+dictSize == dest) {
  ------------------
  |  Branch (2723:9): [True: 0, False: 318]
  ------------------
 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|    318|    assert(dictSize >= 0);
  ------------------
  |  |  273|    318|#    define assert(condition) ((void)0)
  ------------------
 2731|    318|    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
 2732|    318|}
lz4.c:LZ4_wildCopy8:
  466|  5.70k|{
  467|  5.70k|    BYTE* d = (BYTE*)dstPtr;
  468|  5.70k|    const BYTE* s = (const BYTE*)srcPtr;
  469|  5.70k|    BYTE* const e = (BYTE*)dstEnd;
  470|       |
  471|  1.24M|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  349|  1.24M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (471:50): [True: 1.23M, False: 5.70k]
  ------------------
  472|  5.70k|}
lz4.c:LZ4_isLittleEndian:
  364|  63.2k|{
  365|  63.2k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  366|  63.2k|    return one.c[0];
  367|  63.2k|}
lz4.c:LZ4_read16:
  393|  63.2k|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  398|  4.85k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2035|    645|{
 2036|    645|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2036:9): [True: 0, False: 645]
  |  Branch (2036:26): [True: 0, False: 645]
  ------------------
 2037|       |
 2038|    645|    {   const BYTE* ip = (const BYTE*) src;
 2039|    645|        const BYTE* const iend = ip + srcSize;
 2040|       |
 2041|    645|        BYTE* op = (BYTE*) dst;
 2042|    645|        BYTE* const oend = op + outputSize;
 2043|    645|        BYTE* cpy;
 2044|       |
 2045|    645|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2045:37): [True: 327, False: 318]
  ------------------
 2046|       |
 2047|    645|        const int checkOffset = (dictSize < (int)(64 KB));
  ------------------
  |  |  251|    645|#define KB *(1 <<10)
  ------------------
 2048|       |
 2049|       |
 2050|       |        /* Set up the "end" pointers for the shortcut. */
 2051|    645|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2052|    645|        const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/;
 2053|       |
 2054|    645|        const BYTE* match;
 2055|    645|        size_t offset;
 2056|    645|        unsigned token;
 2057|    645|        size_t length;
 2058|       |
 2059|       |
 2060|    645|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  289|    645|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2061|       |
 2062|       |        /* Special cases */
 2063|    645|        assert(lowPrefix <= op);
  ------------------
  |  |  273|    645|#    define assert(condition) ((void)0)
  ------------------
 2064|    645|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|    645|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    645|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 645]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    645|        if (unlikely(srcSize==0)) { return -1; }
  ------------------
  |  |  180|    645|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    645|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 645]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    645|#if LZ4_FAST_DEC_LOOP
 2076|    645|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|    645|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2076:13): [True: 2, False: 643]
  ------------------
 2077|      2|            DEBUGLOG(6, "move to safe decode loop");
  ------------------
  |  |  289|      2|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2078|      2|            goto safe_decode;
 2079|      2|        }
 2080|       |
 2081|       |        /* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE */
 2082|    643|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  289|    643|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2083|  62.8k|        while (1) {
  ------------------
  |  Branch (2083:16): [True: 62.8k, Folded]
  ------------------
 2084|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2085|  62.8k|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|  62.8k|#    define assert(condition) ((void)0)
  ------------------
 2086|  62.8k|            assert(ip < iend);
  ------------------
  |  |  273|  62.8k|#    define assert(condition) ((void)0)
  ------------------
 2087|  62.8k|            token = *ip++;
 2088|  62.8k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|  62.8k|#define ML_BITS  4
  ------------------
 2089|  62.8k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|  62.8k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2090|       |
 2091|       |            /* decode literal length */
 2092|  62.8k|            if (length == RUN_MASK) {
  ------------------
  |  |  263|  62.8k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  62.8k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  62.8k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2092:17): [True: 1.71k, False: 61.1k]
  ------------------
 2093|  1.71k|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|  1.71k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  1.71k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  1.71k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2094|  1.71k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2094:21): [True: 5, False: 1.71k]
  ------------------
 2095|      5|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  289|      5|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2096|      5|                    goto _output_error;
 2097|      5|                }
 2098|  1.71k|                length += addl;
 2099|  1.71k|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  1.71k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.71k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2100|  1.71k|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  1.71k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.71k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2101|       |
 2102|       |                /* copy literals */
 2103|  1.71k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  1.71k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2104|  1.71k|                if ((op+length>oend-32) || (ip+length>iend-32)) { goto safe_literal_copy; }
  ------------------
  |  Branch (2104:21): [True: 9, False: 1.70k]
  |  Branch (2104:44): [True: 278, False: 1.42k]
  ------------------
 2105|  1.42k|                LZ4_wildCopy32(op, ip, op+length);
 2106|  1.42k|                ip += length; op += length;
 2107|  61.1k|            } else if (ip <= iend-(16 + 1/*max lit + offset + nextToken*/)) {
  ------------------
  |  Branch (2107:24): [True: 61.1k, False: 41]
  ------------------
 2108|       |                /* We don't need to check oend, since we check it once for each loop below */
 2109|  61.1k|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)length);
  ------------------
  |  |  289|  61.1k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2110|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2111|  61.1k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|  61.1k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2112|  61.1k|                ip += length; op += length;
 2113|  61.1k|            } else {
 2114|     41|                goto safe_literal_copy;
 2115|     41|            }
 2116|       |
 2117|       |            /* get offset */
 2118|  62.5k|            offset = LZ4_readLE16(ip); ip+=2;
 2119|  62.5k|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  289|  62.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2120|  62.5k|            match = op - offset;
 2121|  62.5k|            assert(match <= op);  /* overflow check */
  ------------------
  |  |  273|  62.5k|#    define assert(condition) ((void)0)
  ------------------
 2122|       |
 2123|       |            /* get matchlength */
 2124|  62.5k|            length = token & ML_MASK;
  ------------------
  |  |  261|  62.5k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  62.5k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2125|  62.5k|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)length, (unsigned)length+MINMATCH);
  ------------------
  |  |  289|  62.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2126|       |
 2127|  62.5k|            if (length == ML_MASK) {
  ------------------
  |  |  261|  62.5k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  62.5k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2127:17): [True: 47.4k, False: 15.0k]
  ------------------
 2128|  47.4k|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|  47.4k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2129|  47.4k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2129:21): [True: 8, False: 47.4k]
  ------------------
 2130|      8|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  289|      8|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2131|      8|                    goto _output_error;
 2132|      8|                }
 2133|  47.4k|                length += addl;
 2134|  47.4k|                length += MINMATCH;
  ------------------
  |  |  242|  47.4k|#define MINMATCH 4
  ------------------
 2135|  47.4k|                DEBUGLOG(7, "  long match length == %u", (unsigned)length);
  ------------------
  |  |  289|  47.4k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2136|  47.4k|                if (unlikely((uptrval)(op)+length<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  47.4k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  47.4k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 47.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2137|  47.4k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  47.4k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2137:21): [True: 185, False: 47.2k]
  ------------------
 2138|    185|                    goto safe_match_copy;
 2139|    185|                }
 2140|  47.4k|            } else {
 2141|  15.0k|                length += MINMATCH;
  ------------------
  |  |  242|  15.0k|#define MINMATCH 4
  ------------------
 2142|  15.0k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  15.0k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2142:21): [True: 24, False: 15.0k]
  ------------------
 2143|     24|                    DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)length);
  ------------------
  |  |  289|     24|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2144|     24|                    goto safe_match_copy;
 2145|     24|                }
 2146|       |
 2147|       |                /* Fastpath check: skip LZ4_wildCopy32 when true */
 2148|  15.0k|                if ((dict == withPrefix64k) || (match >= lowPrefix)) {
  ------------------
  |  Branch (2148:21): [True: 0, False: 15.0k]
  |  Branch (2148:48): [True: 14.6k, False: 443]
  ------------------
 2149|  14.6k|                    if (offset >= 8) {
  ------------------
  |  Branch (2149:25): [True: 8.63k, False: 5.99k]
  ------------------
 2150|  8.63k|                        assert(match >= lowPrefix);
  ------------------
  |  |  273|  8.63k|#    define assert(condition) ((void)0)
  ------------------
 2151|  8.63k|                        assert(match <= op);
  ------------------
  |  |  273|  8.63k|#    define assert(condition) ((void)0)
  ------------------
 2152|  8.63k|                        assert(op + 18 <= oend);
  ------------------
  |  |  273|  8.63k|#    define assert(condition) ((void)0)
  ------------------
 2153|       |
 2154|  8.63k|                        LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  8.63k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2155|  8.63k|                        LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  349|  8.63k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2156|  8.63k|                        LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  349|  8.63k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2157|  8.63k|                        op += length;
 2158|  8.63k|                        continue;
 2159|  8.63k|            }   }   }
 2160|       |
 2161|  53.6k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|  53.6k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  53.6k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2161:18): [True: 53.6k, False: 0]
  |  Branch (2161:33): [True: 93, False: 53.6k]
  ------------------
 2162|     93|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  289|     93|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2163|     93|                goto _output_error;
 2164|     93|            }
 2165|       |            /* match starting within external dictionary */
 2166|  53.6k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2166:17): [True: 21.8k, False: 31.7k]
  |  Branch (2166:41): [True: 757, False: 21.0k]
  ------------------
 2167|    757|                assert(dictEnd != NULL);
  ------------------
  |  |  273|    757|#    define assert(condition) ((void)0)
  ------------------
 2168|    757|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|    757|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    757|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 757]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    757|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2177:21): [True: 631, False: 126]
  ------------------
 2178|       |                    /* match fits entirely within external dictionary : just copy */
 2179|    631|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|    631|#    define LZ4_memmove __builtin_memmove
  ------------------
 2180|    631|                    op += length;
 2181|    631|                } else {
 2182|       |                    /* match stretches into both external dictionary and current block */
 2183|    126|                    size_t const copySize = (size_t)(lowPrefix - match);
 2184|    126|                    size_t const restSize = length - copySize;
 2185|    126|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|    126|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2186|    126|                    op += copySize;
 2187|    126|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2187:25): [True: 99, False: 27]
  ------------------
 2188|     99|                        BYTE* const endOfMatch = op + restSize;
 2189|     99|                        const BYTE* copyFrom = lowPrefix;
 2190|  3.32M|                        while (op < endOfMatch) { *op++ = *copyFrom++; }
  ------------------
  |  Branch (2190:32): [True: 3.32M, False: 99]
  ------------------
 2191|     99|                    } else {
 2192|     27|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|     27|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2193|     27|                        op += restSize;
 2194|     27|                }   }
 2195|    757|                continue;
 2196|    757|            }
 2197|       |
 2198|       |            /* copy match within block */
 2199|  52.8k|            cpy = op + length;
 2200|       |
 2201|  52.8k|            assert((op <= oend) && (oend-op >= 32));
  ------------------
  |  |  273|  52.8k|#    define assert(condition) ((void)0)
  ------------------
 2202|  52.8k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|  52.8k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  52.8k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 38.6k, False: 14.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|  38.6k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2204|  38.6k|            } else {
 2205|  14.2k|                LZ4_wildCopy32(op, match, cpy);
 2206|  14.2k|            }
 2207|       |
 2208|  52.8k|            op = cpy;   /* wildcopy correction */
 2209|  52.8k|        }
 2210|      2|    safe_decode:
 2211|      2|#endif
 2212|       |
 2213|       |        /* Main Loop : decode remaining sequences where output < FASTLOOP_SAFE_DISTANCE */
 2214|      2|        DEBUGLOG(6, "using safe decode loop");
  ------------------
  |  |  289|      2|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2215|    819|        while (1) {
  ------------------
  |  Branch (2215:16): [True: 819, Folded]
  ------------------
 2216|    819|            assert(ip < iend);
  ------------------
  |  |  273|    819|#    define assert(condition) ((void)0)
  ------------------
 2217|    819|            token = *ip++;
 2218|    819|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|    819|#define ML_BITS  4
  ------------------
 2219|    819|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|    819|#  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|    819|            if ( (length != RUN_MASK)
  ------------------
  |  |  263|    819|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    819|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    819|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2230:18): [True: 683, False: 136]
  ------------------
 2231|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2232|    683|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|    683|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|    683|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 280, False: 403]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|       |                /* Copy the literals */
 2234|    280|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|    280|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2235|    280|                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|    280|                length = token & ML_MASK; /* match length */
  ------------------
  |  |  261|    280|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    280|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2240|    280|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)length, (unsigned)length + 4);
  ------------------
  |  |  289|    280|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2241|    280|                offset = LZ4_readLE16(ip); ip += 2;
 2242|    280|                match = op - offset;
 2243|    280|                assert(match <= op); /* check overflow */
  ------------------
  |  |  273|    280|#    define assert(condition) ((void)0)
  ------------------
 2244|       |
 2245|       |                /* Do not deal with overlapping matches. */
 2246|    280|                if ( (length != ML_MASK)
  ------------------
  |  |  261|    280|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    280|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2246:22): [True: 213, False: 67]
  ------------------
 2247|    213|                  && (offset >= 8)
  ------------------
  |  Branch (2247:22): [True: 125, False: 88]
  ------------------
 2248|    125|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2248:23): [True: 0, False: 125]
  |  Branch (2248:46): [True: 84, False: 41]
  ------------------
 2249|       |                    /* Copy the match. */
 2250|     84|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  349|     84|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2251|     84|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  349|     84|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2252|     84|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  349|     84|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2253|     84|                    op += length + MINMATCH;
  ------------------
  |  |  242|     84|#define MINMATCH 4
  ------------------
 2254|       |                    /* Both stages worked, load the next token. */
 2255|     84|                    continue;
 2256|     84|                }
 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|    196|                goto _copy_match;
 2261|    280|            }
 2262|       |
 2263|       |            /* decode literal length */
 2264|    539|            if (length == RUN_MASK) {
  ------------------
  |  |  263|    539|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    539|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    539|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2264:17): [True: 136, False: 403]
  ------------------
 2265|    136|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|    136|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    136|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    136|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2266|    136|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2266:21): [True: 17, False: 119]
  ------------------
 2267|    119|                length += addl;
 2268|    119|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    119|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    119|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 119]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2269|    119|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    119|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    119|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 119]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2270|    119|            }
 2271|       |
 2272|    522|#if LZ4_FAST_DEC_LOOP
 2273|    850|        safe_literal_copy:
 2274|    850|#endif
 2275|       |            /* copy literals */
 2276|    850|            cpy = op+length;
 2277|       |
 2278|    850|            LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|    850|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2279|    850|            if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  246|    850|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                          if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|    645|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2279:17): [True: 205, False: 645]
  |  Branch (2279:39): [True: 207, False: 438]
  ------------------
 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|    412|                if (partialDecoding) {
  ------------------
  |  Branch (2285:21): [True: 0, False: 412]
  ------------------
 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|    412|                } 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|    412|                    if ((ip+length != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2312:25): [True: 278, False: 134]
  |  Branch (2312:48): [True: 2, False: 132]
  ------------------
 2313|    280|                        DEBUGLOG(5, "should have been last run of literals")
  ------------------
  |  |  289|    280|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2314|    280|                        DEBUGLOG(5, "ip(%p) + length(%i) = %p != iend (%p)", ip, (int)length, ip+length, iend);
  ------------------
  |  |  289|    280|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2315|    280|                        DEBUGLOG(5, "or cpy(%p) > (oend-MFLIMIT)(%p)", cpy, oend-MFLIMIT);
  ------------------
  |  |  289|    280|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2316|    280|                        DEBUGLOG(5, "after writing %u bytes / %i bytes available", (unsigned)(op-(BYTE*)dst), outputSize);
  ------------------
  |  |  289|    280|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2317|    280|                        goto _output_error;
 2318|    280|                    }
 2319|    412|                }
 2320|    132|                LZ4_memmove(op, ip, length);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  357|    132|#    define LZ4_memmove __builtin_memmove
  ------------------
 2321|    132|                ip += length;
 2322|    132|                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|    132|                if (!partialDecoding || (cpy == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2328:21): [True: 132, False: 0]
  |  Branch (2328:41): [True: 0, False: 0]
  |  Branch (2328:58): [True: 0, False: 0]
  ------------------
 2329|    132|                    break;
 2330|    132|                }
 2331|    438|            } else {
 2332|    438|                LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2333|    438|                ip += length; op = cpy;
 2334|    438|            }
 2335|       |
 2336|       |            /* get offset */
 2337|    438|            offset = LZ4_readLE16(ip); ip+=2;
 2338|    438|            match = op - offset;
 2339|       |
 2340|       |            /* get matchlength */
 2341|    438|            length = token & ML_MASK;
  ------------------
  |  |  261|    438|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    438|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2342|    438|            DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|    438|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2343|       |
 2344|    634|    _copy_match:
 2345|    634|            if (length == ML_MASK) {
  ------------------
  |  |  261|    634|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    634|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2345:17): [True: 330, False: 304]
  ------------------
 2346|    330|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|    330|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2347|    330|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2347:21): [True: 8, False: 322]
  ------------------
 2348|    322|                length += addl;
 2349|    322|                if (unlikely((uptrval)(op)+length<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|    322|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    322|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 322]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2350|    322|            }
 2351|    626|            length += MINMATCH;
  ------------------
  |  |  242|    626|#define MINMATCH 4
  ------------------
 2352|       |
 2353|    626|#if LZ4_FAST_DEC_LOOP
 2354|    835|        safe_match_copy:
 2355|    835|#endif
 2356|    835|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|    835|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    835|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2356:17): [True: 835, False: 0]
  |  Branch (2356:34): [True: 76, False: 759]
  ------------------
 2357|       |            /* match starting within external dictionary */
 2358|    759|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2358:17): [True: 397, False: 362]
  |  Branch (2358:41): [True: 62, False: 335]
  ------------------
 2359|     62|                assert(dictEnd != NULL);
  ------------------
  |  |  273|     62|#    define assert(condition) ((void)0)
  ------------------
 2360|     62|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|     62|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|     62|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 2, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|     60|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2365:21): [True: 29, False: 31]
  ------------------
 2366|       |                    /* match fits entirely within external dictionary : just copy */
 2367|     29|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|     29|#    define LZ4_memmove __builtin_memmove
  ------------------
 2368|     29|                    op += length;
 2369|     31|                } else {
 2370|       |                    /* match stretches into both external dictionary and current block */
 2371|     31|                    size_t const copySize = (size_t)(lowPrefix - match);
 2372|     31|                    size_t const restSize = length - copySize;
 2373|     31|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|     31|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2374|     31|                    op += copySize;
 2375|     31|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2375:25): [True: 25, False: 6]
  ------------------
 2376|     25|                        BYTE* const endOfMatch = op + restSize;
 2377|     25|                        const BYTE* copyFrom = lowPrefix;
 2378|  88.5k|                        while (op < endOfMatch) *op++ = *copyFrom++;
  ------------------
  |  Branch (2378:32): [True: 88.4k, False: 25]
  ------------------
 2379|     25|                    } else {
 2380|      6|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|      6|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2381|      6|                        op += restSize;
 2382|      6|                }   }
 2383|     60|                continue;
 2384|     62|            }
 2385|    697|            assert(match >= lowPrefix);
  ------------------
  |  |  273|    697|#    define assert(condition) ((void)0)
  ------------------
 2386|       |
 2387|       |            /* copy match within block */
 2388|    697|            cpy = op + length;
 2389|       |
 2390|       |            /* partialDecoding : may end anywhere within the block */
 2391|    697|            assert(op<=oend);
  ------------------
  |  |  273|    697|#    define assert(condition) ((void)0)
  ------------------
 2392|    697|            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: 697]
  |  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|    697|            if (unlikely(offset<8)) {
  ------------------
  |  |  180|    697|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    697|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 415, False: 282]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2407|    415|                LZ4_write32(op, 0);   /* silence msan warning when offset==0 */
 2408|    415|                op[0] = match[0];
 2409|    415|                op[1] = match[1];
 2410|    415|                op[2] = match[2];
 2411|    415|                op[3] = match[3];
 2412|    415|                match += inc32table[offset];
 2413|    415|                LZ4_memcpy(op+4, match, 4);
  ------------------
  |  |  349|    415|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2414|    415|                match -= dec64table[offset];
 2415|    415|            } else {
 2416|    282|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    282|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2417|    282|                match += 8;
 2418|    282|            }
 2419|    697|            op += 8;
 2420|       |
 2421|    697|            if (unlikely(cpy > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|    697|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    697|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 195, False: 502]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2422|    195|                BYTE* const oCopyLimit = oend - (WILDCOPYLENGTH-1);
  ------------------
  |  |  244|    195|#define WILDCOPYLENGTH 8
  ------------------
 2423|    195|                if (cpy > oend-LASTLITERALS) { goto _output_error; } /* Error : last LASTLITERALS bytes must be literals (uncompressed) */
  ------------------
  |  |  245|    195|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2423:21): [True: 24, False: 171]
  ------------------
 2424|    171|                if (op < oCopyLimit) {
  ------------------
  |  Branch (2424:21): [True: 166, False: 5]
  ------------------
 2425|    166|                    LZ4_wildCopy8(op, match, oCopyLimit);
 2426|    166|                    match += oCopyLimit - op;
 2427|    166|                    op = oCopyLimit;
 2428|    166|                }
 2429|    434|                while (op < cpy) { *op++ = *match++; }
  ------------------
  |  Branch (2429:24): [True: 263, False: 171]
  ------------------
 2430|    502|            } else {
 2431|    502|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    502|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2432|    502|                if (length > 16) { LZ4_wildCopy8(op+8, match+8, cpy); }
  ------------------
  |  Branch (2432:21): [True: 277, False: 225]
  ------------------
 2433|    502|            }
 2434|    673|            op = cpy;   /* wildcopy correction */
 2435|    673|        }
 2436|       |
 2437|       |        /* end of decoding */
 2438|    132|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  289|    132|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2439|    132|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2440|       |
 2441|       |        /* Overflow error detected */
 2442|    513|    _output_error:
 2443|    513|        return (int) (-(((const char*)ip)-src))-1;
 2444|      2|    }
 2445|      2|}
lz4.c:read_variable_length:
 1981|  49.6k|{
 1982|  49.6k|    Rvl_t s, length = 0;
 1983|  49.6k|    assert(ip != NULL);
  ------------------
  |  |  273|  49.6k|#    define assert(condition) ((void)0)
  ------------------
 1984|  49.6k|    assert(*ip !=  NULL);
  ------------------
  |  |  273|  49.6k|#    define assert(condition) ((void)0)
  ------------------
 1985|  49.6k|    assert(ilimit != NULL);
  ------------------
  |  |  273|  49.6k|#    define assert(condition) ((void)0)
  ------------------
 1986|  49.6k|    if (initial_check && unlikely((*ip) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  1.85k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.85k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 16, False: 1.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1986:9): [True: 1.85k, False: 47.7k]
  ------------------
 1987|     16|        return rvl_error;
 1988|     16|    }
 1989|  49.6k|    s = **ip;
 1990|  49.6k|    (*ip)++;
 1991|  49.6k|    length += s;
 1992|  49.6k|    if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  49.6k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  49.6k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 8, False: 49.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1993|      8|        return rvl_error;
 1994|      8|    }
 1995|       |    /* accumulator overflow detection (32-bit mode only) */
 1996|  49.6k|    if ((sizeof(length) < 8) && unlikely(length > ((Rvl_t)(-1)/2)) ) {
  ------------------
  |  |  180|      0|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|      0|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1996:9): [Folded, False: 49.6k]
  ------------------
 1997|      0|        return rvl_error;
 1998|      0|    }
 1999|  49.6k|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  49.6k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  49.6k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 48.1k, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|   102k|    do {
 2001|   102k|        s = **ip;
 2002|   102k|        (*ip)++;
 2003|   102k|        length += s;
 2004|   102k|        if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|   102k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   102k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 14, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2005|     14|            return rvl_error;
 2006|     14|        }
 2007|       |        /* accumulator overflow detection (32-bit mode only) */
 2008|   102k|        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: 102k]
  ------------------
 2009|      0|            return rvl_error;
 2010|      0|        }
 2011|   102k|    } while (s == 255);
  ------------------
  |  Branch (2011:14): [True: 100k, False: 1.48k]
  ------------------
 2012|       |
 2013|  1.48k|    return length;
 2014|  1.49k|}
lz4.c:LZ4_wildCopy32:
  523|  15.6k|{
  524|  15.6k|    BYTE* d = (BYTE*)dstPtr;
  525|  15.6k|    const BYTE* s = (const BYTE*)srcPtr;
  526|  15.6k|    BYTE* const e = (BYTE*)dstEnd;
  527|       |
  528|   231k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|   231k|#    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|   231k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (528:79): [True: 215k, False: 15.6k]
  ------------------
  529|  15.6k|}
lz4.c:LZ4_readLE16:
  431|  63.2k|{
  432|  63.2k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (432:9): [True: 63.2k, False: 0]
  ------------------
  433|  63.2k|        return LZ4_read16(memPtr);
  434|  63.2k|    } else {
  435|      0|        const BYTE* p = (const BYTE*)memPtr;
  436|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  437|      0|    }
  438|  63.2k|}
lz4.c:LZ4_memcpy_using_offset:
  536|  38.6k|{
  537|  38.6k|    BYTE v[8];
  538|       |
  539|  38.6k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  |  273|  38.6k|#    define assert(condition) ((void)0)
  ------------------
  540|       |
  541|  38.6k|    switch(offset) {
  542|  33.1k|    case 1:
  ------------------
  |  Branch (542:5): [True: 33.1k, False: 5.48k]
  ------------------
  543|  33.1k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  236|  33.1k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|  33.1k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  544|  33.1k|        break;
  545|    319|    case 2:
  ------------------
  |  Branch (545:5): [True: 319, False: 38.3k]
  ------------------
  546|    319|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  349|    319|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  547|    319|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  349|    319|#    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|    319|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  349|    319|#    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|    319|        break;
  557|    337|    case 4:
  ------------------
  |  Branch (557:5): [True: 337, False: 38.2k]
  ------------------
  558|    337|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  349|    337|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  559|    337|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  349|    337|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  560|    337|        break;
  561|  4.82k|    default:
  ------------------
  |  Branch (561:5): [True: 4.82k, False: 33.8k]
  ------------------
  562|  4.82k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  563|  4.82k|        return;
  564|  38.6k|    }
  565|       |
  566|  33.8k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  33.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  567|  33.8k|    dstPtr += 8;
  568|  1.22M|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (568:12): [True: 1.18M, False: 33.8k]
  ------------------
  569|  1.18M|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  1.18M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  570|  1.18M|        dstPtr += 8;
  571|  1.18M|    }
  572|  33.8k|}
lz4.c:LZ4_memcpy_using_offset_base:
  497|  4.82k|{
  498|  4.82k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  |  273|  4.82k|#    define assert(condition) ((void)0)
  ------------------
  499|  4.82k|    if (offset < 8) {
  ------------------
  |  Branch (499:9): [True: 4.44k, False: 384]
  ------------------
  500|  4.44k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  501|  4.44k|        dstPtr[0] = srcPtr[0];
  502|  4.44k|        dstPtr[1] = srcPtr[1];
  503|  4.44k|        dstPtr[2] = srcPtr[2];
  504|  4.44k|        dstPtr[3] = srcPtr[3];
  505|  4.44k|        srcPtr += inc32table[offset];
  506|  4.44k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  349|  4.44k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  507|  4.44k|        srcPtr -= dec64table[offset];
  508|  4.44k|        dstPtr += 8;
  509|  4.44k|    } else {
  510|    384|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|    384|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  511|    384|        dstPtr += 8;
  512|    384|        srcPtr += 8;
  513|    384|    }
  514|       |
  515|  4.82k|    LZ4_wildCopy8(dstPtr, srcPtr, dstEnd);
  516|  4.82k|}

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

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

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

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

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

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

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

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.17k|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.17k|    len = MIN(len, left);
  ------------------
  |  |  124|  3.17k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 3.17k]
  |  |  ------------------
  ------------------
  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.17k|#ifndef HAVE_MASKED_READWRITE
  247|  3.17k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  3.17k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 54, False: 3.11k]
  |  |  ------------------
  ------------------
  248|    558|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 504, False: 54]
  ------------------
  249|    504|            *out++ = *from++;
  250|    504|            --len;
  251|    504|        }
  252|       |
  253|     54|        return out;
  254|     54|    }
  255|  3.11k|#endif
  256|       |
  257|  3.11k|    if (len)
  ------------------
  |  Branch (257:9): [True: 3.11k, False: 0]
  ------------------
  258|  3.11k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  3.11k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  3.11k|    return out;
  261|  3.17k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|   186k|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|   186k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|   186k|    chunk_t chunk_load;
  118|   186k|    uint32_t chunk_mod = 0;
  119|   186k|    uint32_t adv_amount;
  120|   186k|    int64_t sdist = out - from;
  121|   186k|    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|   186k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 186k]
  |  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|   186k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 170k, False: 15.4k]
  ------------------
  144|   170k|        memset(out, *from, len);
  145|   170k|        return out + len;
  146|   170k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 294, False: 15.1k]
  ------------------
  147|    294|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    294|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    294|    }
  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|  15.1k|#ifdef HAVE_HALF_CHUNK
  158|  15.1k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 1.65k, False: 13.4k]
  ------------------
  159|  1.65k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 42, False: 1.61k]
  ------------------
  160|     42|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  1.61k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 824, False: 789]
  |  Branch (162:32): [True: 85, False: 704]
  ------------------
  163|    909|            halfchunk_t halfchunk_load = GET_HALFCHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  164|       |
  165|    909|            if (len == sizeof(halfchunk_t)) {
  ------------------
  |  Branch (165:17): [True: 287, False: 622]
  ------------------
  166|    287|                storehalfchunk(out, &halfchunk_load);
  167|    287|                len -= sizeof(halfchunk_t);
  168|    287|                out += sizeof(halfchunk_t);
  169|    287|            }
  170|       |
  171|    909|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|    909|            goto rem_bytes;
  173|    909|        }
  174|  1.61k|    }
  175|  14.1k|#endif
  176|       |
  177|  14.1k|#ifdef HAVE_CHUNKMEMSET_2
  178|  14.1k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 1.78k, False: 12.3k]
  ------------------
  179|  1.78k|        chunkmemset_2(from, &chunk_load);
  180|  1.78k|    } else
  181|  12.3k|#endif
  182|  12.3k|#ifdef HAVE_CHUNKMEMSET_4
  183|  12.3k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 883, False: 11.5k]
  ------------------
  184|    883|        chunkmemset_4(from, &chunk_load);
  185|    883|    } else
  186|  11.5k|#endif
  187|  11.5k|#ifdef HAVE_CHUNKMEMSET_8
  188|  11.5k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 525, False: 10.9k]
  ------------------
  189|    525|        chunkmemset_8(from, &chunk_load);
  190|    525|    } else
  191|  10.9k|#endif
  192|  10.9k|#ifdef HAVE_CHUNKMEMSET_16
  193|  10.9k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 220, False: 10.7k]
  ------------------
  194|    220|        chunkmemset_16(from, &chunk_load);
  195|    220|    } else
  196|  10.7k|#endif
  197|  10.7k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  14.1k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  30.8k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 16.6k, False: 14.1k]
  ------------------
  202|  16.6k|        storechunk(out, &chunk_load);
  203|  16.6k|        storechunk(out + adv_amount, &chunk_load);
  204|  16.6k|        out += 2 * adv_amount;
  205|  16.6k|        len -= 2 * adv_amount;
  206|  16.6k|    }
  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|  23.0k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 8.91k, False: 14.1k]
  ------------------
  213|  8.91k|        storechunk(out, &chunk_load);
  214|  8.91k|        len -= adv_amount;
  215|  8.91k|        out += adv_amount;
  216|  8.91k|    }
  217|       |
  218|  14.1k|#ifdef HAVE_HALF_CHUNK
  219|  15.0k|rem_bytes:
  220|  15.0k|#endif
  221|  15.0k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 14.7k, False: 335]
  ------------------
  222|  14.7k|        memcpy(out, &chunk_load, len);
  223|  14.7k|        out += len;
  224|  14.7k|    }
  225|       |
  226|  15.0k|    return out;
  227|  14.1k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|     42|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|     42|    halfchunk_t chunk;
   93|     42|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|     42|    loadhalfchunk(from, &chunk);
   95|     42|    storehalfchunk(out, &chunk);
   96|     42|    out += align;
   97|     42|    from += align;
   98|     42|    len -= align;
   99|     42|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 42]
  ------------------
  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|     42|    return out;
  107|     42|}
chunkset_avx2.c:chunksize_avx2:
    9|   185k|static inline size_t CHUNKSIZE(void) {
   10|   185k|    return sizeof(chunk_t);
   11|   185k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|  45.9k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|  45.9k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|  45.9k|    chunk_t chunk;
   27|  45.9k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|  45.9k|    loadchunk(from, &chunk);
   29|  45.9k|    storechunk(out, &chunk);
   30|  45.9k|    out += align;
   31|  45.9k|    from += align;
   32|  45.9k|    len -= align;
   33|   297k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 251k, False: 45.9k]
  ------------------
   34|   251k|        loadchunk(from, &chunk);
   35|   251k|        storechunk(out, &chunk);
   36|   251k|        out += sizeof(chunk_t);
   37|   251k|        from += sizeof(chunk_t);
   38|   251k|        len -= sizeof(chunk_t);
   39|   251k|    }
   40|  45.9k|    return out;
   41|  45.9k|}

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

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

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

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

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

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

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

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

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

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

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

zstd_decompress_block.c:BIT_initDStream:
  255|  1.90k|{
  256|  1.90k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      5|# 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|      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 (256:9): [True: 5, False: 1.89k]
  ------------------
  257|       |
  258|  1.89k|    bitD->start = (const char*)srcBuffer;
  259|  1.89k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  1.89k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 1.83k, False: 60]
  ------------------
  262|  1.83k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  1.83k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  1.83k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  1.83k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.71k, False: 121]
  ------------------
  266|  1.83k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    121|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    121|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    121|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 121, False: 1.71k]
  ------------------
  267|  1.83k|    } else {
  268|     60|        bitD->ptr   = bitD->start;
  269|     60|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|     60|        switch(srcSize)
  271|     60|        {
  272|      7|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 7, False: 53]
  ------------------
  273|      7|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      7|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     14|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 7, False: 53]
  ------------------
  276|     14|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     14|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     23|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 9, False: 51]
  ------------------
  279|     23|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     23|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     28|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 5, False: 55]
  ------------------
  282|     28|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     28|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|     41|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 13, False: 47]
  ------------------
  285|     41|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     41|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|     53|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 12, False: 48]
  ------------------
  288|     53|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     53|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|     60|        default: break;
  ------------------
  |  Branch (290:9): [True: 7, False: 53]
  ------------------
  291|     60|        }
  292|     60|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|     60|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 53, False: 7]
  ------------------
  294|     60|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 7, False: 53]
  ------------------
  295|     60|        }
  296|     53|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|     53|    }
  298|       |
  299|  1.76k|    return srcSize;
  300|  1.89k|}
zstd_decompress_block.c:BIT_readBits:
  363|  6.90M|{
  364|  6.90M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  6.90M|    BIT_skipBits(bitD, nbBits);
  366|  6.90M|    return value;
  367|  6.90M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  6.90M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  6.90M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  6.90M|    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|  6.90M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  6.90M|{
  309|  6.90M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  6.90M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  6.90M|#    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|  6.90M|#if defined(__x86_64__) || defined(_M_X64)
  318|  6.90M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  6.90M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  8.33M|{
  355|  8.33M|    bitD->bitsConsumed += nbBits;
  356|  8.33M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  2.30M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  2.30M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  2.30M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 2.15M, False: 153k]
  |  |  ------------------
  ------------------
  416|  2.15M|        static const BitContainerType zeroFilled = 0;
  417|  2.15M|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  2.15M|        return BIT_DStream_overflow;
  420|  2.15M|    }
  421|       |
  422|   153k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   153k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   153k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 136k, False: 16.4k]
  ------------------
  425|   136k|        return BIT_reloadDStream_internal(bitD);
  426|   136k|    }
  427|  16.4k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 7.61k, False: 8.80k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  7.61k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 7.41k, False: 198]
  ------------------
  430|    198|        return BIT_DStream_completed;
  431|  7.61k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  8.80k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  8.80k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  8.80k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 711, False: 8.09k]
  ------------------
  436|    711|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    711|            result = BIT_DStream_endOfBuffer;
  438|    711|        }
  439|  8.80k|        bitD->ptr -= nbBytes;
  440|  8.80k|        bitD->bitsConsumed -= nbBytes*8;
  441|  8.80k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  8.80k|        return result;
  443|  16.4k|    }
  444|  16.4k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|   136k|{
  386|   136k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   136k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   136k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   136k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   136k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   136k|    bitD->bitsConsumed &= 7;
  390|   136k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   136k|    return BIT_DStream_unfinished;
  392|   136k|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  1.43M|{
  373|  1.43M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  1.43M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  1.43M|    BIT_skipBits(bitD, nbBits);
  376|  1.43M|    return value;
  377|  1.43M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  1.43M|{
  348|  1.43M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  1.43M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  1.43M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  1.43M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|    451|{
  451|    451|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 428, False: 23]
  |  Branch (451:49): [True: 418, False: 10]
  ------------------
  452|    451|}
fse_decompress.c:BIT_initDStream:
  255|    805|{
  256|    805|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      2|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
                  if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 2, False: 803]
  ------------------
  257|       |
  258|    803|    bitD->start = (const char*)srcBuffer;
  259|    803|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|    803|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 661, False: 142]
  ------------------
  262|    661|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    661|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    661|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    661|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 599, False: 62]
  ------------------
  266|    661|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 62, False: 599]
  ------------------
  267|    661|    } else {
  268|    142|        bitD->ptr   = bitD->start;
  269|    142|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    142|        switch(srcSize)
  271|    142|        {
  272|      4|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 4, False: 138]
  ------------------
  273|      4|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      4|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     18|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 14, False: 128]
  ------------------
  276|     18|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     18|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     68|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 50, False: 92]
  ------------------
  279|     68|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     68|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     86|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 18, False: 124]
  ------------------
  282|     86|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     86|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    103|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 17, False: 125]
  ------------------
  285|    103|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    103|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    137|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 34, False: 108]
  ------------------
  288|    137|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    137|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    142|        default: break;
  ------------------
  |  Branch (290:9): [True: 5, False: 137]
  ------------------
  291|    142|        }
  292|    142|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    142|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 139, False: 3]
  ------------------
  294|    142|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 3, False: 139]
  ------------------
  295|    142|        }
  296|    139|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    139|    }
  298|       |
  299|    738|    return srcSize;
  300|    803|}
fse_decompress.c:BIT_readBits:
  363|  71.7k|{
  364|  71.7k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  71.7k|    BIT_skipBits(bitD, nbBits);
  366|  71.7k|    return value;
  367|  71.7k|}
fse_decompress.c:BIT_lookBits:
  331|  71.7k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  71.7k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  71.7k|    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|  71.7k|}
fse_decompress.c:BIT_getMiddleBits:
  308|  71.7k|{
  309|  71.7k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  71.7k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  71.7k|#    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|  71.7k|#if defined(__x86_64__) || defined(_M_X64)
  318|  71.7k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  71.7k|}
fse_decompress.c:BIT_skipBits:
  354|  86.1k|{
  355|  86.1k|    bitD->bitsConsumed += nbBits;
  356|  86.1k|}
fse_decompress.c:BIT_reloadDStream:
  413|  41.0k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  41.0k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  41.0k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 728, False: 40.3k]
  |  |  ------------------
  ------------------
  416|    728|        static const BitContainerType zeroFilled = 0;
  417|    728|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    728|        return BIT_DStream_overflow;
  420|    728|    }
  421|       |
  422|  40.3k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  40.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  40.3k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 11.3k, False: 29.0k]
  ------------------
  425|  11.3k|        return BIT_reloadDStream_internal(bitD);
  426|  11.3k|    }
  427|  29.0k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 23.2k, False: 5.76k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  23.2k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 22.5k, False: 700]
  ------------------
  430|    700|        return BIT_DStream_completed;
  431|  23.2k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  5.76k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  5.76k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  5.76k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 58, False: 5.70k]
  ------------------
  436|     58|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|     58|            result = BIT_DStream_endOfBuffer;
  438|     58|        }
  439|  5.76k|        bitD->ptr -= nbBytes;
  440|  5.76k|        bitD->bitsConsumed -= nbBytes*8;
  441|  5.76k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  5.76k|        return result;
  443|  29.0k|    }
  444|  29.0k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  11.3k|{
  386|  11.3k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  11.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  11.3k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  11.3k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  11.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  11.3k|    bitD->bitsConsumed &= 7;
  390|  11.3k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  11.3k|    return BIT_DStream_unfinished;
  392|  11.3k|}
fse_decompress.c:BIT_readBitsFast:
  372|  14.4k|{
  373|  14.4k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  14.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  14.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  14.4k|    BIT_skipBits(bitD, nbBits);
  376|  14.4k|    return value;
  377|  14.4k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  14.4k|{
  348|  14.4k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  14.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  14.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  14.4k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  14.4k|}
huf_decompress.c:BIT_initDStream:
  255|  1.01k|{
  256|  1.01k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     15|# 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|     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 (256:9): [True: 15, False: 1.00k]
  ------------------
  257|       |
  258|  1.00k|    bitD->start = (const char*)srcBuffer;
  259|  1.00k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  1.00k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 779, False: 224]
  ------------------
  262|    779|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    779|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    779|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    779|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 768, False: 11]
  ------------------
  266|    779|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 11, False: 768]
  ------------------
  267|    779|    } else {
  268|    224|        bitD->ptr   = bitD->start;
  269|    224|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    224|        switch(srcSize)
  271|    224|        {
  272|     26|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 26, False: 198]
  ------------------
  273|     26|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     26|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     42|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 16, False: 208]
  ------------------
  276|     42|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     42|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     62|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 20, False: 204]
  ------------------
  279|     62|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     62|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    111|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 49, False: 175]
  ------------------
  282|    111|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    111|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    131|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 20, False: 204]
  ------------------
  285|    131|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    131|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    164|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 33, False: 191]
  ------------------
  288|    164|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    164|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    224|        default: break;
  ------------------
  |  Branch (290:9): [True: 60, False: 164]
  ------------------
  291|    224|        }
  292|    224|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    224|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 211, False: 13]
  ------------------
  294|    224|            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: 211]
  ------------------
  295|    224|        }
  296|    211|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    211|    }
  298|       |
  299|    979|    return srcSize;
  300|  1.00k|}
huf_decompress.c:BIT_reloadDStream:
  413|  65.0k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  65.0k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  65.0k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 88, False: 64.9k]
  |  |  ------------------
  ------------------
  416|     88|        static const BitContainerType zeroFilled = 0;
  417|     88|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|     88|        return BIT_DStream_overflow;
  420|     88|    }
  421|       |
  422|  64.9k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  64.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  64.9k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 60.7k, False: 4.27k]
  ------------------
  425|  60.7k|        return BIT_reloadDStream_internal(bitD);
  426|  60.7k|    }
  427|  4.27k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 1.03k, False: 3.24k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  1.03k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 1.02k, False: 12]
  ------------------
  430|     12|        return BIT_DStream_completed;
  431|  1.03k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  3.24k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  3.24k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  3.24k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 507, False: 2.73k]
  ------------------
  436|    507|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    507|            result = BIT_DStream_endOfBuffer;
  438|    507|        }
  439|  3.24k|        bitD->ptr -= nbBytes;
  440|  3.24k|        bitD->bitsConsumed -= nbBytes*8;
  441|  3.24k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  3.24k|        return result;
  443|  4.27k|    }
  444|  4.27k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|  82.1k|{
  386|  82.1k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  82.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  82.1k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  82.1k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  82.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  82.1k|    bitD->bitsConsumed &= 7;
  390|  82.1k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  82.1k|    return BIT_DStream_unfinished;
  392|  82.1k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  1.21M|{
  348|  1.21M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  1.21M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.21M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  1.21M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  1.21M|}
huf_decompress.c:BIT_skipBits:
  354|  1.21M|{
  355|  1.21M|    bitD->bitsConsumed += nbBits;
  356|  1.21M|}
huf_decompress.c:BIT_endOfDStream:
  450|    930|{
  451|    930|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 678, False: 252]
  |  Branch (451:49): [True: 13, False: 665]
  ------------------
  452|    930|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  21.6k|{
  402|  21.6k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  21.6k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 289, False: 21.4k]
  |  |  ------------------
  ------------------
  403|    289|        return BIT_DStream_overflow;
  404|  21.4k|    return BIT_reloadDStream_internal(bitD);
  405|  21.6k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  3.72k|{
  387|  3.72k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 3.72k, False: 3]
  ------------------
  388|  3.72k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|   804k|{
  375|   804k|    return ptr - sub;
  376|   804k|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|   804k|{
  362|   804k|    return ptr + add;
  363|   804k|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|    998|{
  387|    998|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 995, False: 3]
  ------------------
  388|    998|}

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

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

zstd_common.c:ERR_isError:
   52|  9.64k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  9.64k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  9.64k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  9.64k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  3.35k|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: 258, False: 3.09k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  7.10k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  7.10k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  7.10k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  7.10k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|  46.0k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  46.0k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  46.0k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  46.0k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  2.31M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.31M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.31M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.31M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|  62.9k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  62.9k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  62.9k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  62.9k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|   137k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   137k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   137k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   137k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  50.6k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  50.6k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  50.6k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  50.6k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  1.03k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.03k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.03k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.03k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  2.48k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.48k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.48k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.48k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  3.59k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  3.59k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  3.59k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.59k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|  3.62k|{
  323|  3.62k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 3.62k, False: 0]
  ------------------
  324|  3.62k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  3.62k|}
zstd_ddict.c:MEM_isLittleEndian:
  141|  3.62k|{
  142|  3.62k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  3.62k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  3.62k|}
zstd_ddict.c:MEM_read32:
  183|  3.62k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  31.9k|{
  323|  31.9k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 31.9k, False: 0]
  ------------------
  324|  31.9k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  31.9k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  32.9k|{
  142|  32.9k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  32.9k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  32.9k|}
zstd_decompress.c:MEM_read32:
  183|  31.9k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|    441|{
  291|    441|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 441, False: 0]
  ------------------
  292|    441|        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|    441|}
zstd_decompress.c:MEM_read16:
  182|    441|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|    507|{
  339|    507|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 507, False: 0]
  ------------------
  340|    507|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|    507|}
zstd_decompress.c:MEM_read64:
  184|    507|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  6.58k|{
  312|  6.58k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  6.58k|}
zstd_decompress_block.c:MEM_readLE32:
  322|    726|{
  323|    726|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 726, False: 0]
  ------------------
  324|    726|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|    726|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|   154k|{
  142|   154k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   154k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|   154k|}
zstd_decompress_block.c:MEM_read32:
  183|    726|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  19.5k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  6.82k|{
  291|  6.82k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 6.82k, False: 0]
  ------------------
  292|  6.82k|        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|  6.82k|}
zstd_decompress_block.c:MEM_read16:
  182|  6.82k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  10.7M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  2.30M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|   147k|{
  355|   147k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 147k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   147k|    else
  358|   147k|        return (size_t)MEM_readLE64(memPtr);
  359|   147k|}
zstd_decompress_block.c:MEM_readLE64:
  338|   147k|{
  339|   147k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 147k, False: 0]
  ------------------
  340|   147k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   147k|}
zstd_decompress_block.c:MEM_read64:
  184|   147k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|  48.8k|{
  323|  48.8k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 48.8k, False: 0]
  ------------------
  324|  48.8k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  48.8k|}
zstd_v05.c:MEM_isLittleEndian:
  141|   282k|{
  142|   282k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   282k|    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|   282k|}
zstd_v05.c:MEM_read32:
  183|  48.8k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.c:MEM_readLEST:
  354|  57.8k|{
  355|  57.8k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 57.8k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  57.8k|    else
  358|  57.8k|        return (size_t)MEM_readLE64(memPtr);
  359|  57.8k|}
zstd_v05.c:MEM_32bits:
  137|   124k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.c:MEM_readLE64:
  338|  57.8k|{
  339|  57.8k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 57.8k, False: 0]
  ------------------
  340|  57.8k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  57.8k|}
zstd_v05.c:MEM_read64:
  184|  57.8k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE16:
  290|    915|{
  291|    915|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 915, False: 0]
  ------------------
  292|    915|        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|    915|}
zstd_v05.c:MEM_read16:
  182|    915|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_v05.c:MEM_64bits:
  138|  23.1k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v05.c:MEM_writeLE16:
  300|   174k|{
  301|   174k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (301:9): [True: 174k, False: 0]
  ------------------
  302|   174k|        MEM_write16(memPtr, val);
  303|   174k|    } else {
  304|      0|        BYTE* p = (BYTE*)memPtr;
  305|      0|        p[0] = (BYTE)val;
  306|      0|        p[1] = (BYTE)(val>>8);
  307|      0|    }
  308|   174k|}
zstd_v05.c:MEM_write16:
  187|   174k|MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; }
entropy_common.c:MEM_readLE32:
  322|  45.3k|{
  323|  45.3k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 45.3k, False: 0]
  ------------------
  324|  45.3k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  45.3k|}
entropy_common.c:MEM_isLittleEndian:
  141|  45.3k|{
  142|  45.3k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  45.3k|    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|  45.3k|}
entropy_common.c:MEM_read32:
  183|  45.3k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  1.23k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  17.7k|{
  355|  17.7k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 17.7k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  17.7k|    else
  358|  17.7k|        return (size_t)MEM_readLE64(memPtr);
  359|  17.7k|}
fse_decompress.c:MEM_32bits:
  137|  17.7k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  17.7k|{
  142|  17.7k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  17.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|  17.7k|}
fse_decompress.c:MEM_readLE64:
  338|  17.7k|{
  339|  17.7k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 17.7k, False: 0]
  ------------------
  340|  17.7k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  17.7k|}
fse_decompress.c:MEM_read64:
  184|  17.7k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   234k|{
  142|   234k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   234k|    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|   234k|}
huf_decompress.c:MEM_write64:
  189|   152k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|  87.1k|{
  355|  87.1k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 87.1k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  87.1k|    else
  358|  87.1k|        return (size_t)MEM_readLE64(memPtr);
  359|  87.1k|}
huf_decompress.c:MEM_32bits:
  137|  88.2k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|  87.1k|{
  339|  87.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 87.1k, False: 0]
  ------------------
  340|  87.1k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  87.1k|}
huf_decompress.c:MEM_read64:
  184|  87.1k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   182k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  1.74k|{
  291|  1.74k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.74k, False: 0]
  ------------------
  292|  1.74k|        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.74k|}
huf_decompress.c:MEM_read16:
  182|  1.74k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

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

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

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

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

ZSTD_getcBlockSize:
   65|  4.88k|{
   66|  4.88k|    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, "");
  ------------------
  |  |  114|  4.88k|    do {                                                                       \
  |  |  115|  4.88k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 4.88k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  4.88k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.88k]
  |  |  ------------------
  ------------------
   67|       |
   68|  4.88k|    {   U32 const cBlockHeader = MEM_readLE24(src);
   69|  4.88k|        U32 const cSize = cBlockHeader >> 3;
   70|  4.88k|        bpPtr->lastBlock = cBlockHeader & 1;
   71|  4.88k|        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
   72|  4.88k|        bpPtr->origSize = cSize;   /* only useful for RLE */
   73|  4.88k|        if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (73:13): [True: 499, False: 4.38k]
  ------------------
   74|  4.38k|        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, "");
  ------------------
  |  |  114|  4.38k|    do {                                                                       \
  |  |  115|  4.38k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 20, False: 4.36k]
  |  |  ------------------
  |  |  116|     20|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     20|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     20|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     20|    do {                                           \
  |  |  |  |   99|     20|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     20|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     20|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     20|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     20|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     20|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     20|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     20|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     20|        }                                                                      \
  |  |  123|  4.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.36k]
  |  |  ------------------
  ------------------
   75|  4.36k|        return cSize;
   76|  4.38k|    }
   77|  4.38k|}
ZSTD_buildFSETable:
  630|  2.51k|{
  631|  2.51k|#if DYNAMIC_BMI2
  632|  2.51k|    if (bmi2) {
  ------------------
  |  Branch (632:9): [True: 2.16k, False: 344]
  ------------------
  633|  2.16k|        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
  634|  2.16k|                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  635|  2.16k|        return;
  636|  2.16k|    }
  637|    344|#endif
  638|    344|    (void)bmi2;
  639|    344|    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
  640|    344|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  641|    344|}
ZSTD_decodeSeqHeaders:
  697|  2.11k|{
  698|  2.11k|    const BYTE* const istart = (const BYTE*)src;
  699|  2.11k|    const BYTE* const iend = istart + srcSize;
  700|  2.11k|    const BYTE* ip = istart;
  701|  2.11k|    int nbSeq;
  702|  2.11k|    DEBUGLOG(5, "ZSTD_decodeSeqHeaders");
  ------------------
  |  |  104|  2.11k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.11k]
  |  |  ------------------
  ------------------
  703|       |
  704|       |    /* check */
  705|  2.11k|    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, "");
  ------------------
  |  |  114|  2.11k|    do {                                                                       \
  |  |  115|  2.11k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 2.10k]
  |  |  ------------------
  |  |  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|  2.11k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.10k]
  |  |  ------------------
  ------------------
  706|       |
  707|       |    /* SeqHead */
  708|  2.10k|    nbSeq = *ip++;
  709|  2.10k|    if (nbSeq > 0x7F) {
  ------------------
  |  Branch (709:9): [True: 1.54k, False: 558]
  ------------------
  710|  1.54k|        if (nbSeq == 0xFF) {
  ------------------
  |  Branch (710:13): [True: 71, False: 1.47k]
  ------------------
  711|     71|            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, "");
  ------------------
  |  |  114|     71|    do {                                                                       \
  |  |  115|     71|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6, False: 65]
  |  |  ------------------
  |  |  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|     71|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 65]
  |  |  ------------------
  ------------------
  712|     65|            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;
  ------------------
  |  |   96|     65|#define LONGNBSEQ 0x7F00
  ------------------
  713|     65|            ip+=2;
  714|  1.47k|        } else {
  715|  1.47k|            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, "");
  ------------------
  |  |  114|  1.47k|    do {                                                                       \
  |  |  115|  1.47k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 1.46k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  1.47k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.46k]
  |  |  ------------------
  ------------------
  716|  1.46k|            nbSeq = ((nbSeq-0x80)<<8) + *ip++;
  717|  1.46k|        }
  718|  1.54k|    }
  719|  2.09k|    *nbSeqPtr = nbSeq;
  720|       |
  721|  2.09k|    if (nbSeq == 0) {
  ------------------
  |  Branch (721:9): [True: 141, False: 1.95k]
  ------------------
  722|       |        /* No sequence : section ends immediately */
  723|    141|        RETURN_ERROR_IF(ip != iend, corruption_detected,
  ------------------
  |  |  114|    141|    do {                                                                       \
  |  |  115|    141|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 131]
  |  |  ------------------
  |  |  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|    141|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 131]
  |  |  ------------------
  ------------------
  724|    141|            "extraneous data present in the Sequences section");
  725|    131|        return (size_t)(ip - istart);
  726|    141|    }
  727|       |
  728|       |    /* FSE table descriptors */
  729|  1.95k|    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */
  ------------------
  |  |  114|  1.95k|    do {                                                                       \
  |  |  115|  1.95k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 1.94k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  1.95k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
  730|  1.94k|    RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes. */
  ------------------
  |  |  114|  1.94k|    do {                                                                       \
  |  |  115|  1.94k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 18, False: 1.93k]
  |  |  ------------------
  |  |  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|  1.94k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.93k]
  |  |  ------------------
  ------------------
  731|  1.93k|    {   SymbolEncodingType_e const LLtype = (SymbolEncodingType_e)(*ip >> 6);
  732|  1.93k|        SymbolEncodingType_e const OFtype = (SymbolEncodingType_e)((*ip >> 4) & 3);
  733|  1.93k|        SymbolEncodingType_e const MLtype = (SymbolEncodingType_e)((*ip >> 2) & 3);
  734|  1.93k|        ip++;
  735|       |
  736|       |        /* Build DTables */
  737|  1.93k|        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
  738|  1.93k|                                                      LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  104|  1.93k|#define MaxLL   35
  ------------------
                                                                    LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  109|  1.93k|#define LLFSELog    9
  ------------------
  739|  1.93k|                                                      ip, iend-ip,
  740|  1.93k|                                                      LL_base, LL_bits,
  741|  1.93k|                                                      LL_defaultDTable, dctx->fseEntropy,
  742|  1.93k|                                                      dctx->ddictIsCold, nbSeq,
  743|  1.93k|                                                      dctx->workspace, sizeof(dctx->workspace),
  744|  1.93k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  745|  1.93k|            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  1.93k|    do {                                                                       \
  |  |  115|  1.93k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8, False: 1.92k]
  |  |  ------------------
  |  |  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|  1.93k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.92k]
  |  |  ------------------
  ------------------
  746|  1.92k|            ip += llhSize;
  747|  1.92k|        }
  748|       |
  749|      0|        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
  750|  1.92k|                                                      OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  106|  1.92k|#define MaxOff  31
  ------------------
                                                                    OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  110|  1.92k|#define OffFSELog   8
  ------------------
  751|  1.92k|                                                      ip, iend-ip,
  752|  1.92k|                                                      OF_base, OF_bits,
  753|  1.92k|                                                      OF_defaultDTable, dctx->fseEntropy,
  754|  1.92k|                                                      dctx->ddictIsCold, nbSeq,
  755|  1.92k|                                                      dctx->workspace, sizeof(dctx->workspace),
  756|  1.92k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  757|  1.92k|            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  1.92k|    do {                                                                       \
  |  |  115|  1.92k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 1.91k]
  |  |  ------------------
  |  |  116|     11|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     11|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     11|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     11|    do {                                           \
  |  |  |  |   99|     11|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     11|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     11|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     11|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     11|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     11|        }                                                                      \
  |  |  123|  1.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.91k]
  |  |  ------------------
  ------------------
  758|  1.91k|            ip += ofhSize;
  759|  1.91k|        }
  760|       |
  761|      0|        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
  762|  1.91k|                                                      MLtype, MaxML, MLFSELog,
  ------------------
  |  |  103|  1.91k|#define MaxML   52
  ------------------
                                                                    MLtype, MaxML, MLFSELog,
  ------------------
  |  |  108|  1.91k|#define MLFSELog    9
  ------------------
  763|  1.91k|                                                      ip, iend-ip,
  764|  1.91k|                                                      ML_base, ML_bits,
  765|  1.91k|                                                      ML_defaultDTable, dctx->fseEntropy,
  766|  1.91k|                                                      dctx->ddictIsCold, nbSeq,
  767|  1.91k|                                                      dctx->workspace, sizeof(dctx->workspace),
  768|  1.91k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  769|  1.91k|            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  1.91k|    do {                                                                       \
  |  |  115|  1.91k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 1.90k]
  |  |  ------------------
  |  |  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.91k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.90k]
  |  |  ------------------
  ------------------
  770|  1.90k|            ip += mlhSize;
  771|  1.90k|        }
  772|  1.90k|    }
  773|       |
  774|      0|    return ip-istart;
  775|  1.91k|}
ZSTD_decompressBlock_internal:
 2069|  2.78k|{   /* blockType == blockCompressed */
 2070|  2.78k|    const BYTE* ip = (const BYTE*)src;
 2071|  2.78k|    DEBUGLOG(5, "ZSTD_decompressBlock_internal (cSize : %u)", (unsigned)srcSize);
  ------------------
  |  |  104|  2.78k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.78k]
  |  |  ------------------
  ------------------
 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|  2.78k|    RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, "");
  ------------------
  |  |  114|  2.78k|    do {                                                                       \
  |  |  115|  2.78k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 2.78k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.78k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.78k]
  |  |  ------------------
  ------------------
 2082|       |
 2083|       |    /* Decode literals section */
 2084|  2.78k|    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming);
 2085|  2.78k|        DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize);
  ------------------
  |  |  104|  2.78k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.78k]
  |  |  ------------------
  ------------------
 2086|  2.78k|        if (ZSTD_isError(litCSize)) return litCSize;
  ------------------
  |  |   44|  2.78k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2086:13): [True: 672, False: 2.11k]
  ------------------
 2087|  2.11k|        ip += litCSize;
 2088|  2.11k|        srcSize -= litCSize;
 2089|  2.11k|    }
 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|  2.11k|        size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx));
  ------------------
  |  |   54|  2.11k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 187, False: 1.92k]
  |  |  ------------------
  ------------------
 2097|  2.11k|        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|  2.11k|        ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset()));
  ------------------
  |  Branch (2109:62): [True: 0, False: 2.11k]
  |  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|  2.11k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2115|  2.11k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2116|  2.11k|        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|  2.11k|        int nbSeq;
 2124|  2.11k|        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);
 2125|  2.11k|        if (ZSTD_isError(seqHSize)) return seqHSize;
  ------------------
  |  |   44|  2.11k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2125:13): [True: 77, False: 2.03k]
  ------------------
 2126|  2.03k|        ip += seqHSize;
 2127|  2.03k|        srcSize -= seqHSize;
 2128|       |
 2129|  2.03k|        RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.03k|    do {                                                                       \
  |  |  115|  8.13k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 2.03k]
  |  |  |  Branch (115:13): [True: 2, False: 2.03k]
  |  |  |  Branch (115:13): [True: 1, False: 1]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.03k]
  |  |  ------------------
  ------------------
 2130|  2.03k|        RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,
  ------------------
  |  |  114|  2.03k|    do {                                                                       \
  |  |  115|  10.1k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2.03k, False: 0]
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  |  Branch (115:13): [True: 0, False: 2.03k]
  |  |  ------------------
  |  |  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.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.03k]
  |  |  ------------------
  ------------------
 2131|  2.03k|                "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|  2.03k|        if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) {
  ------------------
  |  Branch (2137:13): [True: 0, False: 2.03k]
  |  Branch (2137:30): [True: 1.15k, False: 876]
  |  Branch (2137:53): [True: 0, False: 1.15k]
  |  Branch (2137:88): [True: 0, False: 0]
  ------------------
 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|  2.03k|        dctx->ddictIsCold = 0;
 2153|       |
 2154|  2.03k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2155|  2.03k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2156|  2.03k|        if (usePrefetchDecoder) {
  ------------------
  |  Branch (2156:13): [True: 876, False: 1.15k]
  ------------------
 2157|       |#else
 2158|       |        (void)usePrefetchDecoder;
 2159|       |        {
 2160|       |#endif
 2161|    876|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
 2162|    876|            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2163|    876|#endif
 2164|    876|        }
 2165|       |
 2166|  1.15k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
 2167|       |        /* else */
 2168|  1.15k|        if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (2168:13): [True: 545, False: 611]
  ------------------
 2169|    545|            return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2170|    611|        else
 2171|    611|            return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2172|  1.15k|#endif
 2173|  1.15k|    }
 2174|  1.15k|}
ZSTD_checkContinuity:
 2179|  3.35k|{
 2180|  3.35k|    if (dst != dctx->previousDstEnd && dstSize > 0) {   /* not contiguous */
  ------------------
  |  Branch (2180:9): [True: 3.35k, False: 0]
  |  Branch (2180:40): [True: 3.35k, False: 1]
  ------------------
 2181|  3.35k|        dctx->dictEnd = dctx->previousDstEnd;
 2182|  3.35k|        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
 2183|  3.35k|        dctx->prefixStart = dst;
 2184|  3.35k|        dctx->previousDstEnd = dst;
 2185|  3.35k|    }
 2186|  3.35k|}
zstd_decompress_block.c:ZSTD_decodeLiteralsBlock:
  137|  2.78k|{
  138|  2.78k|    DEBUGLOG(5, "ZSTD_decodeLiteralsBlock");
  ------------------
  |  |  104|  2.78k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.78k]
  |  |  ------------------
  ------------------
  139|  2.78k|    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, "");
  ------------------
  |  |  114|  2.78k|    do {                                                                       \
  |  |  115|  2.78k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 2.78k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.78k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.78k]
  |  |  ------------------
  ------------------
  140|       |
  141|  2.78k|    {   const BYTE* const istart = (const BYTE*) src;
  142|  2.78k|        SymbolEncodingType_e const litEncType = (SymbolEncodingType_e)(istart[0] & 3);
  143|  2.78k|        size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
  144|       |
  145|  2.78k|        switch(litEncType)
  146|  2.78k|        {
  147|     39|        case set_repeat:
  ------------------
  |  Branch (147:9): [True: 39, False: 2.74k]
  ------------------
  148|     39|            DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block");
  ------------------
  |  |  104|     39|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 39]
  |  |  ------------------
  ------------------
  149|     39|            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, "");
  ------------------
  |  |  114|     39|    do {                                                                       \
  |  |  115|     39|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 38]
  |  |  ------------------
  |  |  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|     39|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 38]
  |  |  ------------------
  ------------------
  150|     38|            ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     38|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  151|       |
  152|    727|        case set_compressed:
  ------------------
  |  Branch (152:9): [True: 689, False: 2.09k]
  ------------------
  153|    727|            RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3");
  ------------------
  |  |  114|    727|    do {                                                                       \
  |  |  115|    727|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 726]
  |  |  ------------------
  |  |  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|    727|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 726]
  |  |  ------------------
  ------------------
  154|    726|            {   size_t lhSize, litSize, litCSize;
  155|    726|                U32 singleStream=0;
  156|    726|                U32 const lhlCode = (istart[0] >> 2) & 3;
  157|    726|                U32 const lhc = MEM_readLE32(istart);
  158|    726|                size_t hufSuccess;
  159|    726|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|    726|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 429, False: 297]
  |  |  ------------------
  ------------------
  160|    726|                int const flags = 0
  161|    726|                    | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0)
  ------------------
  |  Branch (161:24): [True: 726, False: 0]
  ------------------
  162|    726|                    | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0);
  ------------------
  |  Branch (162:24): [True: 0, False: 726]
  ------------------
  163|    726|                switch(lhlCode)
  164|    726|                {
  165|    181|                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (165:17): [True: 80, False: 646]
  |  Branch (165:25): [True: 101, False: 625]
  |  Branch (165:33): [True: 0, False: 726]
  ------------------
  166|       |                    /* 2 - 2 - 10 - 10 */
  167|    181|                    singleStream = !lhlCode;
  168|    181|                    lhSize = 3;
  169|    181|                    litSize  = (lhc >> 4) & 0x3FF;
  170|    181|                    litCSize = (lhc >> 14) & 0x3FF;
  171|    181|                    break;
  172|    506|                case 2:
  ------------------
  |  Branch (172:17): [True: 506, False: 220]
  ------------------
  173|       |                    /* 2 - 2 - 14 - 14 */
  174|    506|                    lhSize = 4;
  175|    506|                    litSize  = (lhc >> 4) & 0x3FFF;
  176|    506|                    litCSize = lhc >> 18;
  177|    506|                    break;
  178|     39|                case 3:
  ------------------
  |  Branch (178:17): [True: 39, False: 687]
  ------------------
  179|       |                    /* 2 - 2 - 18 - 18 */
  180|     39|                    lhSize = 5;
  181|     39|                    litSize  = (lhc >> 4) & 0x3FFFF;
  182|     39|                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);
  183|     39|                    break;
  184|    726|                }
  185|    726|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|    726|    do {                                                                       \
  |  |  115|  2.17k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 719, False: 7]
  |  |  |  Branch (115:13): [True: 0, False: 719]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|    726|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 726]
  |  |  ------------------
  ------------------
  186|    726|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|    726|    do {                                                                       \
  |  |  115|    726|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 723]
  |  |  ------------------
  |  |  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|    726|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 723]
  |  |  ------------------
  ------------------
  187|    723|                if (!singleStream)
  ------------------
  |  Branch (187:21): [True: 643, False: 80]
  ------------------
  188|    643|                    RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong,
  ------------------
  |  |  114|    643|    do {                                                                       \
  |  |  115|    643|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 642]
  |  |  ------------------
  |  |  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|    643|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 642]
  |  |  ------------------
  ------------------
  189|    723|                        "Not enough literals (%zu) for the 4-streams mode (min %u)",
  190|    723|                        litSize, MIN_LITERALS_FOR_4_STREAMS);
  191|    722|                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|    722|    do {                                                                       \
  |  |  115|    722|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 712]
  |  |  ------------------
  |  |  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|    722|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 712]
  |  |  ------------------
  ------------------
  192|    712|                RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, "");
  ------------------
  |  |  114|    712|    do {                                                                       \
  |  |  115|    712|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 711]
  |  |  ------------------
  |  |  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|    712|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 711]
  |  |  ------------------
  ------------------
  193|    711|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0);
  194|       |
  195|       |                /* prefetch huffman table if cold */
  196|    711|                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {
  ------------------
  |  Branch (196:21): [True: 40, False: 671]
  |  Branch (196:42): [True: 24, False: 16]
  ------------------
  197|     24|                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));
  ------------------
  |  |  159|     24|    do {                                                 \
  |  |  160|     24|        const char* const _ptr = (const char*)(p);       \
  |  |  161|     24|        size_t const _size = (size_t)(s);                \
  |  |  162|     24|        size_t _pos;                                     \
  |  |  163|  6.19k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|  6.16k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 6.16k, False: 24]
  |  |  ------------------
  |  |  164|  6.16k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|  6.16k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|  6.16k|        }                                                \
  |  |  166|     24|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 24]
  |  |  ------------------
  ------------------
  198|     24|                }
  199|       |
  200|    711|                if (litEncType==set_repeat) {
  ------------------
  |  Branch (200:21): [True: 38, False: 673]
  ------------------
  201|     38|                    if (singleStream) {
  ------------------
  |  Branch (201:25): [True: 35, False: 3]
  ------------------
  202|     35|                        hufSuccess = HUF_decompress1X_usingDTable(
  203|     35|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  204|     35|                            dctx->HUFptr, flags);
  205|     35|                    } else {
  206|      3|                        assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);
  ------------------
  |  |   70|      3|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  207|      3|                        hufSuccess = HUF_decompress4X_usingDTable(
  208|      3|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  209|      3|                            dctx->HUFptr, flags);
  210|      3|                    }
  211|    673|                } else {
  212|    673|                    if (singleStream) {
  ------------------
  |  Branch (212:25): [True: 43, False: 630]
  ------------------
  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|     43|                        hufSuccess = HUF_decompress1X1_DCtx_wksp(
  220|     43|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  221|     43|                            istart+lhSize, litCSize, dctx->workspace,
  222|     43|                            sizeof(dctx->workspace), flags);
  223|     43|#endif
  224|    630|                    } else {
  225|    630|                        hufSuccess = HUF_decompress4X_hufOnly_wksp(
  226|    630|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  227|    630|                            istart+lhSize, litCSize, dctx->workspace,
  228|    630|                            sizeof(dctx->workspace), flags);
  229|    630|                    }
  230|    673|                }
  231|    711|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (231:21): [True: 4, False: 707]
  ------------------
  232|      4|                {
  233|      4|                    assert(litSize > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|      4|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  234|      4|                    ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|     24|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 4, Folded]
  |  |  |  Branch (44:51): [Folded, False: 4]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 4, Folded]
  |  |  |  Branch (44:55): [Folded, False: 4]
  |  |  ------------------
  ------------------
  235|      4|                    ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   45|     24|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (45:49): [True: 0, Folded]
  |  |  |  Branch (45:49): [True: 4, Folded]
  |  |  |  Branch (45:49): [Folded, False: 4]
  |  |  |  Branch (45:57): [True: 0, Folded]
  |  |  |  Branch (45:57): [True: 4, Folded]
  |  |  |  Branch (45:57): [Folded, False: 4]
  |  |  ------------------
  ------------------
  236|      4|                    dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|      4|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      4|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      8|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 4]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 4, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|      4|#define WILDCOPY_OVERLENGTH 32
  ------------------
  237|      4|                    dctx->litBufferEnd -= WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|      4|#define WILDCOPY_OVERLENGTH 32
  ------------------
  238|      4|                    assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax);
  ------------------
  |  |   70|      4|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  239|      4|                }
  240|       |
  241|    711|                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, "");
  ------------------
  |  |  114|    711|    do {                                                                       \
  |  |  115|    711|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 596, False: 115]
  |  |  ------------------
  |  |  116|    596|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    596|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 596]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    596|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    596|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    596|    do {                                           \
  |  |  |  |   99|    596|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 596]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    596|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 596]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    596|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    596|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 596]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    596|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    596|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 596]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    596|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    596|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    596|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    596|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    596|        }                                                                      \
  |  |  123|    711|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 115]
  |  |  ------------------
  ------------------
  242|       |
  243|    115|                dctx->litPtr = dctx->litBuffer;
  244|    115|                dctx->litSize = litSize;
  245|    115|                dctx->litEntropy = 1;
  246|    115|                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
  ------------------
  |  Branch (246:21): [True: 113, False: 2]
  ------------------
  247|    115|                return litCSize + lhSize;
  248|    711|            }
  249|       |
  250|    319|        case set_basic:
  ------------------
  |  Branch (250:9): [True: 319, False: 2.46k]
  ------------------
  251|    319|            {   size_t litSize, lhSize;
  252|    319|                U32 const lhlCode = ((istart[0]) >> 2) & 3;
  253|    319|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|    319|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 219, False: 100]
  |  |  ------------------
  ------------------
  254|    319|                switch(lhlCode)
  255|    319|                {
  256|    167|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (256:17): [True: 143, False: 176]
  |  Branch (256:25): [True: 24, False: 295]
  |  Branch (256:33): [True: 0, False: 319]
  ------------------
  257|    167|                    lhSize = 1;
  258|    167|                    litSize = istart[0] >> 3;
  259|    167|                    break;
  260|    123|                case 1:
  ------------------
  |  Branch (260:17): [True: 123, False: 196]
  ------------------
  261|    123|                    lhSize = 2;
  262|    123|                    litSize = MEM_readLE16(istart) >> 4;
  263|    123|                    break;
  264|     29|                case 3:
  ------------------
  |  Branch (264:17): [True: 29, False: 290]
  ------------------
  265|     29|                    lhSize = 3;
  266|     29|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3");
  ------------------
  |  |  114|     29|    do {                                                                       \
  |  |  115|     29|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 28]
  |  |  ------------------
  |  |  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|     29|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 28]
  |  |  ------------------
  ------------------
  267|     28|                    litSize = MEM_readLE24(istart) >> 4;
  268|     28|                    break;
  269|    319|                }
  270|       |
  271|    318|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|    318|    do {                                                                       \
  |  |  115|    882|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 246, False: 72]
  |  |  |  Branch (115:13): [True: 0, False: 246]
  |  |  ------------------
  |  |  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|    318|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 318]
  |  |  ------------------
  ------------------
  272|    318|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|    318|    do {                                                                       \
  |  |  115|    318|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 311]
  |  |  ------------------
  |  |  116|      7|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      7|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      7|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      7|    do {                                           \
  |  |  |  |   99|      7|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      7|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      7|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      7|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      7|        }                                                                      \
  |  |  123|    318|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 311]
  |  |  ------------------
  ------------------
  273|    311|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|    311|    do {                                                                       \
  |  |  115|    311|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 310]
  |  |  ------------------
  |  |  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|    311|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 310]
  |  |  ------------------
  ------------------
  274|    310|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  275|    310|                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  199|    310|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (275:21): [True: 168, False: 142]
  ------------------
  276|    168|                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|    168|    do {                                                                       \
  |  |  115|    168|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 28, False: 140]
  |  |  ------------------
  |  |  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|    168|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 140]
  |  |  ------------------
  ------------------
  277|    140|                    if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (277:25): [True: 0, False: 140]
  ------------------
  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|    140|                    else
  283|    140|                    {
  284|    140|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize);
  ------------------
  |  |   44|    140|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  285|    140|                    }
  286|    140|                    dctx->litPtr = dctx->litBuffer;
  287|    140|                    dctx->litSize = litSize;
  288|    140|                    return lhSize+litSize;
  289|    168|                }
  290|       |                /* direct reference into compressed stream */
  291|    142|                dctx->litPtr = istart+lhSize;
  292|    142|                dctx->litSize = litSize;
  293|    142|                dctx->litBufferEnd = dctx->litPtr + litSize;
  294|    142|                dctx->litBufferLocation = ZSTD_not_in_dst;
  295|    142|                return lhSize+litSize;
  296|    310|            }
  297|       |
  298|  1.73k|        case set_rle:
  ------------------
  |  Branch (298:9): [True: 1.73k, False: 1.04k]
  ------------------
  299|  1.73k|            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;
  300|  1.73k|                size_t litSize, lhSize;
  301|  1.73k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  1.73k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 1.68k, False: 49]
  |  |  ------------------
  ------------------
  302|  1.73k|                switch(lhlCode)
  303|  1.73k|                {
  304|      6|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (304:17): [True: 3, False: 1.73k]
  |  Branch (304:25): [True: 3, False: 1.73k]
  |  Branch (304:33): [True: 0, False: 1.73k]
  ------------------
  305|      6|                    lhSize = 1;
  306|      6|                    litSize = istart[0] >> 3;
  307|      6|                    break;
  308|     53|                case 1:
  ------------------
  |  Branch (308:17): [True: 53, False: 1.68k]
  ------------------
  309|     53|                    lhSize = 2;
  310|     53|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3");
  ------------------
  |  |  114|     53|    do {                                                                       \
  |  |  115|     53|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 52]
  |  |  ------------------
  |  |  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|     53|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 52]
  |  |  ------------------
  ------------------
  311|     52|                    litSize = MEM_readLE16(istart) >> 4;
  312|     52|                    break;
  313|  1.67k|                case 3:
  ------------------
  |  Branch (313:17): [True: 1.67k, False: 59]
  ------------------
  314|  1.67k|                    lhSize = 3;
  315|  1.67k|                    RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4");
  ------------------
  |  |  114|  1.67k|    do {                                                                       \
  |  |  115|  1.67k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.67k]
  |  |  ------------------
  |  |  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.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.67k]
  |  |  ------------------
  ------------------
  316|  1.67k|                    litSize = MEM_readLE24(istart) >> 4;
  317|  1.67k|                    break;
  318|  1.73k|                }
  319|  1.73k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  1.73k|    do {                                                                       \
  |  |  115|  5.19k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1.73k, False: 2]
  |  |  |  Branch (115:13): [True: 0, False: 1.73k]
  |  |  ------------------
  |  |  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.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.73k]
  |  |  ------------------
  ------------------
  320|  1.73k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  1.73k|    do {                                                                       \
  |  |  115|  1.73k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 18, False: 1.71k]
  |  |  ------------------
  |  |  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|  1.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.71k]
  |  |  ------------------
  ------------------
  321|  1.71k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  1.71k|    do {                                                                       \
  |  |  115|  1.71k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.71k]
  |  |  ------------------
  |  |  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.71k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.71k]
  |  |  ------------------
  ------------------
  322|  1.71k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  323|  1.71k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (323:21): [True: 1.32k, False: 386]
  ------------------
  324|  1.32k|                {
  325|  1.32k|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  7.96k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 1.32k, Folded]
  |  |  |  Branch (46:55): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
  326|  1.32k|                    ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  7.96k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 1.32k, Folded]
  |  |  |  Branch (46:55): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
  327|  1.32k|                }
  328|    386|                else
  329|    386|                {
  330|    386|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize);
  ------------------
  |  |   46|    386|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  331|    386|                }
  332|  1.71k|                dctx->litPtr = dctx->litBuffer;
  333|  1.71k|                dctx->litSize = litSize;
  334|  1.71k|                return lhSize+1;
  335|  1.71k|            }
  336|      0|        default:
  ------------------
  |  Branch (336:9): [True: 0, False: 2.78k]
  ------------------
  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|  2.78k|        }
  339|  2.78k|    }
  340|  2.78k|}
zstd_decompress_block.c:ZSTD_allocateLiteralsBuffer:
   82|  2.73k|{
   83|  2.73k|    size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
   84|  2.73k|    assert(litSize <= blockSizeMax);
  ------------------
  |  |   70|  2.73k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   85|  2.73k|    assert(dctx->isFrameDecompression || streaming == not_streaming);
  ------------------
  |  |   70|  2.73k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   86|  2.73k|    assert(expectedWriteSize <= blockSizeMax);
  ------------------
  |  |   70|  2.73k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   87|  2.73k|    if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  2.73k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  2.73k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (87:9): [True: 2.73k, False: 0]
  |  Branch (87:39): [True: 931, False: 1.80k]
  ------------------
   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|    931|        dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|    931|#define WILDCOPY_OVERLENGTH 32
  ------------------
   94|    931|        dctx->litBufferEnd = dctx->litBuffer + litSize;
   95|    931|        dctx->litBufferLocation = ZSTD_in_dst;
   96|  1.80k|    } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) {
  ------------------
  |  |  118|  1.80k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  1.80k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.60k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 1.80k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 1.80k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (96:16): [True: 462, False: 1.34k]
  ------------------
   97|       |        /* Literals fit entirely within the extra buffer, put them there to avoid
   98|       |         * having to split the literals.
   99|       |         */
  100|    462|        dctx->litBuffer = dctx->litExtraBuffer;
  101|    462|        dctx->litBufferEnd = dctx->litBuffer + litSize;
  102|    462|        dctx->litBufferLocation = ZSTD_not_in_dst;
  103|  1.34k|    } else {
  104|  1.34k|        assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|  1.34k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  105|       |        /* Literals must be split between the output block and the extra lit
  106|       |         * buffer. We fill the extra lit buffer with the tail of the literals,
  107|       |         * and put the rest of the literals at the end of the block, with
  108|       |         * WILDCOPY_OVERLENGTH of buffer room to allow for overreads.
  109|       |         * This MUST not write more than our maxBlockSize beyond dst, because in
  110|       |         * streaming mode, that could overwrite part of our extDict window.
  111|       |         */
  112|  1.34k|        if (splitImmediately) {
  ------------------
  |  Branch (112:13): [True: 1.33k, False: 4]
  ------------------
  113|       |            /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */
  114|  1.33k|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|  1.33k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  1.33k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.67k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 1.33k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 1.33k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  1.33k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  115|  1.33k|            dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|  1.33k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  1.33k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.67k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 1.33k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 1.33k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|  1.33k|        } else {
  117|       |            /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */
  118|      4|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize;
  119|      4|            dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize;
  120|      4|        }
  121|  1.34k|        dctx->litBufferLocation = ZSTD_split;
  122|  1.34k|        assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize);
  ------------------
  |  |   70|  1.34k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  123|  1.34k|    }
  124|  2.73k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_bmi2:
  620|  2.16k|{
  621|  2.16k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  622|  2.16k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  623|  2.16k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body:
  489|  2.51k|{
  490|  2.51k|    ZSTD_seqSymbol* const tableDecode = dt+1;
  491|  2.51k|    U32 const maxSV1 = maxSymbolValue + 1;
  492|  2.51k|    U32 const tableSize = 1 << tableLog;
  493|       |
  494|  2.51k|    U16* symbolNext = (U16*)wksp;
  495|  2.51k|    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);
  ------------------
  |  |  107|  2.51k|#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */
  |  |  ------------------
  |  |  |  |   55|  2.51k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (55:19): [Folded, False: 2.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  496|  2.51k|    U32 highThreshold = tableSize - 1;
  497|       |
  498|       |
  499|       |    /* Sanity Checks */
  500|  2.51k|    assert(maxSymbolValue <= MaxSeq);
  ------------------
  |  |   70|  2.51k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  501|  2.51k|    assert(tableLog <= MaxFSELog);
  ------------------
  |  |   70|  2.51k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  502|  2.51k|    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);
  ------------------
  |  |   70|  2.51k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  503|  2.51k|    (void)wkspSize;
  504|       |    /* Init, lay down lowprob symbols */
  505|  2.51k|    {   ZSTD_seqSymbol_header DTableH;
  506|  2.51k|        DTableH.tableLog = tableLog;
  507|  2.51k|        DTableH.fastMode = 1;
  508|  2.51k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
  509|  2.51k|            U32 s;
  510|  41.0k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (510:23): [True: 38.5k, False: 2.51k]
  ------------------
  511|  38.5k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (511:21): [True: 11.9k, False: 26.5k]
  ------------------
  512|  11.9k|                    tableDecode[highThreshold--].baseValue = s;
  513|  11.9k|                    symbolNext[s] = 1;
  514|  26.5k|                } else {
  515|  26.5k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (515:25): [True: 1.48k, False: 25.0k]
  ------------------
  516|  26.5k|                    assert(normalizedCounter[s]>=0);
  ------------------
  |  |   70|  26.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  517|  26.5k|                    symbolNext[s] = (U16)normalizedCounter[s];
  518|  26.5k|        }   }   }
  519|  2.51k|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|  2.51k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  520|  2.51k|    }
  521|       |
  522|       |    /* Spread symbols */
  523|  2.51k|    assert(tableSize <= 512);
  ------------------
  |  |   70|  2.51k|#    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|  2.51k|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (529:9): [True: 678, False: 1.83k]
  ------------------
  530|    678|        size_t const tableMask = tableSize-1;
  531|    678|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|    678|#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|    678|        {
  539|    678|            U64 const add = 0x0101010101010101ull;
  540|    678|            size_t pos = 0;
  541|    678|            U64 sv = 0;
  542|    678|            U32 s;
  543|  11.9k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (543:23): [True: 11.2k, False: 678]
  ------------------
  544|  11.2k|                int i;
  545|  11.2k|                int const n = normalizedCounter[s];
  546|  11.2k|                MEM_write64(spread + pos, sv);
  547|  19.5k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (547:29): [True: 8.35k, False: 11.2k]
  ------------------
  548|  8.35k|                    MEM_write64(spread + pos + i, sv);
  549|  8.35k|                }
  550|  11.2k|                assert(n>=0);
  ------------------
  |  |   70|  11.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  551|  11.2k|                pos += (size_t)n;
  552|  11.2k|            }
  553|    678|        }
  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|    678|        {
  561|    678|            size_t position = 0;
  562|    678|            size_t s;
  563|    678|            size_t const unroll = 2;
  564|    678|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|    678|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  565|  38.5k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (565:25): [True: 37.8k, False: 678]
  ------------------
  566|  37.8k|                size_t u;
  567|   113k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (567:29): [True: 75.6k, False: 37.8k]
  ------------------
  568|  75.6k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  569|  75.6k|                    tableDecode[uPosition].baseValue = spread[s + u];
  570|  75.6k|                }
  571|  37.8k|                position = (position + (unroll * step)) & tableMask;
  572|  37.8k|            }
  573|    678|            assert(position == 0);
  ------------------
  |  |   70|    678|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  574|    678|        }
  575|  1.83k|    } else {
  576|  1.83k|        U32 const tableMask = tableSize-1;
  577|  1.83k|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  1.83k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  578|  1.83k|        U32 s, position = 0;
  579|  29.1k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (579:19): [True: 27.3k, False: 1.83k]
  ------------------
  580|  27.3k|            int i;
  581|  27.3k|            int const n = normalizedCounter[s];
  582|   191k|            for (i=0; i<n; i++) {
  ------------------
  |  Branch (582:23): [True: 164k, False: 27.3k]
  ------------------
  583|   164k|                tableDecode[position].baseValue = s;
  584|   164k|                position = (position + step) & tableMask;
  585|   176k|                while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  |  188|   176k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 11.9k, False: 164k]
  |  |  ------------------
  ------------------
  586|   164k|        }   }
  587|  1.83k|        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   70|  1.83k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  588|  1.83k|    }
  589|       |
  590|       |    /* Build Decoding table */
  591|  2.51k|    {
  592|  2.51k|        U32 u;
  593|   254k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (593:19): [True: 252k, False: 2.51k]
  ------------------
  594|   252k|            U32 const symbol = tableDecode[u].baseValue;
  595|   252k|            U32 const nextState = symbolNext[symbol]++;
  596|   252k|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  597|   252k|            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  598|   252k|            assert(nbAdditionalBits[symbol] < 255);
  ------------------
  |  |   70|   252k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  599|   252k|            tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol];
  600|   252k|            tableDecode[u].baseValue = baseValue[symbol];
  601|   252k|        }
  602|  2.51k|    }
  603|  2.51k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_default:
  610|    344|{
  611|    344|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  612|    344|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  613|    344|}
zstd_decompress_block.c:ZSTD_buildSeqTable:
  654|  5.76k|{
  655|  5.76k|    switch(type)
  656|  5.76k|    {
  657|    259|    case set_rle :
  ------------------
  |  Branch (657:5): [True: 259, False: 5.50k]
  ------------------
  658|    259|        RETURN_ERROR_IF(!srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|    259|    do {                                                                       \
  |  |  115|    259|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 256]
  |  |  ------------------
  |  |  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|    259|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 256]
  |  |  ------------------
  ------------------
  659|    256|        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, "");
  ------------------
  |  |  114|    256|    do {                                                                       \
  |  |  115|    256|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 251]
  |  |  ------------------
  |  |  116|      5|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      5|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      5|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      5|    do {                                           \
  |  |  |  |   99|      5|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      5|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      5|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      5|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      5|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      5|        }                                                                      \
  |  |  123|    256|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 251]
  |  |  ------------------
  ------------------
  660|    251|        {   U32 const symbol = *(const BYTE*)src;
  661|    251|            U32 const baseline = baseValue[symbol];
  662|    251|            U8 const nbBits = nbAdditionalBits[symbol];
  663|    251|            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
  664|    251|        }
  665|    251|        *DTablePtr = DTableSpace;
  666|    251|        return 1;
  667|  3.26k|    case set_basic :
  ------------------
  |  Branch (667:5): [True: 3.26k, False: 2.50k]
  ------------------
  668|  3.26k|        *DTablePtr = defaultTable;
  669|  3.26k|        return 0;
  670|     61|    case set_repeat:
  ------------------
  |  Branch (670:5): [True: 61, False: 5.70k]
  ------------------
  671|     61|        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, "");
  ------------------
  |  |  114|     61|    do {                                                                       \
  |  |  115|     61|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 56]
  |  |  ------------------
  |  |  116|      5|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      5|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      5|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      5|    do {                                           \
  |  |  |  |   99|      5|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      5|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      5|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      5|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      5|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      5|        }                                                                      \
  |  |  123|     61|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 56]
  |  |  ------------------
  ------------------
  672|       |        /* prefetch FSE table if used */
  673|     56|        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {
  ------------------
  |  Branch (673:13): [True: 0, False: 56]
  |  Branch (673:28): [True: 0, False: 0]
  ------------------
  674|      0|            const void* const pStart = *DTablePtr;
  675|      0|            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));
  ------------------
  |  |   74|      0| #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
  ------------------
  676|      0|            PREFETCH_AREA(pStart, pSize);
  ------------------
  |  |  159|      0|    do {                                                 \
  |  |  160|      0|        const char* const _ptr = (const char*)(p);       \
  |  |  161|      0|        size_t const _size = (size_t)(s);                \
  |  |  162|      0|        size_t _pos;                                     \
  |  |  163|      0|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|      0|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  164|      0|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|      0|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|      0|        }                                                \
  |  |  166|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  677|      0|        }
  678|     56|        return 0;
  679|  2.18k|    case set_compressed :
  ------------------
  |  Branch (679:5): [True: 2.18k, False: 3.58k]
  ------------------
  680|  2.18k|        {   unsigned tableLog;
  681|  2.18k|            S16 norm[MaxSeq+1];
  682|  2.18k|            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
  683|  2.18k|            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, "");
  ------------------
  |  |  114|  2.18k|    do {                                                                       \
  |  |  115|  2.18k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 12, False: 2.17k]
  |  |  ------------------
  |  |  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|  2.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.17k]
  |  |  ------------------
  ------------------
  684|  2.17k|            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, "");
  ------------------
  |  |  114|  2.17k|    do {                                                                       \
  |  |  115|  2.17k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 2.16k]
  |  |  ------------------
  |  |  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|  2.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.16k]
  |  |  ------------------
  ------------------
  685|  2.16k|            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);
  686|  2.16k|            *DTablePtr = DTableSpace;
  687|  2.16k|            return headerSize;
  688|  2.17k|        }
  689|      0|    default :
  ------------------
  |  Branch (689:5): [True: 0, False: 5.76k]
  ------------------
  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|  5.76k|    }
  693|  5.76k|}
zstd_decompress_block.c:ZSTD_buildSeqTable_rle:
  464|    251|{
  465|    251|    void* ptr = dt;
  466|    251|    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;
  467|    251|    ZSTD_seqSymbol* const cell = dt + 1;
  468|       |
  469|    251|    DTableH->tableLog = 0;
  470|    251|    DTableH->fastMode = 0;
  471|       |
  472|    251|    cell->nbBits = 0;
  473|    251|    cell->nextState = 0;
  474|    251|    assert(nbAddBits < 255);
  ------------------
  |  |   70|    251|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  475|    251|    cell->nbAdditionalBits = nbAddBits;
  476|    251|    cell->baseValue = baseValue;
  477|    251|}
zstd_decompress_block.c:ZSTD_blockSizeMax:
   55|  12.3k|{
   56|  12.3k|    size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX;
  ------------------
  |  |  148|  12.3k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|      0|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  |  Branch (56:33): [True: 12.3k, False: 0]
  ------------------
   57|  12.3k|    assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   70|  12.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   58|  12.3k|    return blockSizeMax;
   59|  12.3k|}
zstd_decompress_block.c:ZSTD_totalHistorySize:
 1997|  2.11k|{
 1998|  2.11k|    return (size_t)(op - virtualStart);
 1999|  2.11k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong:
 1979|    876|{
 1980|    876|    DEBUGLOG(5, "ZSTD_decompressSequencesLong");
  ------------------
  |  |  104|    876|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 876]
  |  |  ------------------
  ------------------
 1981|    876|#if DYNAMIC_BMI2
 1982|    876|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1982:9): [True: 876, False: 0]
  ------------------
 1983|    876|        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1984|    876|    }
 1985|      0|#endif
 1986|      0|  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1987|    876|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_bmi2:
 1931|    876|{
 1932|    876|    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1933|    876|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_body:
 1738|    876|{
 1739|    876|    const BYTE* ip = (const BYTE*)seqStart;
 1740|    876|    const BYTE* const iend = ip + seqSize;
 1741|    876|    BYTE* const ostart = (BYTE*)dst;
 1742|    876|    BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
  ------------------
  |  Branch (1742:24): [True: 88, False: 788]
  ------------------
 1743|    876|    BYTE* op = ostart;
 1744|    876|    const BYTE* litPtr = dctx->litPtr;
 1745|    876|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1746|    876|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1747|    876|    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);
 1748|    876|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1749|       |
 1750|       |    /* Regen sequences */
 1751|    876|    if (nbSeq) {
  ------------------
  |  Branch (1751:9): [True: 875, False: 1]
  ------------------
 1752|    875|#define STORED_SEQS 8
 1753|    875|#define STORED_SEQS_MASK (STORED_SEQS-1)
 1754|    875|#define ADVANCED_SEQS STORED_SEQS
 1755|    875|        seq_t sequences[STORED_SEQS];
 1756|    875|        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);
  ------------------
  |  |   54|    875|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 19, False: 856]
  |  |  ------------------
  ------------------
 1757|    875|        seqState_t seqState;
 1758|    875|        int seqNb;
 1759|    875|        size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */
 1760|       |
 1761|    875|        dctx->fseEntropy = 1;
 1762|  3.50k|        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  3.50k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1762:28): [True: 2.62k, False: 875]
  ------------------
 1763|    875|        assert(dst != NULL);
  ------------------
  |  |   70|    875|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1764|    875|        assert(iend >= ip);
  ------------------
  |  |   70|    875|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1765|    875|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    875|    do {                                                                       \
  |  |  115|    875|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 48, False: 827]
  |  |  ------------------
  |  |  116|     48|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     48|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     48|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     48|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     48|    do {                                           \
  |  |  |  |   99|     48|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     48|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     48|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     48|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     48|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     48|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     48|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     48|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     48|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     48|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     48|        }                                                                      \
  |  |  123|    875|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 827]
  |  |  ------------------
  ------------------
 1766|    875|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1767|    875|            corruption_detected, "");
 1768|    827|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1769|    827|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1770|    827|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1771|       |
 1772|       |        /* prepare in advance */
 1773|  7.38k|        for (seqNb=0; seqNb<seqAdvance; seqNb++) {
  ------------------
  |  Branch (1773:23): [True: 6.56k, False: 827]
  ------------------
 1774|  6.56k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1775|  6.56k|            prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1776|  6.56k|            sequences[seqNb] = sequence;
 1777|  6.56k|        }
 1778|       |
 1779|       |        /* decompress without stomping litBuffer */
 1780|   798k|        for (; seqNb < nbSeq; seqNb++) {
  ------------------
  |  Branch (1780:16): [True: 798k, False: 262]
  ------------------
 1781|   798k|            seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1782|       |
 1783|   798k|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1754|   491k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   491k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                          if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1753|   491k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   491k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
  |  Branch (1783:17): [True: 491k, False: 306k]
  |  Branch (1783:58): [True: 350, False: 491k]
  ------------------
 1784|       |                /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */
 1785|    350|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1786|    350|                if (leftoverLit)
  ------------------
  |  Branch (1786:21): [True: 346, False: 4]
  ------------------
 1787|    346|                {
 1788|    346|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    346|    do {                                                                       \
  |  |  115|    346|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 15, False: 331]
  |  |  ------------------
  |  |  116|     15|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     15|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     15|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     15|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     15|    do {                                           \
  |  |  |  |   99|     15|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 15]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     15|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     15|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     15|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     15|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     15|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     15|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     15|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     15|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     15|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     15|        }                                                                      \
  |  |  123|    346|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 331]
  |  |  ------------------
  ------------------
 1789|    331|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1790|    331|                    sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1754|    331|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    331|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1753|    331|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    331|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1791|    331|                    op += leftoverLit;
 1792|    331|                }
 1793|    335|                litPtr = dctx->litExtraBuffer;
 1794|    335|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    335|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    335|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    670|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 335]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 335, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1795|    335|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1796|    335|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|    335|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    335|#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|    335|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    335|#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|    335|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    335|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1801:25): [True: 51, False: 284]
  ------------------
 1802|       |
 1803|    284|                    prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1804|    284|                    sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|    284|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    284|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1805|    284|                    op += oneSeqSize;
 1806|    284|            }   }
 1807|   798k|            else
 1808|   798k|            {
 1809|       |                /* lit buffer is either wholly contained in first or second split, or not split at all*/
 1810|   798k|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1810:43): [True: 491k, False: 306k]
  ------------------
 1811|   491k|                    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|   491k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   491k|#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|   491k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   491k|#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|   491k|#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|   491k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   491k|#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|   491k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   491k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1812|   798k|                    ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|   306k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   306k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1753|   306k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   306k|#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|   798k|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|   798k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1817:21): [True: 499, False: 797k]
  ------------------
 1818|       |
 1819|   797k|                prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1820|   797k|                sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|   797k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   797k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1821|   797k|                op += oneSeqSize;
 1822|   797k|            }
 1823|   798k|        }
 1824|    262|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|    262|    do {                                                                       \
  |  |  115|    262|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 252]
  |  |  ------------------
  |  |  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|    262|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 252]
  |  |  ------------------
  ------------------
 1825|       |
 1826|       |        /* finish queue */
 1827|    252|        seqNb -= seqAdvance;
 1828|  1.56k|        for ( ; seqNb<nbSeq ; seqNb++) {
  ------------------
  |  Branch (1828:17): [True: 1.46k, False: 105]
  ------------------
 1829|  1.46k|            seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]);
  ------------------
  |  | 1753|  1.46k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.46k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1830|  1.46k|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) {
  ------------------
  |  Branch (1830:17): [True: 914, False: 548]
  |  Branch (1830:58): [True: 126, False: 788]
  ------------------
 1831|    126|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1832|    126|                if (leftoverLit) {
  ------------------
  |  Branch (1832:21): [True: 125, False: 1]
  ------------------
 1833|    125|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    125|    do {                                                                       \
  |  |  115|    125|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 124]
  |  |  ------------------
  |  |  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|    125|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 124]
  |  |  ------------------
  ------------------
 1834|    124|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1835|    124|                    sequence->litLength -= leftoverLit;
 1836|    124|                    op += leftoverLit;
 1837|    124|                }
 1838|    125|                litPtr = dctx->litExtraBuffer;
 1839|    125|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    125|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    125|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    250|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 125]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 125, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1840|    125|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1841|    125|                {   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|    125|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    125|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1846:25): [True: 31, False: 94]
  ------------------
 1847|     94|                    op += oneSeqSize;
 1848|     94|                }
 1849|     94|            }
 1850|  1.33k|            else
 1851|  1.33k|            {
 1852|  1.33k|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1852:43): [True: 788, False: 548]
  ------------------
 1853|    788|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|    788|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1854|  1.33k|                    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|  1.33k|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|  1.33k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1859:21): [True: 115, False: 1.22k]
  ------------------
 1860|  1.22k|                op += oneSeqSize;
 1861|  1.22k|            }
 1862|  1.46k|        }
 1863|       |
 1864|       |        /* save reps for next block */
 1865|    420|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    420|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1865:28): [True: 315, False: 105]
  ------------------
 1866|    105|    }
 1867|       |
 1868|       |    /* last literal segment */
 1869|    106|    if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */
  ------------------
  |  Branch (1869:9): [True: 30, False: 76]
  ------------------
 1870|     30|        size_t const lastLLSize = litBufferEnd - litPtr;
 1871|     30|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  114|     30|    do {                                                                       \
  |  |  115|     30|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8, False: 22]
  |  |  ------------------
  |  |  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|     30|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 22]
  |  |  ------------------
  ------------------
 1872|     22|        if (op != NULL) {
  ------------------
  |  Branch (1872:13): [True: 22, False: 0]
  ------------------
 1873|     22|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|     22|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1874|     22|            op += lastLLSize;
 1875|     22|        }
 1876|     22|        litPtr = dctx->litExtraBuffer;
 1877|     22|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|     22|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|     22|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     44|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 22]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 22, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1878|     22|    }
 1879|     98|    {   size_t const lastLLSize = litBufferEnd - litPtr;
 1880|     98|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|     98|    do {                                                                       \
  |  |  115|     98|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 14, False: 84]
  |  |  ------------------
  |  |  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|     98|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 84]
  |  |  ------------------
  ------------------
 1881|     84|        if (op != NULL) {
  ------------------
  |  Branch (1881:13): [True: 84, False: 0]
  ------------------
 1882|     84|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|     84|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1883|     84|            op += lastLLSize;
 1884|     84|        }
 1885|     84|    }
 1886|       |
 1887|      0|    return (size_t)(op - ostart);
 1888|     98|}
zstd_decompress_block.c:ZSTD_initFseState:
 1193|  5.30k|{
 1194|  5.30k|    const void* ptr = dt;
 1195|  5.30k|    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;
 1196|  5.30k|    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
 1197|  5.30k|    DEBUGLOG(6, "ZSTD_initFseState : val=%u using %u bits",
  ------------------
  |  |  104|  5.30k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.30k]
  |  |  ------------------
  ------------------
 1198|  5.30k|                (U32)DStatePtr->state, DTableH->tableLog);
 1199|  5.30k|    BIT_reloadDStream(bitD);
 1200|  5.30k|    DStatePtr->table = dt + 1;
 1201|  5.30k|}
zstd_decompress_block.c:ZSTD_decodeSequence:
 1230|  2.30M|{
 1231|  2.30M|    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|  2.30M|    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;
 1250|  2.30M|    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
 1251|  2.30M|    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
 1252|  2.30M|#endif
 1253|  2.30M|    seq.matchLength = mlDInfo->baseValue;
 1254|  2.30M|    seq.litLength = llDInfo->baseValue;
 1255|  2.30M|    {   U32 const ofBase = ofDInfo->baseValue;
 1256|  2.30M|        BYTE const llBits = llDInfo->nbAdditionalBits;
 1257|  2.30M|        BYTE const mlBits = mlDInfo->nbAdditionalBits;
 1258|  2.30M|        BYTE const ofBits = ofDInfo->nbAdditionalBits;
 1259|  2.30M|        BYTE const totalBits = llBits+mlBits+ofBits;
 1260|       |
 1261|  2.30M|        U16 const llNext = llDInfo->nextState;
 1262|  2.30M|        U16 const mlNext = mlDInfo->nextState;
 1263|  2.30M|        U16 const ofNext = ofDInfo->nextState;
 1264|  2.30M|        U32 const llnbBits = llDInfo->nbBits;
 1265|  2.30M|        U32 const mlnbBits = mlDInfo->nbBits;
 1266|  2.30M|        U32 const ofnbBits = ofDInfo->nbBits;
 1267|       |
 1268|  2.30M|        assert(llBits <= MaxLLBits);
  ------------------
  |  |   70|  2.30M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1269|  2.30M|        assert(mlBits <= MaxMLBits);
  ------------------
  |  |   70|  2.30M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1270|  2.30M|        assert(ofBits <= MaxOff);
  ------------------
  |  |   70|  2.30M|#    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|  2.30M|        {   size_t offset;
 1279|  2.30M|            if (ofBits > 1) {
  ------------------
  |  Branch (1279:17): [True: 776k, False: 1.52M]
  ------------------
 1280|   776k|                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);
  ------------------
  |  |   43|   776k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   776k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1281|   776k|                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
  ------------------
  |  |   43|   776k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   776k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1282|   776k|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
  ------------------
  |  |   43|   776k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   776k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1283|   776k|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
  ------------------
  |  |   43|   776k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   776k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1284|   776k|                if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
  |  Branch (1284:21): [True: 0, False: 776k]
  |  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|   776k|                } else {
 1293|   776k|                    offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */
 1294|   776k|                    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
  ------------------
  |  Branch (1294:25): [True: 0, False: 776k]
  ------------------
 1295|   776k|                }
 1296|   776k|                seqState->prevOffset[2] = seqState->prevOffset[1];
 1297|   776k|                seqState->prevOffset[1] = seqState->prevOffset[0];
 1298|   776k|                seqState->prevOffset[0] = offset;
 1299|  1.52M|            } else {
 1300|  1.52M|                U32 const ll0 = (llDInfo->baseValue == 0);
 1301|  1.52M|                if (LIKELY((ofBits == 0))) {
  ------------------
  |  |  187|  1.52M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 1.22M, False: 298k]
  |  |  ------------------
  ------------------
 1302|  1.22M|                    offset = seqState->prevOffset[ll0];
 1303|  1.22M|                    seqState->prevOffset[1] = seqState->prevOffset[!ll0];
 1304|  1.22M|                    seqState->prevOffset[0] = offset;
 1305|  1.22M|                } else {
 1306|   298k|                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);
 1307|   298k|                    {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
  ------------------
  |  Branch (1307:39): [True: 14.2k, False: 283k]
  ------------------
 1308|   298k|                        temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */
 1309|   298k|                        if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (1309:29): [True: 185k, False: 112k]
  ------------------
 1310|   298k|                        seqState->prevOffset[1] = seqState->prevOffset[0];
 1311|   298k|                        seqState->prevOffset[0] = offset = temp;
 1312|   298k|            }   }   }
 1313|  2.30M|            seq.offset = offset;
 1314|  2.30M|        }
 1315|       |
 1316|  2.30M|        if (mlBits > 0)
  ------------------
  |  Branch (1316:13): [True: 114k, False: 2.18M]
  ------------------
 1317|   114k|            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);
 1318|       |
 1319|  2.30M|        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: 2.30M]
  |  Branch (1319:29): [True: 0, False: 0]
  ------------------
 1320|      0|            BIT_reloadDStream(&seqState->DStream);
 1321|  2.30M|        if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))
  ------------------
  |  |  188|  2.30M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 1.26k, False: 2.30M]
  |  |  ------------------
  ------------------
  |  Branch (1321:13): [True: 2.30M, False: 0]
  ------------------
 1322|  1.26k|            BIT_reloadDStream(&seqState->DStream);
 1323|       |        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */
 1324|  2.30M|        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);
  ------------------
  |  |   43|  2.30M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  2.30M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1325|       |
 1326|  2.30M|        if (llBits > 0)
  ------------------
  |  Branch (1326:13): [True: 240k, False: 2.06M]
  ------------------
 1327|   240k|            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
 1328|       |
 1329|  2.30M|        if (MEM_32bits())
  ------------------
  |  Branch (1329:13): [True: 0, False: 2.30M]
  ------------------
 1330|      0|            BIT_reloadDStream(&seqState->DStream);
 1331|       |
 1332|  2.30M|        DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
  ------------------
  |  |  104|  2.30M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.30M]
  |  |  ------------------
  ------------------
 1333|  2.30M|                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
 1334|       |
 1335|  2.30M|        if (!isLastSeq) {
  ------------------
  |  Branch (1335:13): [True: 2.30M, False: 455]
  ------------------
 1336|       |            /* don't update FSE state for last Sequence */
 1337|  2.30M|            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits);    /* <=  9 bits */
 1338|  2.30M|            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits);    /* <=  9 bits */
 1339|  2.30M|            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */
  ------------------
  |  Branch (1339:17): [True: 0, False: 2.30M]
  ------------------
 1340|  2.30M|            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits);  /* <=  8 bits */
 1341|  2.30M|            BIT_reloadDStream(&seqState->DStream);
 1342|  2.30M|        }
 1343|  2.30M|    }
 1344|       |
 1345|  2.30M|    return seq;
 1346|  2.30M|}
zstd_decompress_block.c:ZSTD_updateFseStateWithDInfo:
 1205|  6.90M|{
 1206|  6.90M|    size_t const lowBits = BIT_readBits(bitD, nbBits);
 1207|  6.90M|    DStatePtr->state = nextState + lowBits;
 1208|  6.90M|}
zstd_decompress_block.c:ZSTD_prefetchMatch:
 1717|   804k|{
 1718|   804k|    prefetchPos += sequence.litLength;
 1719|   804k|    {   const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart;
  ------------------
  |  Branch (1719:39): [True: 2.67k, False: 801k]
  ------------------
 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|   804k|        const BYTE* const match = ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, prefetchPos), sequence.offset);
 1723|   804k|        PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|   804k|#    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|   804k|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
 1724|   804k|    }
 1725|   804k|    return prefetchPos + sequence.matchLength;
 1726|   804k|}
zstd_decompress_block.c:ZSTD_safecopyDstBeforeSrc:
  877|   163k|static void ZSTD_safecopyDstBeforeSrc(BYTE* op, const BYTE* ip, ptrdiff_t length) {
  878|   163k|    ptrdiff_t const diff = op - ip;
  879|   163k|    BYTE* const oend = op + length;
  880|       |
  881|   163k|    if (length < 8 || diff > -8) {
  ------------------
  |  Branch (881:9): [True: 119k, False: 43.4k]
  |  Branch (881:23): [True: 42.5k, False: 937]
  ------------------
  882|       |        /* Handle short lengths, close overlaps, and dst not before src. */
  883|  5.10M|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (883:16): [True: 4.94M, False: 162k]
  ------------------
  884|   162k|        return;
  885|   162k|    }
  886|       |
  887|    937|    if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  199|  1.87k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  200|    665|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (887:9): [True: 665, False: 272]
  |  Branch (887:45): [True: 610, False: 55]
  ------------------
  888|    610|        ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap);
  ------------------
  |  |  199|    610|#define WILDCOPY_OVERLENGTH 32
  ------------------
  889|    610|        ip += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    610|#define WILDCOPY_OVERLENGTH 32
  ------------------
  890|    610|        op += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    610|#define WILDCOPY_OVERLENGTH 32
  ------------------
  891|    610|    }
  892|       |
  893|       |    /* Handle the leftovers. */
  894|   326k|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (894:12): [True: 325k, False: 937]
  ------------------
  895|    937|}
zstd_decompress_block.c:ZSTD_execSequence:
 1005|  1.43M|{
 1006|  1.43M|    BYTE* const oLitEnd = op + sequence.litLength;
 1007|  1.43M|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1008|  1.43M|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1009|  1.43M|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */
  ------------------
  |  |  199|  1.43M|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1010|  1.43M|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1011|  1.43M|    const BYTE* match = oLitEnd - sequence.offset;
 1012|       |
 1013|  1.43M|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1014|  1.43M|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|  1.43M|#    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|  1.43M|    if (UNLIKELY(
  ------------------
  |  |  188|  7.18M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 1.44k, False: 1.43M]
  |  |  |  Branch (188:40): [True: 197, False: 1.43M]
  |  |  |  Branch (188:40): [True: 1.24k, False: 1.43M]
  |  |  |  Branch (188:40): [True: 0, False: 1.43M]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1026|  1.43M|        iLitEnd > litLimit ||
 1027|  1.43M|        oMatchEnd > oend_w ||
 1028|  1.43M|        (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1029|  1.44k|        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1030|       |
 1031|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1032|  1.43M|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1033|  1.43M|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1034|  1.43M|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1035|  1.43M|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1036|  1.43M|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1037|  1.43M|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|  1.43M|#    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|  1.43M|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1044|  1.43M|    ZSTD_copy16(op, (*litPtr));
 1045|  1.43M|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|  1.43M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 80.3k, False: 1.35M]
  |  |  ------------------
  ------------------
 1046|  80.3k|        ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap);
 1047|  80.3k|    }
 1048|  1.43M|    op = oLitEnd;
 1049|  1.43M|    *litPtr = iLitEnd;   /* update for next sequence */
 1050|       |
 1051|       |    /* Copy Match */
 1052|  1.43M|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1052:9): [True: 1.03k, False: 1.43M]
  ------------------
 1053|       |        /* offset beyond prefix -> go into extDict */
 1054|  1.03k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  1.03k|    do {                                                                       \
  |  |  115|  1.03k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 407, False: 623]
  |  |  ------------------
  |  |  116|    407|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    407|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 407]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    407|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    407|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    407|    do {                                           \
  |  |  |  |   99|    407|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 407]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    407|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 407]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    407|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    407|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 407]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    407|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    407|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 407]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    407|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    407|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    407|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    407|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    407|        }                                                                      \
  |  |  123|  1.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 623]
  |  |  ------------------
  ------------------
 1055|    623|        match = dictEnd + (match - prefixStart);
 1056|    623|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1056:13): [True: 533, False: 90]
  ------------------
 1057|    533|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    533|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1058|    533|            return sequenceLength;
 1059|    533|        }
 1060|       |        /* span extDict & currentPrefixSegment */
 1061|     90|        {   size_t const length1 = dictEnd - match;
 1062|     90|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     90|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1063|     90|        op = oLitEnd + length1;
 1064|     90|        sequence.matchLength -= length1;
 1065|     90|        match = prefixStart;
 1066|     90|        }
 1067|     90|    }
 1068|       |    /* Match within prefix of 1 or more bytes */
 1069|  1.43M|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1070|  1.43M|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1071|  1.43M|    assert(match >= prefixStart);
  ------------------
  |  |   70|  1.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1072|  1.43M|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|  1.43M|#    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|  1.43M|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|  1.43M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 413k, False: 1.02M]
  |  |  ------------------
  ------------------
 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|   413k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1083|   413k|        return sequenceLength;
 1084|   413k|    }
 1085|  1.02M|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|  1.02M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1086|       |
 1087|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1088|  1.02M|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1089|       |
 1090|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1091|  1.02M|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1091:9): [True: 164k, False: 857k]
  ------------------
 1092|   164k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|   164k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1093|   164k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst);
 1094|   164k|    }
 1095|  1.02M|    return sequenceLength;
 1096|  1.43M|}
zstd_decompress_block.c:ZSTD_execSequenceEnd:
  911|  1.44k|{
  912|  1.44k|    BYTE* const oLitEnd = op + sequence.litLength;
  913|  1.44k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  914|  1.44k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  915|  1.44k|    const BYTE* match = oLitEnd - sequence.offset;
  916|  1.44k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  1.44k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  917|       |
  918|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  919|  1.44k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  1.44k|    do {                                                                       \
  |  |  115|  1.44k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 481, False: 962]
  |  |  ------------------
  |  |  116|    481|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    481|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 481]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    481|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    481|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    481|    do {                                           \
  |  |  |  |   99|    481|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 481]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    481|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 481]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    481|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    481|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 481]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    481|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    481|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 481]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    481|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    481|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    481|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    481|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    481|        }                                                                      \
  |  |  123|  1.44k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 962]
  |  |  ------------------
  ------------------
  920|    962|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|    962|    do {                                                                       \
  |  |  115|    962|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 145, False: 817]
  |  |  ------------------
  |  |  116|    145|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    145|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    145|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    145|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    145|    do {                                           \
  |  |  |  |   99|    145|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    145|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    145|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    145|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    145|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    145|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    145|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    145|        }                                                                      \
  |  |  123|    962|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 817]
  |  |  ------------------
  ------------------
  921|    817|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|    817|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  922|    817|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|    817|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  923|       |
  924|       |    /* copy literals */
  925|    817|    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);
  926|    817|    op = oLitEnd;
  927|    817|    *litPtr = iLitEnd;
  928|       |
  929|       |    /* copy Match */
  930|    817|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (930:9): [True: 89, False: 728]
  ------------------
  931|       |        /* offset beyond prefix */
  932|     89|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|     89|    do {                                                                       \
  |  |  115|     89|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 56, False: 33]
  |  |  ------------------
  |  |  116|     56|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     56|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     56|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     56|    do {                                           \
  |  |  |  |   99|     56|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     56|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     56|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     56|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     56|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     56|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     56|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     56|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     56|        }                                                                      \
  |  |  123|     89|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 33]
  |  |  ------------------
  ------------------
  933|     33|        match = dictEnd - (prefixStart - match);
  934|     33|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (934:13): [True: 26, False: 7]
  ------------------
  935|     26|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|     26|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  936|     26|            return sequenceLength;
  937|     26|        }
  938|       |        /* span extDict & currentPrefixSegment */
  939|      7|        {   size_t const length1 = dictEnd - match;
  940|      7|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|      7|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  941|      7|        op = oLitEnd + length1;
  942|      7|        sequence.matchLength -= length1;
  943|      7|        match = prefixStart;
  944|      7|        }
  945|      7|    }
  946|    735|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  947|    735|    return sequenceLength;
  948|    817|}
zstd_decompress_block.c:ZSTD_safecopy:
  837|   163k|static void ZSTD_safecopy(BYTE* op, const BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) {
  838|   163k|    ptrdiff_t const diff = op - ip;
  839|   163k|    BYTE* const oend = op + length;
  840|       |
  841|   163k|    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||
  ------------------
  |  |   70|   163k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  842|   163k|           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));
  843|       |
  844|   163k|    if (length < 8) {
  ------------------
  |  Branch (844:9): [True: 115k, False: 47.8k]
  ------------------
  845|       |        /* Handle short lengths. */
  846|   542k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (846:16): [True: 426k, False: 115k]
  ------------------
  847|   115k|        return;
  848|   115k|    }
  849|  47.8k|    if (ovtype == ZSTD_overlap_src_before_dst) {
  ------------------
  |  Branch (849:9): [True: 47.6k, False: 214]
  ------------------
  850|       |        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */
  851|  47.6k|        assert(length >= 8);
  ------------------
  |  |   70|  47.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  852|  47.6k|        ZSTD_overlapCopy8(&op, &ip, diff);
  853|  47.6k|        length -= 8;
  854|  47.6k|        assert(op - ip >= 8);
  ------------------
  |  |   70|  47.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  855|  47.6k|        assert(op <= oend);
  ------------------
  |  |   70|  47.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  856|  47.6k|    }
  857|       |
  858|  47.8k|    if (oend <= oend_w) {
  ------------------
  |  Branch (858:9): [True: 82, False: 47.7k]
  ------------------
  859|       |        /* No risk of overwrite. */
  860|     82|        ZSTD_wildcopy(op, ip, length, ovtype);
  861|     82|        return;
  862|     82|    }
  863|  47.7k|    if (op <= oend_w) {
  ------------------
  |  Branch (863:9): [True: 531, False: 47.2k]
  ------------------
  864|       |        /* Wildcopy until we get close to the end. */
  865|    531|        assert(oend > oend_w);
  ------------------
  |  |   70|    531|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  866|    531|        ZSTD_wildcopy(op, ip, oend_w - op, ovtype);
  867|    531|        ip += oend_w - op;
  868|    531|        op += oend_w - op;
  869|    531|    }
  870|       |    /* Handle the leftovers. */
  871|  11.7M|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (871:12): [True: 11.7M, False: 47.7k]
  ------------------
  872|  47.7k|}
zstd_decompress_block.c:ZSTD_overlapCopy8:
  804|  1.51M|HINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) {
  805|  1.51M|    assert(*ip <= *op);
  ------------------
  |  |   70|  1.51M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  806|  1.51M|    if (offset < 8) {
  ------------------
  |  Branch (806:9): [True: 1.27M, False: 240k]
  ------------------
  807|       |        /* close range match, overlap */
  808|  1.27M|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
  809|  1.27M|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
  810|  1.27M|        int const sub2 = dec64table[offset];
  811|  1.27M|        (*op)[0] = (*ip)[0];
  812|  1.27M|        (*op)[1] = (*ip)[1];
  813|  1.27M|        (*op)[2] = (*ip)[2];
  814|  1.27M|        (*op)[3] = (*ip)[3];
  815|  1.27M|        *ip += dec32table[offset];
  816|  1.27M|        ZSTD_copy4(*op+4, *ip);
  817|  1.27M|        *ip -= sub2;
  818|  1.27M|    } else {
  819|   240k|        ZSTD_copy8(*op, *ip);
  820|   240k|    }
  821|  1.51M|    *ip += 8;
  822|  1.51M|    *op += 8;
  823|  1.51M|    assert(*op - *ip >= 8);
  ------------------
  |  |   70|  1.51M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  824|  1.51M|}
zstd_decompress_block.c:ZSTD_copy4:
   47|  1.27M|static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }
  ------------------
  |  |   44|  1.27M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
zstd_decompress_block.c:ZSTD_execSequenceSplitLitBuffer:
 1104|   859k|{
 1105|   859k|    BYTE* const oLitEnd = op + sequence.litLength;
 1106|   859k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1107|   859k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1108|   859k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1109|   859k|    const BYTE* match = oLitEnd - sequence.offset;
 1110|       |
 1111|   859k|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|   859k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1112|   859k|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|   859k|#    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|   859k|    if (UNLIKELY(
  ------------------
  |  |  188|  3.97M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 162k, False: 696k]
  |  |  |  Branch (188:40): [True: 0, False: 859k]
  |  |  |  Branch (188:40): [True: 162k, False: 696k]
  |  |  |  Branch (188:40): [True: 0, False: 696k]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1119|   859k|            iLitEnd > litLimit ||
 1120|   859k|            oMatchEnd > oend_w ||
 1121|   859k|            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1122|   162k|        return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1123|       |
 1124|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1125|   696k|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1126|   696k|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1127|   696k|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1128|   696k|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1129|   696k|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1130|   696k|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|   696k|#    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|   696k|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1137|   696k|    ZSTD_copy16(op, (*litPtr));
 1138|   696k|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|   696k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 54.5k, False: 642k]
  |  |  ------------------
  ------------------
 1139|  54.5k|        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);
 1140|  54.5k|    }
 1141|   696k|    op = oLitEnd;
 1142|   696k|    *litPtr = iLitEnd;   /* update for next sequence */
 1143|       |
 1144|       |    /* Copy Match */
 1145|   696k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1145:9): [True: 751, False: 696k]
  ------------------
 1146|       |        /* offset beyond prefix -> go into extDict */
 1147|    751|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|    751|    do {                                                                       \
  |  |  115|    751|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 202, False: 549]
  |  |  ------------------
  |  |  116|    202|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    202|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 202]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    202|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    202|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    202|    do {                                           \
  |  |  |  |   99|    202|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 202]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    202|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 202]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    202|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    202|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 202]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    202|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    202|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 202]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    202|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    202|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    202|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    202|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    202|        }                                                                      \
  |  |  123|    751|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 549]
  |  |  ------------------
  ------------------
 1148|    549|        match = dictEnd + (match - prefixStart);
 1149|    549|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1149:13): [True: 425, False: 124]
  ------------------
 1150|    425|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    425|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1151|    425|            return sequenceLength;
 1152|    425|        }
 1153|       |        /* span extDict & currentPrefixSegment */
 1154|    124|        {   size_t const length1 = dictEnd - match;
 1155|    124|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    124|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1156|    124|            op = oLitEnd + length1;
 1157|    124|            sequence.matchLength -= length1;
 1158|    124|            match = prefixStart;
 1159|    124|    }   }
 1160|       |    /* Match within prefix of 1 or more bytes */
 1161|   696k|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1162|   696k|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1163|   696k|    assert(match >= prefixStart);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1164|   696k|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|   696k|#    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|   696k|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|   696k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 246k, False: 449k]
  |  |  ------------------
  ------------------
 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|   246k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1175|   246k|        return sequenceLength;
 1176|   246k|    }
 1177|   449k|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|   449k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1178|       |
 1179|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1180|   449k|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1181|       |
 1182|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1183|   449k|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1183:9): [True: 73.0k, False: 376k]
  ------------------
 1184|  73.0k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|  73.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1185|  73.0k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst);
 1186|  73.0k|    }
 1187|   449k|    return sequenceLength;
 1188|   696k|}
zstd_decompress_block.c:ZSTD_execSequenceEndSplitLitBuffer:
  959|   162k|{
  960|   162k|    BYTE* const oLitEnd = op + sequence.litLength;
  961|   162k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  962|   162k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  963|   162k|    const BYTE* match = oLitEnd - sequence.offset;
  964|       |
  965|       |
  966|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  967|   162k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|   162k|    do {                                                                       \
  |  |  115|   162k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 60, False: 162k]
  |  |  ------------------
  |  |  116|     60|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     60|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     60|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     60|    do {                                           \
  |  |  |  |   99|     60|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     60|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     60|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     60|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     60|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     60|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     60|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     60|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     60|        }                                                                      \
  |  |  123|   162k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 162k]
  |  |  ------------------
  ------------------
  968|   162k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|   162k|    do {                                                                       \
  |  |  115|   162k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 162k]
  |  |  ------------------
  |  |  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|   162k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 162k]
  |  |  ------------------
  ------------------
  969|   162k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|   162k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  970|   162k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|   162k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  971|       |
  972|       |    /* copy literals */
  973|   162k|    RETURN_ERROR_IF(op > *litPtr && op < *litPtr + sequence.litLength, dstSize_tooSmall, "output should not catch up to and overwrite literal buffer");
  ------------------
  |  |  114|   162k|    do {                                                                       \
  |  |  115|   486k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 161k, False: 737]
  |  |  |  Branch (115:13): [True: 30, False: 161k]
  |  |  ------------------
  |  |  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|   162k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 162k]
  |  |  ------------------
  ------------------
  974|   162k|    ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength);
  975|   162k|    op = oLitEnd;
  976|   162k|    *litPtr = iLitEnd;
  977|       |
  978|       |    /* copy Match */
  979|   162k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (979:9): [True: 97, False: 162k]
  ------------------
  980|       |        /* offset beyond prefix */
  981|     97|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|     97|    do {                                                                       \
  |  |  115|     97|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 58, False: 39]
  |  |  ------------------
  |  |  116|     58|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     58|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     58|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     58|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     58|    do {                                           \
  |  |  |  |   99|     58|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     58|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     58|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     58|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     58|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     58|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     58|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     58|        }                                                                      \
  |  |  123|     97|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 39]
  |  |  ------------------
  ------------------
  982|     39|        match = dictEnd - (prefixStart - match);
  983|     39|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (983:13): [True: 27, False: 12]
  ------------------
  984|     27|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|     27|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  985|     27|            return sequenceLength;
  986|     27|        }
  987|       |        /* span extDict & currentPrefixSegment */
  988|     12|        {   size_t const length1 = dictEnd - match;
  989|     12|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     12|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  990|     12|        op = oLitEnd + length1;
  991|     12|        sequence.matchLength -= length1;
  992|     12|        match = prefixStart;
  993|     12|        }
  994|     12|    }
  995|   162k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  996|   162k|    return sequenceLength;
  997|   162k|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer:
 1956|    545|{
 1957|    545|    DEBUGLOG(5, "ZSTD_decompressSequencesSplitLitBuffer");
  ------------------
  |  |  104|    545|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 545]
  |  |  ------------------
  ------------------
 1958|    545|#if DYNAMIC_BMI2
 1959|    545|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1959:9): [True: 545, False: 0]
  ------------------
 1960|    545|        return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1961|    545|    }
 1962|      0|#endif
 1963|      0|    return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1964|    545|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer_bmi2:
 1920|    545|{
 1921|    545|    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1922|    545|}
zstd_decompress_block.c:ZSTD_decompressSequences_bodySplitLitBuffer:
 1407|    545|{
 1408|    545|    const BYTE* ip = (const BYTE*)seqStart;
 1409|    545|    const BYTE* const iend = ip + seqSize;
 1410|    545|    BYTE* const ostart = (BYTE*)dst;
 1411|    545|    BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
 1412|    545|    BYTE* op = ostart;
 1413|    545|    const BYTE* litPtr = dctx->litPtr;
 1414|    545|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1415|    545|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1416|    545|    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);
 1417|    545|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1418|    545|    DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)", nbSeq);
  ------------------
  |  |  104|    545|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 545]
  |  |  ------------------
  ------------------
 1419|       |
 1420|       |    /* Literals are split between internal buffer & output buffer */
 1421|    545|    if (nbSeq) {
  ------------------
  |  Branch (1421:9): [True: 544, False: 1]
  ------------------
 1422|    544|        seqState_t seqState;
 1423|    544|        dctx->fseEntropy = 1;
 1424|  2.17k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  2.17k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1424:28): [True: 1.63k, False: 544]
  ------------------
 1425|    544|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    544|    do {                                                                       \
  |  |  115|    544|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 29, False: 515]
  |  |  ------------------
  |  |  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|    544|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 515]
  |  |  ------------------
  ------------------
 1426|    544|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1427|    544|            corruption_detected, "");
 1428|    515|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1429|    515|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1430|    515|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1431|    515|        assert(dst != NULL);
  ------------------
  |  |   70|    515|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1432|       |
 1433|    515|        ZSTD_STATIC_ASSERT(
  ------------------
  |  |   43|    515|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    515|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1434|    515|                BIT_DStream_unfinished < BIT_DStream_completed &&
 1435|    515|                BIT_DStream_endOfBuffer < BIT_DStream_completed &&
 1436|    515|                BIT_DStream_completed < BIT_DStream_overflow);
 1437|       |
 1438|       |        /* decompress without overrunning litPtr begins */
 1439|    515|        {   seq_t sequence = {0,0,0};  /* some static analyzer believe that @sequence is not initialized (it necessarily is, since for(;;) loop as at least one iteration) */
 1440|       |            /* Align the decompression loop to 32 + 16 bytes.
 1441|       |                *
 1442|       |                * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression
 1443|       |                * speed swings based on the alignment of the decompression loop. This
 1444|       |                * performance swing is caused by parts of the decompression loop falling
 1445|       |                * out of the DSB. The entire decompression loop should fit in the DSB,
 1446|       |                * when it can't we get much worse performance. You can measure if you've
 1447|       |                * hit the good case or the bad case with this perf command for some
 1448|       |                * compressed file test.zst:
 1449|       |                *
 1450|       |                *   perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \
 1451|       |                *             -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst
 1452|       |                *
 1453|       |                * If you see most cycles served out of the MITE you've hit the bad case.
 1454|       |                * If you see most cycles served out of the DSB you've hit the good case.
 1455|       |                * If it is pretty even then you may be in an okay case.
 1456|       |                *
 1457|       |                * This issue has been reproduced on the following CPUs:
 1458|       |                *   - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9
 1459|       |                *               Use Instruments->Counters to get DSB/MITE cycles.
 1460|       |                *               I never got performance swings, but I was able to
 1461|       |                *               go from the good case of mostly DSB to half of the
 1462|       |                *               cycles served from MITE.
 1463|       |                *   - Coffeelake: Intel i9-9900k
 1464|       |                *   - Coffeelake: Intel i7-9700k
 1465|       |                *
 1466|       |                * I haven't been able to reproduce the instability or DSB misses on any
 1467|       |                * of the following CPUS:
 1468|       |                *   - Haswell
 1469|       |                *   - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH
 1470|       |                *   - Skylake
 1471|       |                *
 1472|       |                * Alignment is done for each of the three major decompression loops:
 1473|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - presplit section of the literal buffer
 1474|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - postsplit section of the literal buffer
 1475|       |                *   - ZSTD_decompressSequences_body
 1476|       |                * Alignment choices are made to minimize large swings on bad cases and influence on performance
 1477|       |                * from changes external to this code, rather than to overoptimize on the current commit.
 1478|       |                *
 1479|       |                * If you are seeing performance stability this script can help test.
 1480|       |                * It tests on 4 commits in zstd where I saw performance change.
 1481|       |                *
 1482|       |                *   https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4
 1483|       |                */
 1484|    515|#if defined(__GNUC__) && defined(__x86_64__)
 1485|    515|            __asm__(".p2align 6");
 1486|       |#  if __GNUC__ >= 7
 1487|       |	    /* good for gcc-7, gcc-9, and gcc-11 */
 1488|       |            __asm__("nop");
 1489|       |            __asm__(".p2align 5");
 1490|       |            __asm__("nop");
 1491|       |            __asm__(".p2align 4");
 1492|       |#    if __GNUC__ == 8 || __GNUC__ == 10
 1493|       |	    /* good for gcc-8 and gcc-10 */
 1494|       |            __asm__("nop");
 1495|       |            __asm__(".p2align 3");
 1496|       |#    endif
 1497|       |#  endif
 1498|    515|#endif
 1499|       |
 1500|       |            /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */
 1501|   367k|            for ( ; nbSeq; nbSeq--) {
  ------------------
  |  Branch (1501:21): [True: 367k, False: 14]
  ------------------
 1502|   367k|                sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1503|   367k|                if (litPtr + sequence.litLength > dctx->litBufferEnd) break;
  ------------------
  |  Branch (1503:21): [True: 367, False: 367k]
  ------------------
 1504|   367k|                {   size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
  ------------------
  |  |  199|   367k|#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|   367k|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   367k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 134, False: 367k]
  |  |  ------------------
  ------------------
 1510|    134|                        return oneSeqSize;
 1511|   367k|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   367k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 367k]
  |  |  ------------------
  ------------------
 1512|   367k|                    op += oneSeqSize;
 1513|   367k|            }   }
 1514|    381|            DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)");
  ------------------
  |  |  104|    381|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 381]
  |  |  ------------------
  ------------------
 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|    381|            if (nbSeq > 0) {
  ------------------
  |  Branch (1517:17): [True: 367, False: 14]
  ------------------
 1518|    367|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1519|    367|                DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit, sequence.litLength);
  ------------------
  |  |  104|    367|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 367]
  |  |  ------------------
  ------------------
 1520|    367|                if (leftoverLit) {
  ------------------
  |  Branch (1520:21): [True: 361, False: 6]
  ------------------
 1521|    361|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    361|    do {                                                                       \
  |  |  115|    361|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 352]
  |  |  ------------------
  |  |  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|    361|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 352]
  |  |  ------------------
  ------------------
 1522|    352|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1523|    352|                    sequence.litLength -= leftoverLit;
 1524|    352|                    op += leftoverLit;
 1525|    352|                }
 1526|    358|                litPtr = dctx->litExtraBuffer;
 1527|    358|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    358|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    358|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    716|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 358]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 358, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1528|    358|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1529|    358|                {   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|    358|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|    358|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 50, False: 308]
  |  |  ------------------
  ------------------
 1535|     50|                        return oneSeqSize;
 1536|    308|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|    308|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 308]
  |  |  ------------------
  ------------------
 1537|    308|                    op += oneSeqSize;
 1538|    308|                }
 1539|      0|                nbSeq--;
 1540|    308|            }
 1541|    381|        }
 1542|       |
 1543|    322|        if (nbSeq > 0) {
  ------------------
  |  Branch (1543:13): [True: 306, False: 16]
  ------------------
 1544|       |            /* there is remaining lit from extra buffer */
 1545|       |
 1546|    306|#if defined(__GNUC__) && defined(__x86_64__)
 1547|    306|            __asm__(".p2align 6");
 1548|    306|            __asm__("nop");
 1549|    306|#  if __GNUC__ != 7
 1550|       |            /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */
 1551|    306|            __asm__(".p2align 4");
 1552|    306|            __asm__("nop");
 1553|    306|            __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|    306|#endif
 1562|       |
 1563|   486k|            for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1563:21): [True: 486k, False: 9]
  ------------------
 1564|   486k|                seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1565|   486k|                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|   486k|                if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   486k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 297, False: 486k]
  |  |  ------------------
  ------------------
 1571|    297|                    return oneSeqSize;
 1572|   486k|                DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   486k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 486k]
  |  |  ------------------
  ------------------
 1573|   486k|                op += oneSeqSize;
 1574|   486k|            }
 1575|    306|        }
 1576|       |
 1577|       |        /* check if reached exact end */
 1578|     25|        DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer: after decode loop, remaining nbSeq : %i", nbSeq);
  ------------------
  |  |  104|     25|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 25]
  |  |  ------------------
  ------------------
 1579|     25|        RETURN_ERROR_IF(nbSeq, corruption_detected, "");
  ------------------
  |  |  114|     25|    do {                                                                       \
  |  |  115|     25|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 25]
  |  |  ------------------
  |  |  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|     25|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 25]
  |  |  ------------------
  ------------------
 1580|     25|        DEBUGLOG(5, "bitStream : start=%p, ptr=%p, bitsConsumed=%u", seqState.DStream.start, seqState.DStream.ptr, seqState.DStream.bitsConsumed);
  ------------------
  |  |  104|     25|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 25]
  |  |  ------------------
  ------------------
 1581|     25|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|     25|    do {                                                                       \
  |  |  115|     25|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 14, False: 11]
  |  |  ------------------
  |  |  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|     25|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1582|       |        /* save reps for next block */
 1583|     44|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|     44|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1583:28): [True: 33, False: 11]
  ------------------
 1584|     11|    }
 1585|       |
 1586|       |    /* last literal segment */
 1587|     12|    if (dctx->litBufferLocation == ZSTD_split) {
  ------------------
  |  Branch (1587:9): [True: 11, False: 1]
  ------------------
 1588|       |        /* split hasn't been reached yet, first get dst then copy litExtraBuffer */
 1589|     11|        size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1590|     11|        DEBUGLOG(6, "copy last literals from segment : %u", (U32)lastLLSize);
  ------------------
  |  |  104|     11|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1591|     11|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  114|     11|    do {                                                                       \
  |  |  115|     11|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 6]
  |  |  ------------------
  |  |  116|      5|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      5|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      5|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      5|    do {                                           \
  |  |  |  |   99|      5|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      5|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      5|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      5|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      5|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      5|        }                                                                      \
  |  |  123|     11|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1592|      6|        if (op != NULL) {
  ------------------
  |  Branch (1592:13): [True: 6, False: 0]
  ------------------
 1593|      6|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      6|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1594|      6|            op += lastLLSize;
 1595|      6|        }
 1596|      6|        litPtr = dctx->litExtraBuffer;
 1597|      6|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      6|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      6|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     12|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 6]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 6, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1598|      6|        dctx->litBufferLocation = ZSTD_not_in_dst;
 1599|      6|    }
 1600|       |    /* copy last literals from internal buffer */
 1601|      7|    {   size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1602|      7|        DEBUGLOG(6, "copy last literals from internal buffer : %u", (U32)lastLLSize);
  ------------------
  |  |  104|      7|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 7]
  |  |  ------------------
  ------------------
 1603|      7|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|      7|    do {                                                                       \
  |  |  115|      7|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 4]
  |  |  ------------------
  |  |  116|      3|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      3|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      3|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      3|    do {                                           \
  |  |  |  |   99|      3|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      3|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      3|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      3|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      3|        }                                                                      \
  |  |  123|      7|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1604|      4|        if (op != NULL) {
  ------------------
  |  Branch (1604:13): [True: 4, False: 0]
  ------------------
 1605|      4|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|      4|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1606|      4|            op += lastLLSize;
 1607|      4|    }   }
 1608|       |
 1609|      4|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|      4|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1610|      4|    return (size_t)(op - ostart);
 1611|      7|}
zstd_decompress_block.c:ZSTD_decompressSequences:
 1943|    611|{
 1944|    611|    DEBUGLOG(5, "ZSTD_decompressSequences");
  ------------------
  |  |  104|    611|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 611]
  |  |  ------------------
  ------------------
 1945|    611|#if DYNAMIC_BMI2
 1946|    611|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1946:9): [True: 611, False: 0]
  ------------------
 1947|    611|        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1948|    611|    }
 1949|      0|#endif
 1950|      0|    return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1951|    611|}
zstd_decompress_block.c:ZSTD_decompressSequences_bmi2:
 1911|    611|{
 1912|    611|    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1913|    611|}
zstd_decompress_block.c:ZSTD_decompressSequences_body:
 1619|    611|{
 1620|    611|    const BYTE* ip = (const BYTE*)seqStart;
 1621|    611|    const BYTE* const iend = ip + seqSize;
 1622|    611|    BYTE* const ostart = (BYTE*)dst;
 1623|    611|    BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDstSize) : dctx->litBuffer;
  ------------------
  |  Branch (1623:24): [True: 280, False: 331]
  ------------------
 1624|    611|    BYTE* op = ostart;
 1625|    611|    const BYTE* litPtr = dctx->litPtr;
 1626|    611|    const BYTE* const litEnd = litPtr + dctx->litSize;
 1627|    611|    const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart);
 1628|    611|    const BYTE* const vBase = (const BYTE*)(dctx->virtualStart);
 1629|    611|    const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd);
 1630|    611|    DEBUGLOG(5, "ZSTD_decompressSequences_body: nbSeq = %d", nbSeq);
  ------------------
  |  |  104|    611|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 611]
  |  |  ------------------
  ------------------
 1631|       |
 1632|       |    /* Regen sequences */
 1633|    611|    if (nbSeq) {
  ------------------
  |  Branch (1633:9): [True: 482, False: 129]
  ------------------
 1634|    482|        seqState_t seqState;
 1635|    482|        dctx->fseEntropy = 1;
 1636|  1.92k|        { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  1.92k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1636:30): [True: 1.44k, False: 482]
  ------------------
 1637|    482|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    482|    do {                                                                       \
  |  |  115|    482|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 56, False: 426]
  |  |  ------------------
  |  |  116|     56|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     56|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     56|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     56|    do {                                           \
  |  |  |  |   99|     56|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     56|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     56|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     56|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     56|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     56|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     56|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     56|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     56|        }                                                                      \
  |  |  123|    482|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 426]
  |  |  ------------------
  ------------------
 1638|    482|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)),
 1639|    482|            corruption_detected, "");
 1640|    426|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1641|    426|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1642|    426|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1643|    426|        assert(dst != NULL);
  ------------------
  |  |   70|    426|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1644|       |
 1645|    426|#if defined(__GNUC__) && defined(__x86_64__)
 1646|    426|            __asm__(".p2align 6");
 1647|    426|            __asm__("nop");
 1648|       |#  if __GNUC__ >= 7
 1649|       |            __asm__(".p2align 5");
 1650|       |            __asm__("nop");
 1651|       |            __asm__(".p2align 3");
 1652|       |#  else
 1653|    426|            __asm__(".p2align 4");
 1654|    426|            __asm__("nop");
 1655|    426|            __asm__(".p2align 3");
 1656|    426|#  endif
 1657|    426|#endif
 1658|       |
 1659|   642k|        for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1659:17): [True: 642k, False: 164]
  ------------------
 1660|   642k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1661|   642k|            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|   642k|            if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   642k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 262, False: 642k]
  |  |  ------------------
  ------------------
 1667|    262|                return oneSeqSize;
 1668|   642k|            DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   642k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 642k]
  |  |  ------------------
  ------------------
 1669|   642k|            op += oneSeqSize;
 1670|   642k|        }
 1671|       |
 1672|       |        /* check if reached exact end */
 1673|    164|        assert(nbSeq == 0);
  ------------------
  |  |   70|    164|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1674|    164|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|    164|    do {                                                                       \
  |  |  115|    164|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 155]
  |  |  ------------------
  |  |  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|    164|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 155]
  |  |  ------------------
  ------------------
 1675|       |        /* save reps for next block */
 1676|    620|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    620|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1676:28): [True: 465, False: 155]
  ------------------
 1677|    155|    }
 1678|       |
 1679|       |    /* last literal segment */
 1680|    284|    {   size_t const lastLLSize = (size_t)(litEnd - litPtr);
 1681|    284|        DEBUGLOG(6, "copy last literals : %u", (U32)lastLLSize);
  ------------------
  |  |  104|    284|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 284]
  |  |  ------------------
  ------------------
 1682|    284|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|    284|    do {                                                                       \
  |  |  115|    284|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 283]
  |  |  ------------------
  |  |  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|    284|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 283]
  |  |  ------------------
  ------------------
 1683|    283|        if (op != NULL) {
  ------------------
  |  Branch (1683:13): [True: 283, False: 0]
  ------------------
 1684|    283|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|    283|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1685|    283|            op += lastLLSize;
 1686|    283|    }   }
 1687|       |
 1688|    283|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|    283|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 283]
  |  |  ------------------
  ------------------
 1689|    283|    return (size_t)(op - ostart);
 1690|    284|}

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

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

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

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

FSEv07_isError:
 1134|    178|unsigned FSEv07_isError(size_t code) { return ERR_isError(code); }
HUFv07_isError:
 1142|  1.40k|unsigned HUFv07_isError(size_t code) { return ERR_isError(code); }
FSEv07_readNCount:
 1154|    588|{
 1155|    588|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1156|    588|    const BYTE* const iend = istart + hbSize;
 1157|    588|    const BYTE* ip = istart;
 1158|    588|    int nbBits;
 1159|    588|    int remaining;
 1160|    588|    int threshold;
 1161|    588|    U32 bitStream;
 1162|    588|    int bitCount;
 1163|    588|    unsigned charnum = 0;
 1164|    588|    int previous0 = 0;
 1165|       |
 1166|    588|    if (hbSize < 4) 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 (1166:9): [True: 2, False: 586]
  ------------------
 1167|    586|    bitStream = MEM_readLE32(ip);
 1168|    586|    nbBits = (bitStream & 0xF) + FSEv07_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  |  903|    586|#define FSEv07_MIN_TABLELOG 5
  ------------------
 1169|    586|    if (nbBits > FSEv07_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  905|    586|#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: 583]
  ------------------
 1170|    583|    bitStream >>= 4;
 1171|    583|    bitCount = 4;
 1172|    583|    *tableLogPtr = nbBits;
 1173|    583|    remaining = (1<<nbBits)+1;
 1174|    583|    threshold = 1<<nbBits;
 1175|    583|    nbBits++;
 1176|       |
 1177|  9.21k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1177:12): [True: 8.65k, False: 564]
  |  Branch (1177:29): [True: 8.64k, False: 7]
  ------------------
 1178|  8.64k|        if (previous0) {
  ------------------
  |  Branch (1178:13): [True: 1.23k, False: 7.41k]
  ------------------
 1179|  1.23k|            unsigned n0 = charnum;
 1180|  1.35k|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1180:20): [True: 122, False: 1.23k]
  ------------------
 1181|    122|                n0+=24;
 1182|    122|                if (ip < iend-5) {
  ------------------
  |  Branch (1182:21): [True: 102, False: 20]
  ------------------
 1183|    102|                    ip+=2;
 1184|    102|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1185|    102|                } else {
 1186|     20|                    bitStream >>= 16;
 1187|     20|                    bitCount+=16;
 1188|     20|            }   }
 1189|  1.60k|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1189:20): [True: 372, False: 1.23k]
  ------------------
 1190|    372|                n0+=3;
 1191|    372|                bitStream>>=2;
 1192|    372|                bitCount+=2;
 1193|    372|            }
 1194|  1.23k|            n0 += bitStream & 3;
 1195|  1.23k|            bitCount += 2;
 1196|  1.23k|            if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1196:17): [True: 12, False: 1.22k]
  ------------------
 1197|  3.66k|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1197:20): [True: 2.43k, False: 1.22k]
  ------------------
 1198|  1.22k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1198:17): [True: 562, False: 661]
  |  Branch (1198:35): [True: 55, False: 606]
  ------------------
 1199|    617|                ip += bitCount>>3;
 1200|    617|                bitCount &= 7;
 1201|    617|                bitStream = MEM_readLE32(ip) >> bitCount;
 1202|    617|            }
 1203|    606|            else
 1204|    606|                bitStream >>= 2;
 1205|  1.22k|        }
 1206|  8.63k|        {   short const max = (short)((2*threshold-1)-remaining);
 1207|  8.63k|            short count;
 1208|       |
 1209|  8.63k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1209:17): [True: 6.01k, False: 2.62k]
  ------------------
 1210|  6.01k|                count = (short)(bitStream & (threshold-1));
 1211|  6.01k|                bitCount   += nbBits-1;
 1212|  6.01k|            } else {
 1213|  2.62k|                count = (short)(bitStream & (2*threshold-1));
 1214|  2.62k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1214:21): [True: 861, False: 1.75k]
  ------------------
 1215|  2.62k|                bitCount   += nbBits;
 1216|  2.62k|            }
 1217|       |
 1218|  8.63k|            count--;   /* extra accuracy */
 1219|  8.63k|            remaining -= FSEv07_abs(count);
 1220|  8.63k|            normalizedCounter[charnum++] = count;
 1221|  8.63k|            previous0 = !count;
 1222|  12.9k|            while (remaining < threshold) {
  ------------------
  |  Branch (1222:20): [True: 4.28k, False: 8.63k]
  ------------------
 1223|  4.28k|                nbBits--;
 1224|  4.28k|                threshold >>= 1;
 1225|  4.28k|            }
 1226|       |
 1227|  8.63k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1227:17): [True: 6.61k, False: 2.01k]
  |  Branch (1227:35): [True: 381, False: 1.63k]
  ------------------
 1228|  6.99k|                ip += bitCount>>3;
 1229|  6.99k|                bitCount &= 7;
 1230|  6.99k|            } else {
 1231|  1.63k|                bitCount -= (int)(8 * (iend - 4 - ip));
 1232|  1.63k|                ip = iend - 4;
 1233|  1.63k|            }
 1234|  8.63k|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1235|  8.63k|    }   }   /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
 1236|    571|    if (remaining != 1) return ERROR(GENERIC);
  ------------------
  |  |   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 (1236:9): [True: 7, False: 564]
  ------------------
 1237|    564|    *maxSVPtr = charnum-1;
 1238|       |
 1239|    564|    ip += (bitCount+7)>>3;
 1240|    564|    if ((size_t)(ip-istart) > hbSize) 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 (1240:9): [True: 11, False: 553]
  ------------------
 1241|    553|    return ip-istart;
 1242|    564|}
HUFv07_readStats:
 1254|    399|{
 1255|    399|    U32 weightTotal;
 1256|    399|    const BYTE* ip = (const BYTE*) src;
 1257|    399|    size_t iSize;
 1258|    399|    size_t oSize;
 1259|       |
 1260|    399|    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: 398]
  ------------------
 1261|    398|    iSize = ip[0];
 1262|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1263|       |
 1264|    398|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1264:9): [True: 217, False: 181]
  ------------------
 1265|    217|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1265:13): [True: 31, False: 186]
  ------------------
 1266|     31|            static U32 l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1267|     31|            oSize = l[iSize-242];
 1268|     31|            memset(huffWeight, 1, hwSize);
 1269|     31|            iSize = 0;
 1270|     31|        }
 1271|    186|        else {   /* Incompressible */
 1272|    186|            oSize = iSize - 127;
 1273|    186|            iSize = ((oSize+1)/2);
 1274|    186|            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 (1274:17): [True: 2, False: 184]
  ------------------
 1275|    184|            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: 184]
  ------------------
 1276|    184|            ip += 1;
 1277|    184|            {   U32 n;
 1278|    663|                for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1278:27): [True: 479, False: 184]
  ------------------
 1279|    479|                    huffWeight[n]   = ip[n/2] >> 4;
 1280|    479|                    huffWeight[n+1] = ip[n/2] & 15;
 1281|    479|    }   }   }   }
 1282|    181|    else  {   /* header compressed with FSE (normal case) */
 1283|    181|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1283:13): [True: 3, False: 178]
  ------------------
 1284|    178|        oSize = FSEv07_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1285|    178|        if (FSEv07_isError(oSize)) return oSize;
  ------------------
  |  Branch (1285:13): [True: 36, False: 142]
  ------------------
 1286|    178|    }
 1287|       |
 1288|       |    /* collect weight stats */
 1289|    357|    memset(rankStats, 0, (HUFv07_TABLELOG_ABSOLUTEMAX + 1) * sizeof(U32));
  ------------------
  |  |  996|    357|#define HUFv07_TABLELOG_ABSOLUTEMAX  16   /* absolute limit of HUFv07_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1290|    357|    weightTotal = 0;
 1291|  11.3k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1291:26): [True: 10.9k, False: 345]
  ------------------
 1292|  10.9k|            if (huffWeight[n] >= HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  996|  10.9k|#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|     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 (1292:17): [True: 12, False: 10.9k]
  ------------------
 1293|  10.9k|            rankStats[huffWeight[n]]++;
 1294|  10.9k|            weightTotal += (1 << huffWeight[n]) >> 1;
 1295|  10.9k|    }   }
 1296|    345|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1296:9): [True: 2, False: 343]
  ------------------
 1297|       |
 1298|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1299|    343|    {   U32 const tableLog = BITv07_highbit32(weightTotal) + 1;
 1300|    343|        if (tableLog > HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  996|    343|#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|      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 (1300:13): [True: 3, False: 340]
  ------------------
 1301|    340|        *tableLogPtr = tableLog;
 1302|       |        /* determine last weight */
 1303|    340|        {   U32 const total = 1 << tableLog;
 1304|    340|            U32 const rest = total - weightTotal;
 1305|    340|            U32 const verif = 1 << BITv07_highbit32(rest);
 1306|    340|            U32 const lastWeight = BITv07_highbit32(rest) + 1;
 1307|    340|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   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 (1307:17): [True: 30, False: 310]
  ------------------
 1308|    310|            huffWeight[oSize] = (BYTE)lastWeight;
 1309|    310|            rankStats[lastWeight]++;
 1310|    310|    }   }
 1311|       |
 1312|       |    /* check tree construction validity */
 1313|    310|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1313:9): [True: 1, False: 309]
  |  Branch (1313:31): [True: 0, False: 309]
  ------------------
 1314|       |
 1315|       |    /* results */
 1316|    309|    *nbSymbolsPtr = (U32)(oSize+1);
 1317|    309|    return iSize+1;
 1318|    310|}
FSEv07_buildDTable:
 1424|    947|{
 1425|    947|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
 1426|    947|    FSEv07_DECODE_TYPE* const tableDecode = (FSEv07_DECODE_TYPE*) (tdPtr);
  ------------------
  |  |  890|    947|#define FSEv07_DECODE_TYPE FSEv07_decode_t
  ------------------
 1427|    947|    U16 symbolNext[FSEv07_MAX_SYMBOL_VALUE+1];
 1428|       |
 1429|    947|    U32 const maxSV1 = maxSymbolValue + 1;
 1430|    947|    U32 const tableSize = 1 << tableLog;
 1431|    947|    U32 highThreshold = tableSize-1;
 1432|       |
 1433|       |    /* Sanity Checks */
 1434|    947|    if (maxSymbolValue > FSEv07_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  882|    947|#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: 947]
  ------------------
 1435|    947|    if (tableLog > FSEv07_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  899|    947|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|    947|#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: 946]
  ------------------
 1436|       |
 1437|       |    /* Init, lay down lowprob symbols */
 1438|    946|    {   FSEv07_DTableHeader DTableH;
 1439|    946|        DTableH.tableLog = (U16)tableLog;
 1440|    946|        DTableH.fastMode = 1;
 1441|    946|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
 1442|    946|            U32 s;
 1443|  25.8k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1443:23): [True: 24.9k, False: 946]
  ------------------
 1444|  24.9k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1444:21): [True: 5.30k, False: 19.6k]
  ------------------
 1445|  5.30k|                    tableDecode[highThreshold--].symbol = (FSEv07_FUNCTION_TYPE)s;
 1446|  5.30k|                    symbolNext[s] = 1;
 1447|  19.6k|                } else {
 1448|  19.6k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1448:25): [True: 321, False: 19.2k]
  ------------------
 1449|  19.6k|                    symbolNext[s] = normalizedCounter[s];
 1450|  19.6k|        }   }   }
 1451|    946|        memcpy(dt, &DTableH, sizeof(DTableH));
 1452|    946|    }
 1453|       |
 1454|       |    /* Spread symbols */
 1455|    946|    {   U32 const tableMask = tableSize-1;
 1456|    946|        U32 const step = FSEv07_TABLESTEP(tableSize);
  ------------------
  |  |  910|    946|#define FSEv07_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
  ------------------
 1457|    946|        U32 s, position = 0;
 1458|  25.8k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1458:19): [True: 24.9k, False: 946]
  ------------------
 1459|  24.9k|            int i;
 1460|   376k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1460:23): [True: 351k, False: 24.9k]
  ------------------
 1461|   351k|                tableDecode[position].symbol = (FSEv07_FUNCTION_TYPE)s;
 1462|   351k|                position = (position + step) & tableMask;
 1463|   356k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1463:24): [True: 5.30k, False: 351k]
  ------------------
 1464|   351k|        }   }
 1465|       |
 1466|    946|        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: 946]
  ------------------
 1467|    946|    }
 1468|       |
 1469|       |    /* Build Decoding table */
 1470|    946|    {   U32 u;
 1471|   357k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1471:19): [True: 356k, False: 946]
  ------------------
 1472|   356k|            FSEv07_FUNCTION_TYPE const symbol = (FSEv07_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  |  888|   356k|#define FSEv07_FUNCTION_TYPE BYTE
  ------------------
 1473|   356k|            U16 nextState = symbolNext[symbol]++;
 1474|   356k|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv07_highbit32 ((U32)nextState) );
 1475|   356k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1476|   356k|    }   }
 1477|       |
 1478|    946|    return 0;
 1479|    946|}
FSEv07_buildDTable_rle:
 1489|    179|{
 1490|    179|    void* ptr = dt;
 1491|    179|    FSEv07_DTableHeader* const DTableH = (FSEv07_DTableHeader*)ptr;
 1492|    179|    void* dPtr = dt + 1;
 1493|    179|    FSEv07_decode_t* const cell = (FSEv07_decode_t*)dPtr;
 1494|       |
 1495|    179|    DTableH->tableLog = 0;
 1496|    179|    DTableH->fastMode = 0;
 1497|       |
 1498|    179|    cell->newState = 0;
 1499|    179|    cell->symbol = symbolValue;
 1500|    179|    cell->nbBits = 0;
 1501|       |
 1502|    179|    return 0;
 1503|    179|}
FSEv07_decompress_usingDTable:
 1603|    159|{
 1604|    159|    const void* ptr = dt;
 1605|    159|    const FSEv07_DTableHeader* DTableH = (const FSEv07_DTableHeader*)ptr;
 1606|    159|    const U32 fastMode = DTableH->fastMode;
 1607|       |
 1608|       |    /* select fast mode (static) */
 1609|    159|    if (fastMode) return FSEv07_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1609:9): [True: 70, False: 89]
  ------------------
 1610|     89|    return FSEv07_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1611|    159|}
FSEv07_decompress:
 1615|    178|{
 1616|    178|    const BYTE* const istart = (const BYTE*)cSrc;
 1617|    178|    const BYTE* ip = istart;
 1618|    178|    short counting[FSEv07_MAX_SYMBOL_VALUE+1];
 1619|    178|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1620|    178|    unsigned tableLog;
 1621|    178|    unsigned maxSymbolValue = FSEv07_MAX_SYMBOL_VALUE;
  ------------------
  |  |  882|    178|#define FSEv07_MAX_SYMBOL_VALUE 255
  ------------------
 1622|       |
 1623|    178|    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: 176]
  ------------------
 1624|       |
 1625|       |    /* normal FSE decoding mode */
 1626|    176|    {   size_t const NCountLength = FSEv07_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1627|    176|        if (FSEv07_isError(NCountLength)) return NCountLength;
  ------------------
  |  | 1378|    176|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1627:13): [True: 15, False: 161]
  ------------------
 1628|    161|        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: 160]
  ------------------
 1629|    160|        ip += NCountLength;
 1630|    160|        cSrcSize -= NCountLength;
 1631|    160|    }
 1632|       |
 1633|      0|    { size_t const errorCode = FSEv07_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1634|    160|      if (FSEv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1378|    160|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1634:11): [True: 1, False: 159]
  ------------------
 1635|       |
 1636|    159|    return FSEv07_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);   /* always return, even if it is an error code */
 1637|    160|}
HUFv07_readDTableX2:
 1722|    399|{
 1723|    399|    BYTE huffWeight[HUFv07_SYMBOLVALUE_MAX + 1];
 1724|    399|    U32 rankVal[HUFv07_TABLELOG_ABSOLUTEMAX + 1];   /* large enough for values from 0 to 16 */
 1725|    399|    U32 tableLog = 0;
 1726|    399|    U32 nbSymbols = 0;
 1727|    399|    size_t iSize;
 1728|    399|    void* const dtPtr = DTable + 1;
 1729|    399|    HUFv07_DEltX2* const dt = (HUFv07_DEltX2*)dtPtr;
 1730|       |
 1731|    399|    HUFv07_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUFv07_DTable));
  ------------------
  |  | 1698|    399|#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|    399|    iSize = HUFv07_readStats(huffWeight, HUFv07_SYMBOLVALUE_MAX + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  |  999|    399|#define HUFv07_SYMBOLVALUE_MAX 255
  ------------------
 1735|    399|    if (HUFv07_isError(iSize)) return iSize;
  ------------------
  |  Branch (1735:9): [True: 90, False: 309]
  ------------------
 1736|       |
 1737|       |    /* Table header */
 1738|    309|    {   DTableDesc dtd = HUFv07_getDTableDesc(DTable);
 1739|    309|        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: 308]
  ------------------
 1740|    308|        dtd.tableType = 0;
 1741|    308|        dtd.tableLog = (BYTE)tableLog;
 1742|    308|        memcpy(DTable, &dtd, sizeof(dtd));
 1743|    308|    }
 1744|       |
 1745|       |    /* Prepare ranks */
 1746|      0|    {   U32 n, nextRankStart = 0;
 1747|  1.41k|        for (n=1; n<tableLog+1; n++) {
  ------------------
  |  Branch (1747:19): [True: 1.11k, False: 308]
  ------------------
 1748|  1.11k|            U32 current = nextRankStart;
 1749|  1.11k|            nextRankStart += (rankVal[n] << (n-1));
 1750|  1.11k|            rankVal[n] = current;
 1751|  1.11k|    }   }
 1752|       |
 1753|       |    /* fill DTable */
 1754|    308|    {   U32 n;
 1755|  9.46k|        for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1755:19): [True: 9.16k, False: 308]
  ------------------
 1756|  9.16k|            U32 const w = huffWeight[n];
 1757|  9.16k|            U32 const length = (1 << w) >> 1;
 1758|  9.16k|            U32 i;
 1759|  9.16k|            HUFv07_DEltX2 D;
 1760|  9.16k|            D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1761|  51.5k|            for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1761:34): [True: 42.3k, False: 9.16k]
  ------------------
 1762|  42.3k|                dt[i] = D;
 1763|  9.16k|            rankVal[w] += length;
 1764|  9.16k|    }   }
 1765|       |
 1766|    308|    return iSize;
 1767|    309|}
HUFv07_decompress1X2_DCtx:
 1847|    109|{
 1848|    109|    const BYTE* ip = (const BYTE*) cSrc;
 1849|       |
 1850|    109|    size_t const hSize = HUFv07_readDTableX2 (DCtx, cSrc, cSrcSize);
 1851|    109|    if (HUFv07_isError(hSize)) return hSize;
  ------------------
  |  Branch (1851:9): [True: 25, False: 84]
  ------------------
 1852|     84|    if (hSize >= cSrcSize) 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 (1852:9): [True: 1, False: 83]
  ------------------
 1853|     83|    ip += hSize; cSrcSize -= hSize;
 1854|       |
 1855|     83|    return HUFv07_decompress1X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, DCtx);
 1856|     84|}
HUFv07_decompress4X2_DCtx:
 1970|    290|{
 1971|    290|    const BYTE* ip = (const BYTE*) cSrc;
 1972|       |
 1973|    290|    size_t const hSize = HUFv07_readDTableX2 (dctx, cSrc, cSrcSize);
 1974|    290|    if (HUFv07_isError(hSize)) return hSize;
  ------------------
  |  Branch (1974:9): [True: 66, False: 224]
  ------------------
 1975|    224|    if (hSize >= cSrcSize) 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 (1975:9): [True: 2, False: 222]
  ------------------
 1976|    222|    ip += hSize; cSrcSize -= hSize;
 1977|       |
 1978|    222|    return HUFv07_decompress4X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, dctx);
 1979|    224|}
HUFv07_selectDecoder:
 2450|    290|{
 2451|       |    /* decoder timing evaluation */
 2452|    290|    U32 const Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2453|    290|    U32 const D256 = (U32)(dstSize >> 8);
 2454|    290|    U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
 2455|    290|    U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
 2456|    290|    DTime1 += DTime1 >> 3;  /* advantage to algorithm using less memory, for cache eviction */
 2457|       |
 2458|    290|    return DTime1 < DTime0;
 2459|    290|}
HUFv07_decompress4X_hufOnly:
 2497|    295|{
 2498|       |    /* validation checks */
 2499|    295|    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: 294]
  ------------------
 2500|    294|    if ((cSrcSize >= dstSize) || (cSrcSize <= 1)) return ERROR(corruption_detected);   /* invalid */
  ------------------
  |  |   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 (2500:9): [True: 2, False: 292]
  |  Branch (2500:34): [True: 2, False: 290]
  ------------------
 2501|       |
 2502|    290|    {   U32 const algoNb = HUFv07_selectDecoder(dstSize, cSrcSize);
 2503|    290|        return algoNb ? HUFv07_decompress4X4_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :
  ------------------
  |  Branch (2503:16): [True: 0, False: 290]
  ------------------
 2504|    290|                        HUFv07_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
 2505|    294|    }
 2506|    294|}
ZSTDv07_decompressBegin:
 2908|  1.95k|{
 2909|  1.95k|    dctx->expected = ZSTDv07_frameHeaderSize_min;
 2910|  1.95k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2911|  1.95k|    dctx->previousDstEnd = NULL;
 2912|  1.95k|    dctx->base = NULL;
 2913|  1.95k|    dctx->vBase = NULL;
 2914|  1.95k|    dctx->dictEnd = NULL;
 2915|  1.95k|    dctx->hufTable[0] = (HUFv07_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);
  ------------------
  |  | 2665|  1.95k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2916|  1.95k|    dctx->litEntropy = dctx->fseEntropy = 0;
 2917|  1.95k|    dctx->dictID = 0;
 2918|  7.83k|    { int i; for (i=0; i<ZSTDv07_REP_NUM; i++) dctx->rep[i] = repStartValue[i]; }
  ------------------
  |  | 2638|  7.83k|#define ZSTDv07_REP_NUM    3
  ------------------
  |  Branch (2918:24): [True: 5.87k, False: 1.95k]
  ------------------
 2919|  1.95k|    return 0;
 2920|  1.95k|}
ZSTDv07_createDCtx_advanced:
 2923|    979|{
 2924|    979|    ZSTDv07_DCtx* dctx;
 2925|       |
 2926|    979|    if (!customMem.customAlloc && !customMem.customFree)
  ------------------
  |  Branch (2926:9): [True: 0, False: 979]
  |  Branch (2926:35): [True: 0, False: 0]
  ------------------
 2927|      0|        customMem = defaultCustomMem;
 2928|       |
 2929|    979|    if (!customMem.customAlloc || !customMem.customFree)
  ------------------
  |  Branch (2929:9): [True: 0, False: 979]
  |  Branch (2929:35): [True: 0, False: 979]
  ------------------
 2930|      0|        return NULL;
 2931|       |
 2932|    979|    dctx = (ZSTDv07_DCtx*) customMem.customAlloc(customMem.opaque, sizeof(ZSTDv07_DCtx));
 2933|    979|    if (!dctx) return NULL;
  ------------------
  |  Branch (2933:9): [True: 0, False: 979]
  ------------------
 2934|    979|    memcpy(&dctx->customMem, &customMem, sizeof(ZSTDv07_customMem));
 2935|    979|    ZSTDv07_decompressBegin(dctx);
 2936|    979|    return dctx;
 2937|    979|}
ZSTDv07_createDCtx:
 2940|    979|{
 2941|    979|    return ZSTDv07_createDCtx_advanced(defaultCustomMem);
 2942|    979|}
ZSTDv07_freeDCtx:
 2945|    979|{
 2946|    979|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (2946:9): [True: 0, False: 979]
  ------------------
 2947|    979|    dctx->customMem.customFree(dctx->customMem.opaque, dctx);
 2948|    979|    return 0;   /* reserved as a potential error code in the future */
 2949|    979|}
ZSTDv07_getFrameParams:
 3096|  1.10k|{
 3097|  1.10k|    const BYTE* ip = (const BYTE*)src;
 3098|       |
 3099|  1.10k|    if (srcSize < ZSTDv07_frameHeaderSize_min) return ZSTDv07_frameHeaderSize_min;
  ------------------
  |  Branch (3099:9): [True: 0, False: 1.10k]
  ------------------
 3100|  1.10k|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 3101|  1.10k|    if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|  1.10k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3101:9): [True: 0, False: 1.10k]
  ------------------
 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.10k|    { size_t const fhsize = ZSTDv07_frameHeaderSize(src, srcSize);
 3113|  1.10k|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (3113:11): [True: 0, False: 1.10k]
  ------------------
 3114|       |
 3115|  1.10k|    {   BYTE const fhdByte = ip[4];
 3116|  1.10k|        size_t pos = 5;
 3117|  1.10k|        U32 const dictIDSizeCode = fhdByte&3;
 3118|  1.10k|        U32 const checksumFlag = (fhdByte>>2)&1;
 3119|  1.10k|        U32 const directMode = (fhdByte>>5)&1;
 3120|  1.10k|        U32 const fcsID = fhdByte>>6;
 3121|  1.10k|        U32 const windowSizeMax = 1U << ZSTDv07_WINDOWLOG_MAX;
  ------------------
  |  |   45|  1.10k|#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.10k|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 1.10k]
  |  |  ------------------
  ------------------
 3122|  1.10k|        U32 windowSize = 0;
 3123|  1.10k|        U32 dictID = 0;
 3124|  1.10k|        U64 frameContentSize = 0;
 3125|  1.10k|        if ((fhdByte & 0x08) != 0)   /* reserved bits, which must be zero */
  ------------------
  |  Branch (3125:13): [True: 6, False: 1.09k]
  ------------------
 3126|      6|            return ERROR(frameParameter_unsupported);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3127|  1.09k|        if (!directMode) {
  ------------------
  |  Branch (3127:13): [True: 607, False: 487]
  ------------------
 3128|    607|            BYTE const wlByte = ip[pos++];
 3129|    607|            U32 const windowLog = (wlByte >> 3) + ZSTDv07_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  | 2654|    607|#define ZSTDv07_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
 3130|    607|            if (windowLog > ZSTDv07_WINDOWLOG_MAX)
  ------------------
  |  |   45|    607|#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|    607|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 607]
  |  |  ------------------
  ------------------
  |  Branch (3130:17): [True: 7, False: 600]
  ------------------
 3131|      7|                return ERROR(frameParameter_unsupported);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3132|    600|            windowSize = (1U << windowLog);
 3133|    600|            windowSize += (windowSize >> 3) * (wlByte&7);
 3134|    600|        }
 3135|       |
 3136|  1.08k|        switch(dictIDSizeCode)
 3137|  1.08k|        {
 3138|      0|            default:   /* impossible */
  ------------------
  |  Branch (3138:13): [True: 0, False: 1.08k]
  ------------------
 3139|    505|            case 0 : break;
  ------------------
  |  Branch (3139:13): [True: 505, False: 582]
  ------------------
 3140|    521|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (3140:13): [True: 521, False: 566]
  ------------------
 3141|     16|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (3141:13): [True: 16, False: 1.07k]
  ------------------
 3142|     45|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (3142:13): [True: 45, False: 1.04k]
  ------------------
 3143|  1.08k|        }
 3144|  1.08k|        switch(fcsID)
 3145|  1.08k|        {
 3146|      0|            default:   /* impossible */
  ------------------
  |  Branch (3146:13): [True: 0, False: 1.08k]
  ------------------
 3147|    344|            case 0 : if (directMode) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (3147:13): [True: 344, False: 743]
  |  Branch (3147:26): [True: 62, False: 282]
  ------------------
 3148|    461|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (3148:13): [True: 461, False: 626]
  ------------------
 3149|    239|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (3149:13): [True: 239, False: 848]
  ------------------
 3150|     43|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (3150:13): [True: 43, False: 1.04k]
  ------------------
 3151|  1.08k|        }
 3152|  1.08k|        if (!windowSize) windowSize = (U32)frameContentSize;
  ------------------
  |  Branch (3152:13): [True: 487, False: 600]
  ------------------
 3153|  1.08k|        if (windowSize > windowSizeMax)
  ------------------
  |  Branch (3153:13): [True: 17, False: 1.07k]
  ------------------
 3154|     17|            return ERROR(frameParameter_unsupported);
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3155|  1.07k|        fparamsPtr->frameContentSize = frameContentSize;
 3156|  1.07k|        fparamsPtr->windowSize = windowSize;
 3157|  1.07k|        fparamsPtr->dictID = dictID;
 3158|  1.07k|        fparamsPtr->checksumFlag = checksumFlag;
 3159|  1.07k|    }
 3160|      0|    return 0;
 3161|  1.08k|}
ZSTDv07_decompress_usingDict:
 3824|    979|{
 3825|    979|    ZSTDv07_decompressBegin_usingDict(dctx, dict, dictSize);
 3826|    979|    ZSTDv07_checkContinuity(dctx, dst);
 3827|    979|    return ZSTDv07_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3828|    979|}
ZSTDv07_findFrameSizeInfoLegacy:
 3861|  1.00k|{
 3862|  1.00k|    const BYTE* ip = (const BYTE*)src;
 3863|  1.00k|    size_t remainingSize = srcSize;
 3864|  1.00k|    size_t nbBlocks = 0;
 3865|       |
 3866|       |    /* check */
 3867|  1.00k|    if (srcSize < ZSTDv07_frameHeaderSize_min+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3867:9): [True: 1, False: 1.00k]
  ------------------
 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.00k|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, srcSize);
 3874|  1.00k|        if (ZSTDv07_isError(frameHeaderSize)) {
  ------------------
  |  | 2856|  1.00k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3874:13): [True: 0, False: 1.00k]
  ------------------
 3875|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3876|      0|            return;
 3877|      0|        }
 3878|  1.00k|        if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|  1.00k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3878:13): [True: 0, False: 1.00k]
  ------------------
 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.00k|        if (srcSize < frameHeaderSize+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3882:13): [True: 1, False: 1.00k]
  ------------------
 3883|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3884|      1|            return;
 3885|      1|        }
 3886|  1.00k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3887|  1.00k|    }
 3888|       |
 3889|       |    /* Loop on each block */
 3890|  3.12k|    while (1) {
  ------------------
  |  Branch (3890:12): [True: 3.12k, Folded]
  ------------------
 3891|  3.12k|        blockProperties_t blockProperties;
 3892|  3.12k|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, remainingSize, &blockProperties);
 3893|  3.12k|        if (ZSTDv07_isError(cBlockSize)) {
  ------------------
  |  | 2856|  3.12k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3893:13): [True: 3, False: 3.11k]
  ------------------
 3894|      3|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3895|      3|            return;
 3896|      3|        }
 3897|       |
 3898|  3.11k|        ip += ZSTDv07_blockHeaderSize;
 3899|  3.11k|        remainingSize -= ZSTDv07_blockHeaderSize;
 3900|       |
 3901|  3.11k|        if (blockProperties.blockType == bt_end) break;
  ------------------
  |  Branch (3901:13): [True: 979, False: 2.13k]
  ------------------
 3902|       |
 3903|  2.13k|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3903:13): [True: 23, False: 2.11k]
  ------------------
 3904|     23|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3905|     23|            return;
 3906|     23|        }
 3907|       |
 3908|  2.11k|        ip += cBlockSize;
 3909|  2.11k|        remainingSize -= cBlockSize;
 3910|  2.11k|        nbBlocks++;
 3911|  2.11k|    }
 3912|       |
 3913|    979|    *cSize = ip - (const BYTE*)src;
 3914|    979|    *dBound = nbBlocks * ZSTDv07_BLOCKSIZE_ABSOLUTEMAX;
  ------------------
  |  |  175|    979|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3915|    979|}
ZSTDv07_decompressBegin_usingDict:
 4115|    979|{
 4116|    979|    { size_t const errorCode = ZSTDv07_decompressBegin(dctx);
 4117|    979|      if (ZSTDv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2856|    979|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (4117:11): [True: 0, False: 979]
  ------------------
 4118|       |
 4119|    979|    if (dict && dictSize) {
  ------------------
  |  Branch (4119:9): [True: 979, False: 0]
  |  Branch (4119:17): [True: 503, False: 476]
  ------------------
 4120|    503|        size_t const errorCode = ZSTDv07_decompress_insertDictionary(dctx, dict, dictSize);
 4121|    503|        if (ZSTDv07_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2856|    503|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv07_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4121:13): [True: 0, False: 503]
  ------------------
 4122|    503|    }
 4123|       |
 4124|    979|    return 0;
 4125|    979|}
zstd_v07.c:MEM_readLE32:
  350|  12.8k|{
  351|  12.8k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (351:9): [True: 12.8k, False: 0]
  ------------------
  352|  12.8k|        return MEM_read32(memPtr);
  353|      0|    else
  354|      0|        return MEM_swap32(MEM_read32(memPtr));
  355|  12.8k|}
zstd_v07.c:MEM_isLittleEndian:
  268|  53.5k|{
  269|  53.5k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  270|  53.5k|    return one.c[0];
  271|  53.5k|}
zstd_v07.c:MEM_read32:
  279|  12.8k|{
  280|  12.8k|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  281|  12.8k|}
zstd_v07.c:FSEv07_abs:
 1150|  8.63k|static short FSEv07_abs(short a) { return (short)(a<0 ? -a : a); }
  ------------------
  |  Branch (1150:51): [True: 3.99k, False: 4.63k]
  ------------------
zstd_v07.c:BITv07_highbit32:
  473|   358k|{
  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|   358k|}
zstd_v07.c:FSEv07_decompress_usingDTable_generic:
 1536|    159|{
 1537|    159|    BYTE* const ostart = (BYTE*) dst;
 1538|    159|    BYTE* op = ostart;
 1539|    159|    BYTE* const omax = op + maxDstSize;
 1540|    159|    BYTE* const olimit = omax-3;
 1541|       |
 1542|    159|    BITv07_DStream_t bitD;
 1543|    159|    FSEv07_DState_t state1;
 1544|    159|    FSEv07_DState_t state2;
 1545|       |
 1546|       |    /* Init */
 1547|    159|    { size_t const errorCode = BITv07_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1548|    159|      if (FSEv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1378|    159|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1548:11): [True: 5, False: 154]
  ------------------
 1549|       |
 1550|    154|    FSEv07_initDState(&state1, &bitD, dt);
 1551|    154|    FSEv07_initDState(&state2, &bitD, dt);
 1552|       |
 1553|    154|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
 1554|       |
 1555|       |    /* 4 symbols per loop */
 1556|  1.75k|    for ( ; (BITv07_reloadDStream(&bitD)==BITv07_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1556:13): [True: 1.60k, False: 146]
  |  Branch (1556:73): [True: 1.59k, False: 8]
  ------------------
 1557|  1.59k|        op[0] = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  1.59k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 497, False: 1.09k]
  |  |  ------------------
  ------------------
 1558|       |
 1559|  1.59k|        if (FSEv07_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  1.59k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  1.59k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1559:13): [Folded, False: 1.59k]
  ------------------
 1560|      0|            BITv07_reloadDStream(&bitD);
 1561|       |
 1562|  1.59k|        op[1] = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  1.59k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 497, False: 1.09k]
  |  |  ------------------
  ------------------
 1563|       |
 1564|  1.59k|        if (FSEv07_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  1.59k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  1.59k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1564:13): [Folded, False: 1.59k]
  ------------------
 1565|      0|            { if (BITv07_reloadDStream(&bitD) > BITv07_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1565:19): [True: 0, False: 0]
  ------------------
 1566|       |
 1567|  1.59k|        op[2] = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  1.59k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 497, False: 1.09k]
  |  |  ------------------
  ------------------
 1568|       |
 1569|  1.59k|        if (FSEv07_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  1.59k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  1.59k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1569:13): [Folded, False: 1.59k]
  ------------------
 1570|      0|            BITv07_reloadDStream(&bitD);
 1571|       |
 1572|  1.59k|        op[3] = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  1.59k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 497, False: 1.09k]
  |  |  ------------------
  ------------------
 1573|  1.59k|    }
 1574|       |
 1575|       |    /* tail */
 1576|       |    /* note : BITv07_reloadDStream(&bitD) >= FSEv07_DStream_partiallyFilled; Ends at exactly BITv07_DStream_completed */
 1577|  2.45k|    while (1) {
  ------------------
  |  Branch (1577:12): [True: 2.45k, Folded]
  ------------------
 1578|  2.45k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1578:13): [True: 12, False: 2.44k]
  ------------------
 1579|       |
 1580|  2.44k|        *op++ = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  2.44k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 549, False: 1.89k]
  |  |  ------------------
  ------------------
 1581|       |
 1582|  2.44k|        if (BITv07_reloadDStream(&bitD)==BITv07_DStream_overflow) {
  ------------------
  |  Branch (1582:13): [True: 89, False: 2.35k]
  ------------------
 1583|     89|            *op++ = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|     89|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 41, False: 48]
  |  |  ------------------
  ------------------
 1584|     89|            break;
 1585|     89|        }
 1586|       |
 1587|  2.35k|        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: 2.35k]
  ------------------
 1588|       |
 1589|  2.35k|        *op++ = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  2.35k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 508, False: 1.84k]
  |  |  ------------------
  ------------------
 1590|       |
 1591|  2.35k|        if (BITv07_reloadDStream(&bitD)==BITv07_DStream_overflow) {
  ------------------
  |  Branch (1591:13): [True: 53, False: 2.30k]
  ------------------
 1592|     53|            *op++ = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|     53|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 23, False: 30]
  |  |  ------------------
  ------------------
 1593|     53|            break;
 1594|     53|    }   }
 1595|       |
 1596|    142|    return op-ostart;
 1597|    154|}
zstd_v07.c:BITv07_initDStream:
  503|  1.07k|{
  504|  1.07k|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (504:9): [True: 16, False: 1.05k]
  ------------------
  505|       |
  506|  1.05k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (506:9): [True: 773, False: 283]
  ------------------
  507|    773|        bitD->start = (const char*)srcBuffer;
  508|    773|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  509|    773|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  510|    773|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  511|    773|          bitD->bitsConsumed = lastByte ? 8 - BITv07_highbit32(lastByte) : 0;
  ------------------
  |  Branch (511:32): [True: 608, False: 165]
  ------------------
  512|    773|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    165|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    165|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    165|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (512:15): [True: 165, False: 608]
  ------------------
  513|    773|    } else {
  514|    283|        bitD->start = (const char*)srcBuffer;
  515|    283|        bitD->ptr   = bitD->start;
  516|    283|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  517|    283|        switch(srcSize)
  518|    283|        {
  519|     21|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);/* fall-through */
  ------------------
  |  Branch (519:13): [True: 21, False: 262]
  ------------------
  520|     77|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);/* fall-through */
  ------------------
  |  Branch (520:13): [True: 56, False: 227]
  ------------------
  521|    105|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);/* fall-through */
  ------------------
  |  Branch (521:13): [True: 28, False: 255]
  ------------------
  522|    129|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (522:13): [True: 24, False: 259]
  ------------------
  523|    158|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (523:13): [True: 29, False: 254]
  ------------------
  524|    245|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (524:13): [True: 87, False: 196]
  ------------------
  525|    283|            default: break;
  ------------------
  |  Branch (525:13): [True: 38, False: 245]
  ------------------
  526|    283|        }
  527|    283|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  528|    283|          bitD->bitsConsumed = lastByte ? 8 - BITv07_highbit32(lastByte) : 0;
  ------------------
  |  Branch (528:32): [True: 270, False: 13]
  ------------------
  529|    283|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (529:15): [True: 13, False: 270]
  ------------------
  530|    270|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  531|    270|    }
  532|       |
  533|    878|    return srcSize;
  534|  1.05k|}
zstd_v07.c:MEM_readLEST:
  367|  39.5k|{
  368|  39.5k|    if (MEM_32bits())
  ------------------
  |  Branch (368:9): [True: 0, False: 39.5k]
  ------------------
  369|      0|        return (size_t)MEM_readLE32(memPtr);
  370|  39.5k|    else
  371|  39.5k|        return (size_t)MEM_readLE64(memPtr);
  372|  39.5k|}
zstd_v07.c:FSEv07_initDState:
  818|  1.09k|{
  819|  1.09k|    const void* ptr = dt;
  820|  1.09k|    const FSEv07_DTableHeader* const DTableH = (const FSEv07_DTableHeader*)ptr;
  821|  1.09k|    DStatePtr->state = BITv07_readBits(bitD, DTableH->tableLog);
  822|  1.09k|    BITv07_reloadDStream(bitD);
  823|  1.09k|    DStatePtr->table = dt + 1;
  824|  1.09k|}
zstd_v07.c:BITv07_readBits:
  557|   122k|{
  558|   122k|    size_t const value = BITv07_lookBits(bitD, nbBits);
  559|   122k|    BITv07_skipBits(bitD, nbBits);
  560|   122k|    return value;
  561|   122k|}
zstd_v07.c:BITv07_lookBits:
  538|   122k|{
  539|   122k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  540|   122k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  541|   122k|}
zstd_v07.c:BITv07_skipBits:
  552|   176k|{
  553|   176k|    bitD->bitsConsumed += nbBits;
  554|   176k|}
zstd_v07.c:BITv07_reloadDStream:
  573|  45.7k|{
  574|  45.7k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should not happen => corruption detected */
  ------------------
  |  Branch (574:9): [True: 303, False: 45.4k]
  ------------------
  575|    303|        return BITv07_DStream_overflow;
  576|       |
  577|  45.4k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (577:9): [True: 35.7k, False: 9.62k]
  ------------------
  578|  35.7k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  579|  35.7k|        bitD->bitsConsumed &= 7;
  580|  35.7k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  581|  35.7k|        return BITv07_DStream_unfinished;
  582|  35.7k|    }
  583|  9.62k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (583:9): [True: 6.65k, False: 2.96k]
  ------------------
  584|  6.65k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv07_DStream_endOfBuffer;
  ------------------
  |  Branch (584:13): [True: 6.38k, False: 274]
  ------------------
  585|    274|        return BITv07_DStream_completed;
  586|  6.65k|    }
  587|  2.96k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  588|  2.96k|        BITv07_DStream_status result = BITv07_DStream_unfinished;
  589|  2.96k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (589:13): [True: 96, False: 2.87k]
  ------------------
  590|     96|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  591|     96|            result = BITv07_DStream_endOfBuffer;
  592|     96|        }
  593|  2.96k|        bitD->ptr -= nbBytes;
  594|  2.96k|        bitD->bitsConsumed -= nbBytes*8;
  595|  2.96k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  596|  2.96k|        return result;
  597|  9.62k|    }
  598|  9.62k|}
zstd_v07.c:FSEv07_decodeSymbolFast:
  854|  3.10k|{
  855|  3.10k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  856|  3.10k|    U32 const nbBits = DInfo.nbBits;
  857|  3.10k|    BYTE const symbol = DInfo.symbol;
  858|  3.10k|    size_t const lowBits = BITv07_readBitsFast(bitD, nbBits);
  859|       |
  860|  3.10k|    DStatePtr->state = DInfo.newState + lowBits;
  861|  3.10k|    return symbol;
  862|  3.10k|}
zstd_v07.c:BITv07_readBitsFast:
  566|  3.10k|{
  567|  3.10k|    size_t const value = BITv07_lookBitsFast(bitD, nbBits);
  568|  3.10k|    BITv07_skipBits(bitD, nbBits);
  569|  3.10k|    return value;
  570|  3.10k|}
zstd_v07.c:BITv07_lookBitsFast:
  546|  54.4k|{
  547|  54.4k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  548|  54.4k|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  549|  54.4k|}
zstd_v07.c:FSEv07_decodeSymbol:
  841|  8.21k|{
  842|  8.21k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  843|  8.21k|    U32 const nbBits = DInfo.nbBits;
  844|  8.21k|    BYTE const symbol = DInfo.symbol;
  845|  8.21k|    size_t const lowBits = BITv07_readBits(bitD, nbBits);
  846|       |
  847|  8.21k|    DStatePtr->state = DInfo.newState + lowBits;
  848|  8.21k|    return symbol;
  849|  8.21k|}
zstd_v07.c:HUFv07_getDTableDesc:
 1708|    611|{
 1709|    611|    DTableDesc dtd;
 1710|    611|    memcpy(&dtd, table, sizeof(dtd));
 1711|    611|    return dtd;
 1712|    611|}
zstd_v07.c:HUFv07_decompress1X2_usingDTable_internal:
 1816|     83|{
 1817|     83|    BYTE* op = (BYTE*)dst;
 1818|     83|    BYTE* const oend = op + dstSize;
 1819|     83|    const void* dtPtr = DTable + 1;
 1820|     83|    const HUFv07_DEltX2* const dt = (const HUFv07_DEltX2*)dtPtr;
 1821|     83|    BITv07_DStream_t bitD;
 1822|     83|    DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 1823|     83|    U32 const dtLog = dtd.tableLog;
 1824|       |
 1825|     83|    { size_t const errorCode = BITv07_initDStream(&bitD, cSrc, cSrcSize);
 1826|     83|      if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1826:11): [True: 24, False: 59]
  ------------------
 1827|       |
 1828|     59|    HUFv07_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 1829|       |
 1830|       |    /* check */
 1831|     59|    if (!BITv07_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     56|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     56|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     56|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1831:9): [True: 56, False: 3]
  ------------------
 1832|       |
 1833|      3|    return dstSize;
 1834|     59|}
zstd_v07.c:HUFv07_decodeStreamX2:
 1790|    307|{
 1791|    307|    BYTE* const pStart = p;
 1792|       |
 1793|       |    /* up to 4 symbols at a time */
 1794|  2.00k|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (1794:12): [True: 1.74k, False: 260]
  |  Branch (1794:76): [True: 1.69k, False: 47]
  ------------------
 1795|  1.69k|        HUFv07_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1786|  1.69k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 1.69k, False: 0]
  |  |  ------------------
  |  | 1787|  1.69k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.69k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1796|  1.69k|        HUFv07_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1782|  1.69k|    if (MEM_64bits() || (HUFv07_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |  997|      0|#define HUFv07_TABLELOG_MAX  12           /* max configured tableLog (for static allocation); can be modified up to HUFv07_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1782:9): [True: 1.69k, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|  1.69k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.69k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1797|  1.69k|        HUFv07_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1786|  1.69k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 1.69k, False: 0]
  |  |  ------------------
  |  | 1787|  1.69k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.69k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1798|  1.69k|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|  1.69k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1799|  1.69k|    }
 1800|       |
 1801|       |    /* closer to the end */
 1802|    369|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (1802:12): [True: 102, False: 267]
  |  Branch (1802:76): [True: 62, False: 40]
  ------------------
 1803|     62|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|     62|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1804|       |
 1805|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 1806|  44.7k|    while (p < pEnd)
  ------------------
  |  Branch (1806:12): [True: 44.4k, False: 307]
  ------------------
 1807|  44.4k|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|  44.4k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1808|       |
 1809|    307|    return pEnd-pStart;
 1810|    307|}
zstd_v07.c:MEM_64bits:
  265|  5.09k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v07.c:HUFv07_decodeSymbolX2:
 1771|  51.3k|{
 1772|  51.3k|    size_t const val = BITv07_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1773|  51.3k|    BYTE const c = dt[val].byte;
 1774|  51.3k|    BITv07_skipBits(Dstream, dt[val].nbBits);
 1775|  51.3k|    return c;
 1776|  51.3k|}
zstd_v07.c:BITv07_endOfDStream:
  604|    307|{
  605|    307|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (605:13): [True: 269, False: 38]
  |  Branch (605:49): [True: 7, False: 262]
  ------------------
  606|    307|}
zstd_v07.c:HUFv07_decompress4X2_usingDTable_internal:
 1869|    222|{
 1870|       |    /* Check */
 1871|    222|    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   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 (1871:9): [True: 3, False: 219]
  ------------------
 1872|       |
 1873|    219|    {   const BYTE* const istart = (const BYTE*) cSrc;
 1874|    219|        BYTE* const ostart = (BYTE*) dst;
 1875|    219|        BYTE* const oend = ostart + dstSize;
 1876|    219|        const void* const dtPtr = DTable + 1;
 1877|    219|        const HUFv07_DEltX2* const dt = (const HUFv07_DEltX2*)dtPtr;
 1878|       |
 1879|       |        /* Init */
 1880|    219|        BITv07_DStream_t bitD1;
 1881|    219|        BITv07_DStream_t bitD2;
 1882|    219|        BITv07_DStream_t bitD3;
 1883|    219|        BITv07_DStream_t bitD4;
 1884|    219|        size_t const length1 = MEM_readLE16(istart);
 1885|    219|        size_t const length2 = MEM_readLE16(istart+2);
 1886|    219|        size_t const length3 = MEM_readLE16(istart+4);
 1887|    219|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1888|    219|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1889|    219|        const BYTE* const istart2 = istart1 + length1;
 1890|    219|        const BYTE* const istart3 = istart2 + length2;
 1891|    219|        const BYTE* const istart4 = istart3 + length3;
 1892|    219|        const size_t segmentSize = (dstSize+3) / 4;
 1893|    219|        BYTE* const opStart2 = ostart + segmentSize;
 1894|    219|        BYTE* const opStart3 = opStart2 + segmentSize;
 1895|    219|        BYTE* const opStart4 = opStart3 + segmentSize;
 1896|    219|        BYTE* op1 = ostart;
 1897|    219|        BYTE* op2 = opStart2;
 1898|    219|        BYTE* op3 = opStart3;
 1899|    219|        BYTE* op4 = opStart4;
 1900|    219|        U32 endSignal;
 1901|    219|        DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 1902|    219|        U32 const dtLog = dtd.tableLog;
 1903|       |
 1904|    219|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (1904:13): [True: 32, False: 187]
  ------------------
 1905|    187|        { size_t const errorCode = BITv07_initDStream(&bitD1, istart1, length1);
 1906|    187|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1906:15): [True: 30, False: 157]
  ------------------
 1907|    157|        { size_t const errorCode = BITv07_initDStream(&bitD2, istart2, length2);
 1908|    157|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1908:15): [True: 41, False: 116]
  ------------------
 1909|    116|        { size_t const errorCode = BITv07_initDStream(&bitD3, istart3, length3);
 1910|    116|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1910:15): [True: 48, False: 68]
  ------------------
 1911|     68|        { size_t const errorCode = BITv07_initDStream(&bitD4, istart4, length4);
 1912|     68|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1912:15): [True: 6, False: 62]
  ------------------
 1913|       |
 1914|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1915|     62|        endSignal = BITv07_reloadDStream(&bitD1) | BITv07_reloadDStream(&bitD2) | BITv07_reloadDStream(&bitD3) | BITv07_reloadDStream(&bitD4);
 1916|     62|        for ( ; (endSignal==BITv07_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (1916:17): [True: 0, False: 62]
  |  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|     62|        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: 62]
  ------------------
 1938|     62|        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: 62]
  ------------------
 1939|     62|        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: 62]
  ------------------
 1940|       |        /* note : op4 supposed already verified within main loop */
 1941|       |
 1942|       |        /* finish bitStreams one by one */
 1943|     62|        HUFv07_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 1944|     62|        HUFv07_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 1945|     62|        HUFv07_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 1946|     62|        HUFv07_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 1947|       |
 1948|       |        /* check */
 1949|     62|        endSignal = BITv07_endOfDStream(&bitD1) & BITv07_endOfDStream(&bitD2) & BITv07_endOfDStream(&bitD3) & BITv07_endOfDStream(&bitD4);
 1950|     62|        if (!endSignal) 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 (1950:13): [True: 62, False: 0]
  ------------------
 1951|       |
 1952|       |        /* decoded size */
 1953|      0|        return dstSize;
 1954|     62|    }
 1955|     62|}
zstd_v07.c:ZSTDv07_defaultAllocFunction:
 2577|    979|{
 2578|    979|    void* address = malloc(size);
 2579|    979|    (void)opaque;
 2580|       |    /* printf("alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
 2581|    979|    return address;
 2582|    979|}
zstd_v07.c:ZSTDv07_defaultFreeFunction:
 2585|    979|{
 2586|    979|    (void)opaque;
 2587|       |    /* if (address) printf("free %p opaque=%p \n", address, opaque); */
 2588|    979|    free(address);
 2589|    979|}
zstd_v07.c:ZSTDv07_frameHeaderSize:
 3078|  3.08k|{
 3079|  3.08k|    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: 3.08k]
  ------------------
 3080|  3.08k|    {   BYTE const fhd = ((const BYTE*)src)[4];
 3081|  3.08k|        U32 const dictID= fhd & 3;
 3082|  3.08k|        U32 const directMode = (fhd >> 5) & 1;
 3083|  3.08k|        U32 const fcsId = fhd >> 6;
 3084|  3.08k|        return ZSTDv07_frameHeaderSize_min + !directMode + ZSTDv07_did_fieldSize[dictID] + ZSTDv07_fcs_fieldSize[fcsId]
 3085|  3.08k|                + (directMode && !ZSTDv07_fcs_fieldSize[fcsId]);
  ------------------
  |  Branch (3085:20): [True: 1.37k, False: 1.70k]
  |  Branch (3085:34): [True: 153, False: 1.22k]
  ------------------
 3086|  3.08k|    }
 3087|  3.08k|}
zstd_v07.c:MEM_32bits:
  264|   150k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v07.c:MEM_readLE16:
  329|  1.16k|{
  330|  1.16k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (330:9): [True: 1.16k, False: 0]
  ------------------
  331|  1.16k|        return MEM_read16(memPtr);
  332|      0|    else {
  333|      0|        const BYTE* p = (const BYTE*)memPtr;
  334|      0|        return (U16)(p[0] + (p[1]<<8));
  335|      0|    }
  336|  1.16k|}
zstd_v07.c:MEM_read16:
  274|  1.16k|{
  275|  1.16k|    U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
  276|  1.16k|}
zstd_v07.c:MEM_readLE64:
  359|  39.5k|{
  360|  39.5k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (360:9): [True: 39.5k, False: 0]
  ------------------
  361|  39.5k|        return MEM_read64(memPtr);
  362|      0|    else
  363|      0|        return MEM_swap64(MEM_read64(memPtr));
  364|  39.5k|}
zstd_v07.c:MEM_read64:
  284|  39.5k|{
  285|  39.5k|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  286|  39.5k|}
zstd_v07.c:ZSTDv07_checkContinuity:
 3678|    979|{
 3679|    979|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3679:9): [True: 979, False: 0]
  ------------------
 3680|    979|        dctx->dictEnd = dctx->previousDstEnd;
 3681|    979|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3682|    979|        dctx->base = dst;
 3683|    979|        dctx->previousDstEnd = dst;
 3684|    979|    }
 3685|    979|}
zstd_v07.c:ZSTDv07_decompressBlock_internal:
 3691|    849|{   /* blockType == blockCompressed */
 3692|    849|    const BYTE* ip = (const BYTE*)src;
 3693|       |
 3694|    849|    if (srcSize >= ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  175|    849|#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: 849]
  ------------------
 3695|       |
 3696|       |    /* Decode literals sub-block */
 3697|    849|    {   size_t const litCSize = ZSTDv07_decodeLiteralsBlock(dctx, src, srcSize);
 3698|    849|        if (ZSTDv07_isError(litCSize)) return litCSize;
  ------------------
  |  | 2856|    849|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3698:13): [True: 473, False: 376]
  ------------------
 3699|    376|        ip += litCSize;
 3700|    376|        srcSize -= litCSize;
 3701|    376|    }
 3702|      0|    return ZSTDv07_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3703|    849|}
zstd_v07.c:ZSTDv07_decodeLiteralsBlock:
 3231|    849|{
 3232|    849|    const BYTE* const istart = (const BYTE*) src;
 3233|       |
 3234|    849|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  | 2663|    849|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  | 2662|    849|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) 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 (3234:9): [True: 3, False: 846]
  ------------------
 3235|       |
 3236|    846|    switch((litBlockType_t)(istart[0]>> 6))
 3237|    846|    {
 3238|    448|    case lbt_huffman:
  ------------------
  |  Branch (3238:5): [True: 448, False: 398]
  ------------------
 3239|    448|        {   size_t litSize, litCSize, singleStream=0;
 3240|    448|            U32 lhSize = (istart[0] >> 4) & 3;
 3241|    448|            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: 447]
  ------------------
 3242|    447|            switch(lhSize)
 3243|    447|            {
 3244|    404|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3244:13): [True: 292, False: 155]
  |  Branch (3244:21): [True: 112, False: 335]
  |  Branch (3244:29): [True: 0, False: 447]
  ------------------
 3245|       |                /* 2 - 2 - 10 - 10 */
 3246|    404|                lhSize=3;
 3247|    404|                singleStream = istart[0] & 16;
 3248|    404|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3249|    404|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 3250|    404|                break;
 3251|     18|            case 2:
  ------------------
  |  Branch (3251:13): [True: 18, False: 429]
  ------------------
 3252|       |                /* 2 - 2 - 14 - 14 */
 3253|     18|                lhSize=4;
 3254|     18|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 3255|     18|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 3256|     18|                break;
 3257|     25|            case 3:
  ------------------
  |  Branch (3257:13): [True: 25, False: 422]
  ------------------
 3258|       |                /* 2 - 2 - 18 - 18 */
 3259|     25|                lhSize=5;
 3260|     25|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 3261|     25|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 3262|     25|                break;
 3263|    447|            }
 3264|    447|            if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  175|    447|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) 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 (3264:17): [True: 1, False: 446]
  ------------------
 3265|    446|            if (litCSize + lhSize > srcSize) 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 (3265:17): [True: 42, False: 404]
  ------------------
 3266|       |
 3267|    404|            if (HUFv07_isError(singleStream ?
  ------------------
  |  | 2858|    404|#define HUFv07_isError  ERR_isError
  ------------------
  |  Branch (3267:17): [True: 401, False: 3]
  |  Branch (3267:32): [True: 109, False: 295]
  ------------------
 3268|    109|                            HUFv07_decompress1X2_DCtx(dctx->hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 3269|    404|                            HUFv07_decompress4X_hufOnly (dctx->hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 3270|    401|                return ERROR(corruption_detected);
  ------------------
  |  |   49|    401|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    401|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    401|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3271|       |
 3272|      3|            dctx->litPtr = dctx->litBuffer;
 3273|      3|            dctx->litSize = litSize;
 3274|      3|            dctx->litEntropy = 1;
 3275|      3|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|      3|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3276|      3|            return litCSize + lhSize;
 3277|    404|        }
 3278|      2|    case lbt_repeat:
  ------------------
  |  Branch (3278:5): [True: 2, False: 844]
  ------------------
 3279|      2|        {   size_t litSize, litCSize;
 3280|      2|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3281|      2|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (3281:17): [True: 1, False: 1]
  ------------------
 3282|      1|                return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3283|      1|            if (dctx->litEntropy==0)
  ------------------
  |  Branch (3283:17): [True: 1, False: 0]
  ------------------
 3284|      1|                return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3285|       |
 3286|       |            /* 2 - 2 - 10 - 10 */
 3287|      0|            lhSize=3;
 3288|      0|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3289|      0|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 3290|      0|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3290:17): [True: 0, False: 0]
  ------------------
 3291|       |
 3292|      0|            {   size_t const errorCode = HUFv07_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTable);
 3293|      0|                if (HUFv07_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  | 2858|      0|#define HUFv07_isError  ERR_isError
  ------------------
                              if (HUFv07_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3293:21): [True: 0, False: 0]
  ------------------
 3294|      0|            }
 3295|      0|            dctx->litPtr = dctx->litBuffer;
 3296|      0|            dctx->litSize = litSize;
 3297|      0|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|      0|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3298|      0|            return litCSize + lhSize;
 3299|      0|        }
 3300|     60|    case lbt_raw:
  ------------------
  |  Branch (3300:5): [True: 60, False: 786]
  ------------------
 3301|     60|        {   size_t litSize;
 3302|     60|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3303|     60|            switch(lhSize)
 3304|     60|            {
 3305|     41|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3305:13): [True: 20, False: 40]
  |  Branch (3305:21): [True: 21, False: 39]
  |  Branch (3305:29): [True: 0, False: 60]
  ------------------
 3306|     41|                lhSize=1;
 3307|     41|                litSize = istart[0] & 31;
 3308|     41|                break;
 3309|      6|            case 2:
  ------------------
  |  Branch (3309:13): [True: 6, False: 54]
  ------------------
 3310|      6|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3311|      6|                break;
 3312|     13|            case 3:
  ------------------
  |  Branch (3312:13): [True: 13, False: 47]
  ------------------
 3313|     13|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3314|     13|                break;
 3315|     60|            }
 3316|       |
 3317|     60|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  | 2721|     60|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (3317:17): [True: 31, False: 29]
  ------------------
 3318|     31|                if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     20|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     20|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     20|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3318:21): [True: 20, False: 11]
  ------------------
 3319|     11|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 3320|     11|                dctx->litPtr = dctx->litBuffer;
 3321|     11|                dctx->litSize = litSize;
 3322|     11|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|     11|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3323|     11|                return lhSize+litSize;
 3324|     31|            }
 3325|       |            /* direct reference into compressed stream */
 3326|     29|            dctx->litPtr = istart+lhSize;
 3327|     29|            dctx->litSize = litSize;
 3328|     29|            return lhSize+litSize;
 3329|     60|        }
 3330|    336|    case lbt_rle:
  ------------------
  |  Branch (3330:5): [True: 336, False: 510]
  ------------------
 3331|    336|        {   size_t litSize;
 3332|    336|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3333|    336|            switch(lhSize)
 3334|    336|            {
 3335|     36|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3335:13): [True: 2, False: 334]
  |  Branch (3335:21): [True: 34, False: 302]
  |  Branch (3335:29): [True: 0, False: 336]
  ------------------
 3336|     36|                lhSize = 1;
 3337|     36|                litSize = istart[0] & 31;
 3338|     36|                break;
 3339|     47|            case 2:
  ------------------
  |  Branch (3339:13): [True: 47, False: 289]
  ------------------
 3340|     47|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3341|     47|                break;
 3342|    253|            case 3:
  ------------------
  |  Branch (3342:13): [True: 253, False: 83]
  ------------------
 3343|    253|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3344|    253|                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: 252]
  ------------------
 3345|    252|                break;
 3346|    336|            }
 3347|    335|            if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  175|    335|#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 (3347:17): [True: 2, False: 333]
  ------------------
 3348|    333|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|    333|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3349|    333|            dctx->litPtr = dctx->litBuffer;
 3350|    333|            dctx->litSize = litSize;
 3351|    333|            return lhSize+1;
 3352|    335|        }
 3353|      0|    default:
  ------------------
  |  Branch (3353:5): [True: 0, False: 846]
  ------------------
 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|    846|    }
 3356|    846|}
zstd_v07.c:ZSTDv07_decompressSequences:
 3616|    376|{
 3617|    376|    const BYTE* ip = (const BYTE*)seqStart;
 3618|    376|    const BYTE* const iend = ip + seqSize;
 3619|    376|    BYTE* const ostart = (BYTE*)dst;
 3620|    376|    BYTE* const oend = ostart + maxDstSize;
 3621|    376|    BYTE* op = ostart;
 3622|    376|    const BYTE* litPtr = dctx->litPtr;
 3623|    376|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3624|    376|    FSEv07_DTable* DTableLL = dctx->LLTable;
 3625|    376|    FSEv07_DTable* DTableML = dctx->MLTable;
 3626|    376|    FSEv07_DTable* DTableOffb = dctx->OffTable;
 3627|    376|    const BYTE* const base = (const BYTE*) (dctx->base);
 3628|    376|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3629|    376|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3630|    376|    int nbSeq;
 3631|       |
 3632|       |    /* Build Decoding Tables */
 3633|    376|    {   size_t const seqHSize = ZSTDv07_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->fseEntropy, ip, seqSize);
 3634|    376|        if (ZSTDv07_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2856|    376|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3634:13): [True: 46, False: 330]
  ------------------
 3635|    330|        ip += seqHSize;
 3636|    330|    }
 3637|       |
 3638|       |    /* Regen sequences */
 3639|    330|    if (nbSeq) {
  ------------------
  |  Branch (3639:9): [True: 302, False: 28]
  ------------------
 3640|    302|        seqState_t seqState;
 3641|    302|        dctx->fseEntropy = 1;
 3642|  1.20k|        { U32 i; for (i=0; i<ZSTDv07_REP_INIT; i++) seqState.prevOffset[i] = dctx->rep[i]; }
  ------------------
  |  | 2639|  1.20k|#define ZSTDv07_REP_INIT   ZSTDv07_REP_NUM
  |  |  ------------------
  |  |  |  | 2638|  1.20k|#define ZSTDv07_REP_NUM    3
  |  |  ------------------
  ------------------
  |  Branch (3642:28): [True: 906, False: 302]
  ------------------
 3643|    302|        { size_t const errorCode = BITv07_initDStream(&(seqState.DStream), ip, iend-ip);
 3644|    302|          if (ERR_isError(errorCode)) 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 (3644:15): [True: 40, False: 262]
  ------------------
 3645|    262|        FSEv07_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3646|    262|        FSEv07_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3647|    262|        FSEv07_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3648|       |
 3649|  35.3k|        for ( ; (BITv07_reloadDStream(&(seqState.DStream)) <= BITv07_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3649:17): [True: 35.2k, False: 92]
  |  Branch (3649:92): [True: 35.2k, False: 52]
  ------------------
 3650|  35.2k|            nbSeq--;
 3651|  35.2k|            {   seq_t const sequence = ZSTDv07_decodeSequence(&seqState);
 3652|  35.2k|                size_t const oneSeqSize = ZSTDv07_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3653|  35.2k|                if (ZSTDv07_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2856|  35.2k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3653:21): [True: 118, False: 35.0k]
  ------------------
 3654|  35.0k|                op += oneSeqSize;
 3655|  35.0k|        }   }
 3656|       |
 3657|       |        /* check if reached exact end */
 3658|    144|        if (nbSeq) return ERROR(corruption_detected);
  ------------------
  |  |   49|     85|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     85|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     85|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3658:13): [True: 85, False: 59]
  ------------------
 3659|       |        /* save reps for next block */
 3660|    236|        { U32 i; for (i=0; i<ZSTDv07_REP_INIT; i++) dctx->rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  | 2639|    236|#define ZSTDv07_REP_INIT   ZSTDv07_REP_NUM
  |  |  ------------------
  |  |  |  | 2638|    236|#define ZSTDv07_REP_NUM    3
  |  |  ------------------
  ------------------
  |  Branch (3660:28): [True: 177, False: 59]
  ------------------
 3661|     59|    }
 3662|       |
 3663|       |    /* last literal segment */
 3664|     87|    {   size_t const lastLLSize = litEnd - litPtr;
 3665|       |        /* if (litPtr > litEnd) return ERROR(corruption_detected); */   /* too many literals already used */
 3666|     87|        if (lastLLSize > (size_t)(oend-op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3666:13): [True: 13, False: 74]
  ------------------
 3667|     74|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3667:13): [True: 69, False: 5]
  ------------------
 3668|     69|            memcpy(op, litPtr, lastLLSize);
 3669|     69|            op += lastLLSize;
 3670|     69|        }
 3671|     74|    }
 3672|       |
 3673|      0|    return op-ostart;
 3674|     87|}
zstd_v07.c:ZSTDv07_decodeSeqHeaders:
 3396|    376|{
 3397|    376|    const BYTE* const istart = (const BYTE*)src;
 3398|    376|    const BYTE* const iend = istart + srcSize;
 3399|    376|    const BYTE* ip = istart;
 3400|       |
 3401|       |    /* check */
 3402|    376|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  | 2662|    376|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
                  if (srcSize < MIN_SEQUENCES_SIZE) 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 (3402:9): [True: 1, False: 375]
  ------------------
 3403|       |
 3404|       |    /* SeqHead */
 3405|    375|    {   int nbSeq = *ip++;
 3406|    375|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3406:13): [True: 22, False: 353]
  ------------------
 3407|    353|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3407:13): [True: 184, False: 169]
  ------------------
 3408|    184|            if (nbSeq == 0xFF) {
  ------------------
  |  Branch (3408:17): [True: 36, False: 148]
  ------------------
 3409|     36|                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 (3409:21): [True: 1, False: 35]
  ------------------
 3410|     35|                nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
  ------------------
  |  | 2668|     35|#define LONGNBSEQ 0x7F00
  ------------------
 3411|    148|            } else {
 3412|    148|                if (ip >= iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3412:21): [True: 1, False: 147]
  ------------------
 3413|    147|                nbSeq = ((nbSeq-0x80)<<8) + *ip++;
 3414|    147|            }
 3415|    184|        }
 3416|    351|        *nbSeqPtr = nbSeq;
 3417|    351|    }
 3418|       |
 3419|       |    /* FSE table descriptors */
 3420|    351|    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|      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 (3420:9): [True: 4, False: 347]
  ------------------
 3421|    347|    {   U32 const LLtype  = *ip >> 6;
 3422|    347|        U32 const OFtype = (*ip >> 4) & 3;
 3423|    347|        U32 const MLtype  = (*ip >> 2) & 3;
 3424|    347|        ip++;
 3425|       |
 3426|       |        /* Build DTables */
 3427|    347|        {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2676|    347|#define MaxLL  35
  ------------------
                      {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2680|    347|#define LLFSELog    9
  ------------------
 3428|    347|            if (ZSTDv07_isError(llhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    347|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(llhSize)) 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 (3428:17): [True: 7, False: 340]
  ------------------
 3429|    340|            ip += llhSize;
 3430|    340|        }
 3431|    340|        {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2677|    340|#define MaxOff 28
  ------------------
                      {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2681|    340|#define OffFSELog   8
  ------------------
 3432|    340|            if (ZSTDv07_isError(ofhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    340|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(ofhSize)) 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 (3432:17): [True: 12, False: 328]
  ------------------
 3433|    328|            ip += ofhSize;
 3434|    328|        }
 3435|    328|        {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2675|    328|#define MaxML  52
  ------------------
                      {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2679|    328|#define MLFSELog    9
  ------------------
 3436|    328|            if (ZSTDv07_isError(mlhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    328|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(mlhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     20|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     20|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     20|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3436:17): [True: 20, False: 308]
  ------------------
 3437|    308|            ip += mlhSize;
 3438|    308|    }   }
 3439|       |
 3440|      0|    return ip-istart;
 3441|    328|}
zstd_v07.c:ZSTDv07_buildSeqTable:
 3366|  1.01k|{
 3367|  1.01k|    switch(type)
 3368|  1.01k|    {
 3369|    184|    case FSEv07_ENCODING_RLE :
  ------------------
  |  | 2684|    184|#define FSEv07_ENCODING_RLE     1
  ------------------
  |  Branch (3369:5): [True: 184, False: 831]
  ------------------
 3370|    184|        if (!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 (3370:13): [True: 2, False: 182]
  ------------------
 3371|    182|        if ( (*(const BYTE*)src) > 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 (3371:14): [True: 3, False: 179]
  ------------------
 3372|    179|        FSEv07_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3373|    179|        return 1;
 3374|    406|    case FSEv07_ENCODING_RAW :
  ------------------
  |  | 2683|    406|#define FSEv07_ENCODING_RAW     0
  ------------------
  |  Branch (3374:5): [True: 406, False: 609]
  ------------------
 3375|    406|        FSEv07_buildDTable(DTable, defaultNorm, max, defaultLog);
 3376|    406|        return 0;
 3377|     13|    case FSEv07_ENCODING_STATIC:
  ------------------
  |  | 2685|     13|#define FSEv07_ENCODING_STATIC  2
  ------------------
  |  Branch (3377:5): [True: 13, False: 1.00k]
  ------------------
 3378|     13|        if (!flagRepeatTable) 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 (3378:13): [True: 3, False: 10]
  ------------------
 3379|     10|        return 0;
 3380|      0|    default :   /* impossible */
  ------------------
  |  Branch (3380:5): [True: 0, False: 1.01k]
  ------------------
 3381|    412|    case FSEv07_ENCODING_DYNAMIC :
  ------------------
  |  | 2686|    412|#define FSEv07_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3381:5): [True: 412, False: 603]
  ------------------
 3382|    412|        {   U32 tableLog;
 3383|    412|            S16 norm[MaxSeq+1];
 3384|    412|            size_t const headerSize = FSEv07_readNCount(norm, &max, &tableLog, src, srcSize);
 3385|    412|            if (FSEv07_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2857|    412|#define FSEv07_isError  ERR_isError
  ------------------
                          if (FSEv07_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     20|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     20|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     20|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3385:17): [True: 20, False: 392]
  ------------------
 3386|    392|            if (tableLog > maxLog) 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 (3386:17): [True: 11, False: 381]
  ------------------
 3387|    381|            FSEv07_buildDTable(DTable, norm, max, tableLog);
 3388|    381|            return headerSize;
 3389|    392|    }   }
 3390|  1.01k|}
zstd_v07.c:ZSTDv07_decodeSequence:
 3460|  35.2k|{
 3461|  35.2k|    seq_t seq;
 3462|       |
 3463|  35.2k|    U32 const llCode = FSEv07_peekSymbol(&(seqState->stateLL));
 3464|  35.2k|    U32 const mlCode = FSEv07_peekSymbol(&(seqState->stateML));
 3465|  35.2k|    U32 const ofCode = FSEv07_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3466|       |
 3467|  35.2k|    U32 const llBits = LL_bits[llCode];
 3468|  35.2k|    U32 const mlBits = ML_bits[mlCode];
 3469|  35.2k|    U32 const ofBits = ofCode;
 3470|  35.2k|    U32 const totalBits = llBits+mlBits+ofBits;
 3471|       |
 3472|  35.2k|    static const U32 LL_base[MaxLL+1] = {
 3473|  35.2k|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3474|  35.2k|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3475|  35.2k|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3476|       |
 3477|  35.2k|    static const U32 ML_base[MaxML+1] = {
 3478|  35.2k|                             3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,   14,    15,    16,    17,    18,
 3479|  35.2k|                            19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,   30,    31,    32,    33,    34,
 3480|  35.2k|                            35, 37, 39, 41, 43, 47, 51, 59, 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
 3481|  35.2k|                            0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };
 3482|       |
 3483|  35.2k|    static const U32 OF_base[MaxOff+1] = {
 3484|  35.2k|                 0,        1,       1,       5,     0xD,     0x1D,     0x3D,     0x7D,
 3485|  35.2k|                 0xFD,   0x1FD,   0x3FD,   0x7FD,   0xFFD,   0x1FFD,   0x3FFD,   0x7FFD,
 3486|  35.2k|                 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
 3487|  35.2k|                 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD };
 3488|       |
 3489|       |    /* sequence */
 3490|  35.2k|    {   size_t offset;
 3491|  35.2k|        if (!ofCode)
  ------------------
  |  Branch (3491:13): [True: 31.8k, False: 3.38k]
  ------------------
 3492|  31.8k|            offset = 0;
 3493|  3.38k|        else {
 3494|  3.38k|            offset = OF_base[ofCode] + BITv07_readBits(&(seqState->DStream), ofBits);   /* <=  (ZSTDv07_WINDOWLOG_MAX-1) bits */
 3495|  3.38k|            if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3495:17): [True: 0, False: 3.38k]
  ------------------
 3496|  3.38k|        }
 3497|       |
 3498|  35.2k|        if (ofCode <= 1) {
  ------------------
  |  Branch (3498:13): [True: 33.3k, False: 1.86k]
  ------------------
 3499|  33.3k|            if ((llCode == 0) & (offset <= 1)) offset = 1-offset;
  ------------------
  |  Branch (3499:17): [True: 17.0k, False: 16.2k]
  ------------------
 3500|  33.3k|            if (offset) {
  ------------------
  |  Branch (3500:17): [True: 17.6k, False: 15.7k]
  ------------------
 3501|  17.6k|                size_t const temp = seqState->prevOffset[offset];
 3502|  17.6k|                if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (3502:21): [True: 538, False: 17.0k]
  ------------------
 3503|  17.6k|                seqState->prevOffset[1] = seqState->prevOffset[0];
 3504|  17.6k|                seqState->prevOffset[0] = offset = temp;
 3505|  17.6k|            } else {
 3506|  15.7k|                offset = seqState->prevOffset[0];
 3507|  15.7k|            }
 3508|  33.3k|        } else {
 3509|  1.86k|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3510|  1.86k|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3511|  1.86k|            seqState->prevOffset[0] = offset;
 3512|  1.86k|        }
 3513|  35.2k|        seq.offset = offset;
 3514|  35.2k|    }
 3515|       |
 3516|  35.2k|    seq.matchLength = ML_base[mlCode] + ((mlCode>31) ? BITv07_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3516:42): [True: 2.60k, False: 32.6k]
  ------------------
 3517|  35.2k|    if (MEM_32bits() && (mlBits+llBits>24)) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3517:9): [True: 0, False: 35.2k]
  |  Branch (3517:25): [True: 0, False: 0]
  ------------------
 3518|       |
 3519|  35.2k|    seq.litLength = LL_base[llCode] + ((llCode>15) ? BITv07_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3519:40): [True: 1.26k, False: 33.9k]
  ------------------
 3520|  35.2k|    if (MEM_32bits() ||
  ------------------
  |  Branch (3520:9): [True: 0, False: 35.2k]
  ------------------
 3521|  35.2k|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2680|  35.2k|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2679|  35.2k|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2681|  35.2k|#define OffFSELog   8
  ------------------
  |  Branch (3521:8): [True: 88, False: 35.1k]
  ------------------
 3522|       |
 3523|       |    /* ANS state update */
 3524|  35.2k|    FSEv07_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3525|  35.2k|    FSEv07_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3526|  35.2k|    if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3526:9): [True: 0, False: 35.2k]
  ------------------
 3527|  35.2k|    FSEv07_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3528|       |
 3529|  35.2k|    return seq;
 3530|  35.2k|}
zstd_v07.c:FSEv07_peekSymbol:
  827|   105k|{
  828|   105k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  829|   105k|    return DInfo.symbol;
  830|   105k|}
zstd_v07.c:FSEv07_updateState:
  833|   105k|{
  834|   105k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  835|   105k|    U32 const nbBits = DInfo.nbBits;
  836|   105k|    size_t const lowBits = BITv07_readBits(bitD, nbBits);
  837|   105k|    DStatePtr->state = DInfo.newState + lowBits;
  838|   105k|}
zstd_v07.c:ZSTDv07_execSequence:
 3538|  35.2k|{
 3539|  35.2k|    BYTE* const oLitEnd = op + sequence.litLength;
 3540|  35.2k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3541|  35.2k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3542|  35.2k|    BYTE* const oend_w = oend-WILDCOPY_OVERLENGTH;
  ------------------
  |  | 2721|  35.2k|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3543|  35.2k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3544|  35.2k|    const BYTE* match = oLitEnd - sequence.offset;
 3545|       |
 3546|       |    /* check */
 3547|  35.2k|    assert(oend >= op);
  ------------------
  |  |   70|  35.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3548|  35.2k|    if (sequence.litLength + WILDCOPY_OVERLENGTH > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  | 2721|  35.2k|#define WILDCOPY_OVERLENGTH 8
  ------------------
                  if (sequence.litLength + WILDCOPY_OVERLENGTH > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     31|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     31|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     31|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3548:9): [True: 31, False: 35.1k]
  ------------------
 3549|  35.1k|    if (sequenceLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3549:9): [True: 16, False: 35.1k]
  ------------------
 3550|  35.1k|    assert(litLimit >= *litPtr);
  ------------------
  |  |   70|  35.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3551|  35.1k|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) 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 (3551:9): [True: 14, False: 35.1k]
  ------------------
 3552|       |
 3553|       |    /* copy Literals */
 3554|  35.1k|    ZSTDv07_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
 3555|  35.1k|    op = oLitEnd;
 3556|  35.1k|    *litPtr = iLitEnd;   /* update for next sequence */
 3557|       |
 3558|       |    /* copy Match */
 3559|  35.1k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3559:9): [True: 383, False: 34.7k]
  ------------------
 3560|       |        /* offset beyond prefix */
 3561|    383|        if (sequence.offset > (size_t)(oLitEnd - vBase)) 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 (3561:13): [True: 57, False: 326]
  ------------------
 3562|    326|        match = dictEnd - (base-match);
 3563|    326|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3563:13): [True: 274, False: 52]
  ------------------
 3564|    274|            memmove(oLitEnd, match, sequence.matchLength);
 3565|    274|            return sequenceLength;
 3566|    274|        }
 3567|       |        /* span extDict & currentPrefixSegment */
 3568|     52|        {   size_t const length1 = (size_t)(dictEnd - match);
 3569|     52|            memmove(oLitEnd, match, length1);
 3570|     52|            op = oLitEnd + length1;
 3571|     52|            sequence.matchLength -= length1;
 3572|     52|            match = base;
 3573|     52|            if (op > oend_w || sequence.matchLength < MINMATCH) {
  ------------------
  |  | 2670|     52|#define MINMATCH 3
  ------------------
  |  Branch (3573:17): [True: 0, False: 52]
  |  Branch (3573:32): [True: 22, False: 30]
  ------------------
 3574|     56|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3574:22): [True: 34, False: 22]
  ------------------
 3575|     22|              return sequenceLength;
 3576|     22|            }
 3577|     52|    }   }
 3578|       |    /* Requirement: op <= oend_w */
 3579|       |
 3580|       |    /* match within prefix */
 3581|  34.7k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3581:9): [True: 30.6k, False: 4.17k]
  ------------------
 3582|       |        /* close range match, overlap */
 3583|  30.6k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3584|  30.6k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3585|  30.6k|        int const sub2 = dec64table[sequence.offset];
 3586|  30.6k|        op[0] = match[0];
 3587|  30.6k|        op[1] = match[1];
 3588|  30.6k|        op[2] = match[2];
 3589|  30.6k|        op[3] = match[3];
 3590|  30.6k|        match += dec32table[sequence.offset];
 3591|  30.6k|        ZSTDv07_copy4(op+4, match);
 3592|  30.6k|        match -= sub2;
 3593|  30.6k|    } else {
 3594|  4.17k|        ZSTDv07_copy8(op, match);
 3595|  4.17k|    }
 3596|  34.7k|    op += 8; match += 8;
 3597|       |
 3598|  34.7k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  | 2670|  34.7k|#define MINMATCH 3
  ------------------
  |  Branch (3598:9): [True: 28, False: 34.7k]
  ------------------
 3599|     28|        if (op < oend_w) {
  ------------------
  |  Branch (3599:13): [True: 22, False: 6]
  ------------------
 3600|     22|            ZSTDv07_wildcopy(op, match, oend_w - op);
 3601|     22|            match += oend_w - op;
 3602|     22|            op = oend_w;
 3603|     22|        }
 3604|     92|        while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3604:16): [True: 64, False: 28]
  ------------------
 3605|  34.7k|    } else {
 3606|  34.7k|        ZSTDv07_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3607|  34.7k|    }
 3608|  34.7k|    return sequenceLength;
 3609|  35.1k|}
zstd_v07.c:ZSTDv07_wildcopy:
 2723|  69.9k|{
 2724|  69.9k|    const BYTE* ip = (const BYTE*)src;
 2725|  69.9k|    BYTE* op = (BYTE*)dst;
 2726|  69.9k|    BYTE* const oend = op + length;
 2727|  69.9k|    do
 2728|  5.61M|        COPY8(op, ip)
  ------------------
  |  | 2717|  5.61M|#define COPY8(d,s) { ZSTDv07_copy8(d,s); d+=8; s+=8; }
  ------------------
 2729|  5.61M|    while (op < oend);
  ------------------
  |  Branch (2729:12): [True: 5.54M, False: 69.9k]
  ------------------
 2730|  69.9k|}
zstd_v07.c:ZSTDv07_copy4:
 2864|  30.6k|static void ZSTDv07_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v07.c:ZSTDv07_copy8:
 2716|  5.61M|static void ZSTDv07_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v07.c:ZSTDv07_decompressFrame:
 3743|    979|{
 3744|    979|    const BYTE* ip = (const BYTE*)src;
 3745|    979|    const BYTE* const iend = ip + srcSize;
 3746|    979|    BYTE* const ostart = (BYTE*)dst;
 3747|    979|    BYTE* const oend = ostart + dstCapacity;
 3748|    979|    BYTE* op = ostart;
 3749|    979|    size_t remainingSize = srcSize;
 3750|       |
 3751|       |    /* check */
 3752|    979|    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: 979]
  ------------------
 3753|       |
 3754|       |    /* Frame Header */
 3755|    979|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, ZSTDv07_frameHeaderSize_min);
 3756|    979|        if (ZSTDv07_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2856|    979|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3756:13): [True: 0, False: 979]
  ------------------
 3757|    979|        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: 979]
  ------------------
 3758|    979|        if (ZSTDv07_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3758:13): [True: 74, False: 905]
  ------------------
 3759|    905|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3760|    905|    }
 3761|       |
 3762|       |    /* Loop on each block */
 3763|  1.74k|    while (1) {
  ------------------
  |  Branch (3763:12): [True: 1.74k, Folded]
  ------------------
 3764|  1.74k|        size_t decodedSize;
 3765|  1.74k|        blockProperties_t blockProperties;
 3766|  1.74k|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, iend-ip, &blockProperties);
 3767|  1.74k|        if (ZSTDv07_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2856|  1.74k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3767:13): [True: 0, False: 1.74k]
  ------------------
 3768|       |
 3769|  1.74k|        ip += ZSTDv07_blockHeaderSize;
 3770|  1.74k|        remainingSize -= ZSTDv07_blockHeaderSize;
 3771|  1.74k|        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.74k]
  ------------------
 3772|       |
 3773|  1.74k|        switch(blockProperties.blockType)
 3774|  1.74k|        {
 3775|    849|        case bt_compressed:
  ------------------
  |  Branch (3775:9): [True: 849, False: 900]
  ------------------
 3776|    849|            decodedSize = ZSTDv07_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3777|    849|            break;
 3778|     25|        case bt_raw :
  ------------------
  |  Branch (3778:9): [True: 25, False: 1.72k]
  ------------------
 3779|     25|            decodedSize = ZSTDv07_copyRawBlock(op, oend-op, ip, cBlockSize);
 3780|     25|            break;
 3781|    754|        case bt_rle :
  ------------------
  |  Branch (3781:9): [True: 754, False: 995]
  ------------------
 3782|    754|            decodedSize = ZSTDv07_generateNxBytes(op, oend-op, *ip, blockProperties.origSize);
 3783|    754|            break;
 3784|    121|        case bt_end :
  ------------------
  |  Branch (3784:9): [True: 121, False: 1.62k]
  ------------------
 3785|       |            /* end of frame */
 3786|    121|            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: 121]
  ------------------
 3787|    121|            decodedSize = 0;
 3788|    121|            break;
 3789|      0|        default:
  ------------------
  |  Branch (3789:9): [True: 0, False: 1.74k]
  ------------------
 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.74k|        }
 3792|  1.74k|        if (blockProperties.blockType == bt_end) break;   /* bt_end */
  ------------------
  |  Branch (3792:13): [True: 121, False: 1.62k]
  ------------------
 3793|       |
 3794|  1.62k|        if (ZSTDv07_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2856|  1.62k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3794:13): [True: 784, False: 844]
  ------------------
 3795|    844|        if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, op, decodedSize);
  ------------------
  |  |  460|    170|#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
  |  |  ------------------
  |  |  |  |  443|    170|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    170|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3795:13): [True: 170, False: 674]
  ------------------
 3796|    844|        op += decodedSize;
 3797|    844|        ip += cBlockSize;
 3798|    844|        remainingSize -= cBlockSize;
 3799|    844|    }
 3800|       |
 3801|    121|    return op-ostart;
 3802|    905|}
zstd_v07.c:ZSTDv07_generateNxBytes:
 3729|    754|{
 3730|    754|    if (length > dstCapacity) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3730:9): [True: 8, False: 746]
  ------------------
 3731|    746|    if (length > 0) {
  ------------------
  |  Branch (3731:9): [True: 729, False: 17]
  ------------------
 3732|    729|        memset(dst, byte, length);
 3733|    729|    }
 3734|    746|    return length;
 3735|    754|}
zstd_v07.c:ZSTD_errorFrameSizeInfoLegacy:
 3855|     28|{
 3856|     28|    *cSize = ret;
 3857|     28|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  | 2688|     28|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3858|     28|}
zstd_v07.c:ZSTDv07_getcBlockSize:
 3201|  4.87k|{
 3202|  4.87k|    const BYTE* const in = (const BYTE*)src;
 3203|  4.87k|    U32 cSize;
 3204|       |
 3205|  4.87k|    if (srcSize < ZSTDv07_blockHeaderSize) 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 (3205:9): [True: 3, False: 4.86k]
  ------------------
 3206|       |
 3207|  4.86k|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 3208|  4.86k|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 3209|  4.86k|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (3209:23): [True: 1.66k, False: 3.20k]
  ------------------
 3210|       |
 3211|  4.86k|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (3211:9): [True: 1.10k, False: 3.76k]
  ------------------
 3212|  3.76k|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (3212:9): [True: 1.66k, False: 2.10k]
  ------------------
 3213|  2.10k|    return cSize;
 3214|  3.76k|}
zstd_v07.c:ZSTDv07_decodeFrameHeader:
 3184|    979|{
 3185|    979|    size_t const result = ZSTDv07_getFrameParams(&(dctx->fParams), src, srcSize);
 3186|    979|    if (dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID)) return ERROR(dictionary_wrong);
  ------------------
  |  |   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 (3186:9): [True: 44, False: 935]
  |  Branch (3186:33): [True: 44, False: 0]
  ------------------
 3187|    935|    if (dctx->fParams.checksumFlag) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|    170|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|    170|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    170|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3187:9): [True: 170, False: 765]
  ------------------
 3188|    935|    return result;
 3189|    979|}
zstd_v07.c:ZSTDv07_copyRawBlock:
 3218|     25|{
 3219|     25|    if (srcSize > dstCapacity) 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 (3219:9): [True: 1, False: 24]
  ------------------
 3220|     24|    if (srcSize > 0) {
  ------------------
  |  Branch (3220:9): [True: 19, False: 5]
  ------------------
 3221|     19|        memcpy(dst, src, srcSize);
 3222|     19|    }
 3223|     24|    return srcSize;
 3224|     25|}
zstd_v07.c:ZSTDv07_decompress_insertDictionary:
 4092|    503|{
 4093|    503|    if (dictSize < 8) return ZSTDv07_refDictContent(dctx, dict, dictSize);
  ------------------
  |  Branch (4093:9): [True: 12, False: 491]
  ------------------
 4094|    491|    {   U32 const magic = MEM_readLE32(dict);
 4095|    491|        if (magic != ZSTDv07_DICT_MAGIC) {
  ------------------
  |  | 2636|    491|#define ZSTDv07_DICT_MAGIC  0xEC30A437   /* v0.7 */
  ------------------
  |  Branch (4095:13): [True: 491, False: 0]
  ------------------
 4096|    491|            return ZSTDv07_refDictContent(dctx, dict, dictSize);   /* pure content mode */
 4097|    491|    }   }
 4098|      0|    dctx->dictID = MEM_readLE32((const char*)dict + 4);
 4099|       |
 4100|       |    /* load entropy tables */
 4101|      0|    dict = (const char*)dict + 8;
 4102|      0|    dictSize -= 8;
 4103|      0|    {   size_t const eSize = ZSTDv07_loadEntropy(dctx, dict, dictSize);
 4104|      0|        if (ZSTDv07_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2856|      0|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv07_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4104:13): [True: 0, False: 0]
  ------------------
 4105|      0|        dict = (const char*)dict + eSize;
 4106|      0|        dictSize -= eSize;
 4107|      0|    }
 4108|       |
 4109|       |    /* reference dictionary content */
 4110|      0|    return ZSTDv07_refDictContent(dctx, dict, dictSize);
 4111|      0|}
zstd_v07.c:ZSTDv07_refDictContent:
 4033|    503|{
 4034|    503|    dctx->dictEnd = dctx->previousDstEnd;
 4035|    503|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 4036|    503|    dctx->base = dict;
 4037|    503|    dctx->previousDstEnd = (const char*)dict + dictSize;
 4038|    503|    return 0;
 4039|    503|}

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

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

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

blosc2.c:blosc2_checked_add_i64:
   51|     26|static inline bool blosc2_checked_add_i64(int64_t a, int64_t b, int64_t *out) {
   52|     26|  if ((b > 0 && a > INT64_MAX - b) || (b < 0 && a < INT64_MIN - b)) {
  ------------------
  |  Branch (52:8): [True: 26, False: 0]
  |  Branch (52:17): [True: 0, False: 26]
  |  Branch (52:40): [True: 0, False: 26]
  |  Branch (52:49): [True: 0, False: 0]
  ------------------
   53|      0|    return false;
   54|      0|  }
   55|     26|  if (out != NULL) {
  ------------------
  |  Branch (55:7): [True: 26, False: 0]
  ------------------
   56|     26|    *out = a + b;
   57|     26|  }
   58|       |  return true;
   59|     26|}
blosc2.c:blosc2_checked_mul_size:
   41|  27.9k|static inline bool blosc2_checked_mul_size(size_t a, size_t b, size_t *out) {
   42|  27.9k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (42:7): [True: 27.9k, False: 16]
  |  Branch (42:17): [True: 0, False: 27.9k]
  ------------------
   43|      0|    return false;
   44|      0|  }
   45|  27.9k|  if (out != NULL) {
  ------------------
  |  Branch (45:7): [True: 27.9k, False: 0]
  ------------------
   46|  27.9k|    *out = a * b;
   47|  27.9k|  }
   48|       |  return true;
   49|  27.9k|}
blosc2.c:blosc2_checked_add_size:
   31|  28.0k|static inline bool blosc2_checked_add_size(size_t a, size_t b, size_t *out) {
   32|  28.0k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (32:7): [True: 0, False: 28.0k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|  28.0k|  if (out != NULL) {
  ------------------
  |  Branch (35:7): [True: 28.0k, False: 0]
  ------------------
   36|  28.0k|    *out = a + b;
   37|  28.0k|  }
   38|       |  return true;
   39|  28.0k|}

blosc2.c:is_little_endian:
   42|  21.8M|static bool is_little_endian(void) {
   43|  21.8M|  static const int i = 1;
   44|  21.8M|  char* p = (char*)&i;
   45|       |
   46|  21.8M|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 21.8M, False: 0]
  ------------------
   47|  21.8M|    return true;
   48|  21.8M|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|  21.8M|}
blosc2.c:load_lib:
  317|      3|static inline void* load_lib(char *plugin_name, char *libpath) {
  318|      3|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (318:7): [True: 0, False: 3]
  ------------------
  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|      3|    snprintf(libpath, PATH_MAX, "libblosc2_%s.so", plugin_name);
  329|      3|#endif
  330|      3|    void* loaded_lib = dlopen(libpath, RTLD_LAZY);
  331|      3|    if (loaded_lib != NULL) {
  ------------------
  |  Branch (331:9): [True: 0, False: 3]
  ------------------
  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|      3|    } else {
  335|       |#if defined(_WIN32)
  336|       |        BLOSC_TRACE_INFO("Failed to load %s directly, error: %lu\n", libpath, GetLastError());
  337|       |#else
  338|      3|        BLOSC_TRACE_INFO("Failed to load %s directly, error: %s\n", libpath, dlerror());
  ------------------
  |  |   95|      3|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  339|      3|#endif
  340|      3|    }
  341|       |    // If direct loading fails, fallback to using Python to find the library path
  342|      3|    if (get_libpath(plugin_name, libpath, "") < 0 && get_libpath(plugin_name, libpath, "3") < 0) {
  ------------------
  |  Branch (342:9): [True: 3, False: 0]
  |  Branch (342:54): [True: 3, False: 0]
  ------------------
  343|      3|        BLOSC_TRACE_ERROR("Problems when running python or python3 for getting plugin path");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|      3|        return NULL;
  345|      3|    }
  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|      9|static inline bool blosc2_valid_plugin_name(const char *plugin_name) {
  276|      9|  if (plugin_name == NULL || plugin_name[0] == '\0') {
  ------------------
  |  Branch (276:7): [True: 0, False: 9]
  |  Branch (276:30): [True: 0, False: 9]
  ------------------
  277|      0|    return false;
  278|      0|  }
  279|     48|  for (const unsigned char *p = (const unsigned char *)plugin_name; *p != '\0'; ++p) {
  ------------------
  |  Branch (279:69): [True: 39, False: 9]
  ------------------
  280|     39|    if (!isalnum(*p) && *p != '_') {
  ------------------
  |  Branch (280:9): [True: 0, False: 39]
  |  Branch (280:25): [True: 0, False: 0]
  ------------------
  281|      0|      return false;
  282|      0|    }
  283|     39|  }
  284|      9|  return true;
  285|      9|}
blosc2.c:get_libpath:
  288|      6|static inline int get_libpath(char *plugin_name, char *libpath, char *python_version) {
  289|      6|  BLOSC_TRACE_INFO("Trying to get plugin path with python%s\n", python_version);
  ------------------
  |  |   95|      6|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|      6|  char python_cmd[PATH_MAX] = {0};
  291|      6|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (291:7): [True: 0, False: 6]
  ------------------
  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|      6|  int written = snprintf(python_cmd, sizeof(python_cmd),
  296|      6|                         "python%s -c \"import blosc2_%s; blosc2_%s.print_libpath()\"",
  297|      6|                         python_version, plugin_name, plugin_name);
  298|      6|  if (written < 0 || (size_t)written >= sizeof(python_cmd)) {
  ------------------
  |  Branch (298:7): [True: 0, False: 6]
  |  Branch (298:22): [True: 0, False: 6]
  ------------------
  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|      6|  FILE *fp = popen(python_cmd, "r");
  303|      6|  if (fp == NULL) {
  ------------------
  |  Branch (303:7): [True: 0, False: 6]
  ------------------
  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|      6|  if (fgets(libpath, PATH_MAX, fp) == NULL) {
  ------------------
  |  Branch (307:7): [True: 6, False: 0]
  ------------------
  308|      6|    BLOSC_TRACE_ERROR("Could not read python output");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|      6|    pclose(fp);
  310|      6|    return BLOSC2_ERROR_FAILURE;
  311|      6|  }
  312|      0|  pclose(fp);
  313|       |
  314|      0|  return BLOSC2_ERROR_SUCCESS;
  315|      6|}
blosc2.c:sw32_:
  115|   110k|static inline int32_t sw32_(const void* pa) {
  116|   110k|  int32_t idest;
  117|       |
  118|   110k|  bool little_endian = is_little_endian();
  119|   110k|  if (little_endian) {
  ------------------
  |  Branch (119:7): [True: 110k, False: 0]
  ------------------
  120|   110k|    memcpy(&idest, pa, sizeof(idest));
  121|   110k|  }
  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|   110k|  return idest;
  137|   110k|}
frame.c:endian_handler:
   56|   214k|{
   57|   214k|  bool little_endian = is_little_endian();
   58|   214k|  if (little_endian == little) {
  ------------------
  |  Branch (58:7): [True: 0, False: 214k]
  ------------------
   59|      0|    memcpy(dest, pa, size);
   60|      0|  }
   61|   214k|  else {
   62|   214k|    uint8_t* pa_ = (uint8_t*)pa;
   63|   214k|    uint8_t pa2_[8];
   64|   214k|    switch (size) {
   65|  88.3k|      case 8:
  ------------------
  |  Branch (65:7): [True: 88.3k, False: 125k]
  ------------------
   66|  88.3k|        pa2_[0] = pa_[7];
   67|  88.3k|        pa2_[1] = pa_[6];
   68|  88.3k|        pa2_[2] = pa_[5];
   69|  88.3k|        pa2_[3] = pa_[4];
   70|  88.3k|        pa2_[4] = pa_[3];
   71|  88.3k|        pa2_[5] = pa_[2];
   72|  88.3k|        pa2_[6] = pa_[1];
   73|  88.3k|        pa2_[7] = pa_[0];
   74|  88.3k|        break;
   75|   114k|      case 4:
  ------------------
  |  Branch (75:7): [True: 114k, False: 99.6k]
  ------------------
   76|   114k|        pa2_[0] = pa_[3];
   77|   114k|        pa2_[1] = pa_[2];
   78|   114k|        pa2_[2] = pa_[1];
   79|   114k|        pa2_[3] = pa_[0];
   80|   114k|        break;
   81|  2.13k|      case 2:
  ------------------
  |  Branch (81:7): [True: 2.13k, False: 212k]
  ------------------
   82|  2.13k|        pa2_[0] = pa_[1];
   83|  2.13k|        pa2_[1] = pa_[0];
   84|  2.13k|        break;
   85|  9.14k|      case 1:
  ------------------
  |  Branch (85:7): [True: 9.14k, False: 204k]
  ------------------
   86|  9.14k|        pa2_[0] = pa_[0];
   87|  9.14k|        break;
   88|      0|      default:
  ------------------
  |  Branch (88:7): [True: 0, False: 214k]
  ------------------
   89|      0|        BLOSC_TRACE_ERROR("Unhandled size: %d.", 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|   214k|    }
   91|   214k|    memcpy(dest, pa2_, size);
   92|   214k|  }
   93|   214k|}
frame.c:is_little_endian:
   42|   214k|static bool is_little_endian(void) {
   43|   214k|  static const int i = 1;
   44|   214k|  char* p = (char*)&i;
   45|       |
   46|   214k|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 214k, False: 0]
  ------------------
   47|   214k|    return true;
   48|   214k|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|   214k|}
frame.c:blosc2_nchunks_to_offsets_nbytes:
  103|  60.6k|static inline bool blosc2_nchunks_to_offsets_nbytes(int64_t nchunks, int32_t *off_nbytes) {
  104|  60.6k|  const int64_t max_nchunks = INT32_MAX / (int64_t)sizeof(int64_t);
  105|  60.6k|  if (nchunks < 0 || nchunks > max_nchunks) {
  ------------------
  |  Branch (105:7): [True: 0, False: 60.6k]
  |  Branch (105:22): [True: 1, False: 60.6k]
  ------------------
  106|      1|    return false;
  107|      1|  }
  108|  60.6k|  if (off_nbytes != NULL) {
  ------------------
  |  Branch (108:7): [True: 60.6k, False: 0]
  ------------------
  109|  60.6k|    *off_nbytes = (int32_t)(nchunks * (int64_t)sizeof(int64_t));
  110|  60.6k|  }
  111|       |  return true;
  112|  60.6k|}

blosc2_stdio_open:
  106|     26|void *blosc2_stdio_open(const char *urlpath, const char *mode, void *params) {
  107|     26|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|     26|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  108|     26|  if (urlpath == NULL || mode == NULL) {
  ------------------
  |  Branch (108:7): [True: 26, False: 0]
  |  Branch (108:26): [True: 0, False: 0]
  ------------------
  109|     26|    BLOSC_TRACE_ERROR("Invalid arguments for stdio open.");
  ------------------
  |  |   93|     26|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     26|    do {                                            \
  |  |  |  |   98|     26|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     26|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 26, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     26|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|     26|    return NULL;
  111|     26|  }
  112|      0|  FILE *file = fopen(urlpath, mode);
  113|      0|  if (file == NULL) {
  ------------------
  |  Branch (113:7): [True: 0, False: 0]
  ------------------
  114|      0|    BLOSC_TRACE_ERROR("Cannot open the file %s with mode %s.", urlpath, mode);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|      0|    return NULL;
  116|      0|  }
  117|      0|#if !defined(_WIN32)
  118|       |  /* Frames keep their handles open between calls, so do not let exec'd child
  119|       |     processes inherit them */
  120|      0|  int fd_flags = fcntl(fileno(file), F_GETFD);
  121|      0|  if (fd_flags >= 0) {
  ------------------
  |  Branch (121:7): [True: 0, False: 0]
  ------------------
  122|      0|    fcntl(fileno(file), F_SETFD, fd_flags | FD_CLOEXEC);
  123|      0|  }
  124|      0|#endif
  125|      0|  blosc2_stdio_file *my_fp = malloc(sizeof(blosc2_stdio_file));
  126|      0|  if (my_fp == NULL) {
  ------------------
  |  Branch (126:7): [True: 0, False: 0]
  ------------------
  127|      0|    BLOSC_TRACE_ERROR("Cannot allocate memory for stdio file wrapper.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|      0|    fclose(file);
  129|      0|    return NULL;
  130|      0|  }
  131|      0|  my_fp->file = file;
  132|      0|  return my_fp;
  133|      0|}
blosc2_stdio_destroy:
  279|  9.00k|int blosc2_stdio_destroy(void* params) {
  280|  9.00k|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|  9.00k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  281|  9.00k|  return 0;
  282|  9.00k|}

do_nothing:
  617|   692k|int do_nothing(uint8_t filter, char cmode) {
  618|   692k|  if (cmode == 'c') {
  ------------------
  |  Branch (618:7): [True: 0, False: 692k]
  ------------------
  619|      0|    return (filter == BLOSC_NOFILTER);
  620|   692k|  } else {
  621|       |    // TRUNC_PREC do not have to be applied during decompression
  622|   692k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (622:13): [True: 190k, False: 502k]
  |  Branch (622:43): [True: 85.8k, False: 416k]
  ------------------
  623|   692k|  }
  624|   692k|}
next_filter:
  627|   233k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  628|   372k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (628:36): [True: 372k, False: 0]
  ------------------
  629|   372k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (629:9): [True: 233k, False: 139k]
  ------------------
  630|   233k|      return filters[i];
  631|   233k|    }
  632|   372k|  }
  633|      0|  return BLOSC_NOFILTER;
  634|   233k|}
last_filter:
  637|  53.3k|int last_filter(const uint8_t* filters, char cmode) {
  638|  53.3k|  int last_index = -1;
  639|   373k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (639:40): [True: 319k, False: 53.3k]
  ------------------
  640|   319k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (640:9): [True: 183k, False: 136k]
  ------------------
  641|   183k|      last_index = i;
  642|   183k|    }
  643|   319k|  }
  644|  53.3k|  return last_index;
  645|  53.3k|}
read_chunk_header:
  724|  21.6M|{
  725|  21.6M|  memset(header, 0, sizeof(blosc_header));
  726|       |
  727|  21.6M|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (727:7): [True: 0, False: 21.6M]
  ------------------
  728|      0|    BLOSC_TRACE_ERROR("Not enough space to read Blosc header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  729|      0|    return BLOSC2_ERROR_READ_BUFFER;
  730|      0|  }
  731|       |
  732|  21.6M|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  733|       |
  734|  21.6M|  bool little_endian = is_little_endian();
  735|       |
  736|  21.6M|  if (!little_endian) {
  ------------------
  |  Branch (736:7): [True: 0, False: 21.6M]
  ------------------
  737|      0|    header->nbytes = bswap32_(header->nbytes);
  738|      0|    header->blocksize = bswap32_(header->blocksize);
  739|      0|    header->cbytes = bswap32_(header->cbytes);
  740|      0|  }
  741|       |
  742|  21.6M|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (742:7): [True: 3, False: 21.6M]
  ------------------
  743|      3|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      3|    return BLOSC2_ERROR_INVALID_HEADER;
  745|      3|  }
  746|  21.6M|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (746:7): [True: 7, False: 21.6M]
  ------------------
  747|      7|    BLOSC_TRACE_ERROR("`blocksize` 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|      7|    return BLOSC2_ERROR_INVALID_HEADER;
  749|      7|  }
  750|  21.6M|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (750:7): [True: 5, False: 21.6M]
  ------------------
  751|      5|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|      5|    return BLOSC2_ERROR_INVALID_HEADER;
  753|      5|  }
  754|  21.6M|  if (header->typesize == 0) {
  ------------------
  |  Branch (754:7): [True: 0, False: 21.6M]
  ------------------
  755|      0|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  756|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  757|      0|  }
  758|       |
  759|       |  /* Read extended header if it is wanted */
  760|  21.6M|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (760:7): [True: 48.1k, False: 21.6M]
  |  Branch (760:28): [True: 47.7k, False: 489]
  |  Branch (760:65): [True: 47.4k, False: 282]
  ------------------
  761|  47.4k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (761:9): [True: 0, False: 47.4k]
  ------------------
  762|      0|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  763|      0|      return BLOSC2_ERROR_INVALID_HEADER;
  764|      0|    }
  765|  47.4k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (765:9): [True: 0, False: 47.4k]
  ------------------
  766|      0|      BLOSC_TRACE_ERROR("Not enough space to read Blosc extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      0|      return BLOSC2_ERROR_READ_BUFFER;
  768|      0|    }
  769|       |
  770|  47.4k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  771|  47.4k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  772|       |
  773|  47.4k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (773:9): [True: 34, False: 47.3k]
  |  Branch (773:55): [True: 21, False: 13]
  ------------------
  774|     21|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  775|     21|      if (special_type != 0) {
  ------------------
  |  Branch (775:11): [True: 0, False: 21]
  ------------------
  776|      0|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  777|      0|        return BLOSC2_ERROR_INVALID_HEADER;
  778|      0|      }
  779|     21|    }
  780|       |
  781|  47.4k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  782|  47.4k|    if (special_type != 0) {
  ------------------
  |  Branch (782:9): [True: 4.07k, False: 43.3k]
  ------------------
  783|  4.07k|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (783:11): [True: 13, False: 4.05k]
  ------------------
  784|       |        // In this case, the actual type size must be derived from the cbytes
  785|     13|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  786|     13|        if (typesize <= 0) {
  ------------------
  |  Branch (786:13): [True: 0, False: 13]
  ------------------
  787|      0|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  788|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  789|      0|        }
  790|     13|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (790:13): [True: 0, False: 13]
  ------------------
  791|      0|          BLOSC_TRACE_ERROR("`typesize` is greater than maximum allowed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  792|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  793|      0|        }
  794|     13|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (794:13): [True: 1, False: 12]
  ------------------
  795|      1|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  796|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  797|      1|        }
  798|     12|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (798:13): [True: 3, False: 9]
  ------------------
  799|      3|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  800|      3|          return BLOSC2_ERROR_INVALID_HEADER;
  801|      3|        }
  802|     12|      }
  803|  4.05k|      else {
  804|       |        // All-zero chunks fill with memset, which works regardless of element alignment.
  805|  4.05k|        if (special_type != BLOSC2_SPECIAL_ZERO
  ------------------
  |  Branch (805:13): [True: 1.11k, False: 2.93k]
  ------------------
  806|  1.11k|            && header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (806:16): [True: 0, False: 1.11k]
  ------------------
  807|      0|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  809|      0|        }
  810|  4.05k|      }
  811|  4.07k|    }
  812|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  813|       |    // did not initialize filters to zero beyond the max supported.
  814|  47.4k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (814:9): [True: 3.76k, False: 43.6k]
  ------------------
  815|  3.76k|      header->filters[5] = 0;
  816|  3.76k|      header->filters_meta[5] = 0;
  817|  3.76k|    }
  818|  47.4k|  }
  819|  21.6M|  else {
  820|  21.6M|    flags_to_filters(header->flags, header->filters);
  821|  21.6M|  }
  822|  21.6M|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (822:7): [True: 301k, False: 21.3M]
  ------------------
  823|   301k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (823:7): [True: 0, False: 301k]
  ------------------
  824|       |    /* Version from future with unsupported chunk features. */
  825|      0|    return BLOSC2_ERROR_VERSION_SUPPORT;
  826|      0|  }
  827|  21.6M|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (827:7): [True: 34, False: 21.6M]
  ------------------
  828|     34|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (828:7): [True: 0, False: 34]
  ------------------
  829|      0|    BLOSC_TRACE_ERROR("VL-block chunks cannot be memcpyed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  830|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  831|      0|  }
  832|  21.6M|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (832:7): [True: 21.6M, False: 34]
  ------------------
  833|  21.6M|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (833:7): [True: 21.6M, False: 235]
  |  Branch (833:29): [True: 20.5k, False: 21.6M]
  ------------------
  834|  20.5k|    header->blocksize = header->nbytes;
  835|  20.5k|  }
  836|  21.6M|  return 0;
  837|  21.6M|}
fill_codec:
  920|      3|int fill_codec(blosc2_codec *codec) {
  921|      3|  char libpath[PATH_MAX];
  922|      3|  void *lib = load_lib(codec->compname, libpath);
  923|      3|  if(lib == NULL) {
  ------------------
  |  Branch (923:6): [True: 3, False: 0]
  ------------------
  924|      3|    BLOSC_TRACE_ERROR("Error while loading the library for codec `%s`", codec->compname);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  925|      3|    return BLOSC2_ERROR_FAILURE;
  926|      3|  }
  927|       |
  928|      0|  codec_info *info = dlsym(lib, "info");
  929|      0|  if (info == NULL) {
  ------------------
  |  Branch (929:7): [True: 0, False: 0]
  ------------------
  930|      0|    BLOSC_TRACE_ERROR("`info` symbol cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|      0|    dlclose(lib);
  932|      0|    return BLOSC2_ERROR_FAILURE;
  933|      0|  }
  934|      0|  codec->encoder = dlsym(lib, info->encoder);
  935|      0|  codec->decoder = dlsym(lib, info->decoder);
  936|       |
  937|      0|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (937:7): [True: 0, False: 0]
  |  Branch (937:33): [True: 0, False: 0]
  ------------------
  938|      0|    BLOSC_TRACE_ERROR("encoder or decoder cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  939|      0|    dlclose(lib);
  940|      0|    return BLOSC2_ERROR_FAILURE;
  941|      0|  }
  942|       |
  943|       |  /* If ever add .free function in future for codec params
  944|       |  codecparams_info *info2 = dlsym(lib, "info2");
  945|       |  if (info2 != NULL) {
  946|       |    // New plugin (e.g. openzl) with free function for codec_params defined
  947|       |    // will be used when destroying context in blosc2_free_ctx
  948|       |      codec->free = dlsym(lib, info2->free);
  949|       |  }
  950|       |  else{
  951|       |    codec->free = NULL;
  952|       |  }
  953|       |  */
  954|       |
  955|      0|  return BLOSC2_ERROR_SUCCESS;
  956|      0|}
pipeline_backward:
 1509|  44.1k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1510|  44.1k|  (void)tmp2;
 1511|  44.1k|  blosc2_context* context = thread_context->parent_context;
 1512|  44.1k|  int32_t typesize = context->typesize;
 1513|  44.1k|  uint8_t* filters = context->filters;
 1514|  44.1k|  uint8_t* filters_meta = context->filters_meta;
 1515|  44.1k|  uint8_t* _src = (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') == BLOSC_DELTA &&
  ------------------
  |  Branch (1515:20): [True: 10.0k, False: 34.1k]
  ------------------
 1516|  34.1k|                   context->postfilter == NULL) ? (dest + offset) : src;
  ------------------
  |  Branch (1516:20): [True: 10.0k, False: 0]
  ------------------
 1517|  44.1k|  uint8_t* _dest = tmp;
 1518|  44.1k|  int errcode = 0;
 1519|       |
 1520|   209k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1520:40): [True: 209k, False: 0]
  ------------------
 1521|       |    // Delta filter requires the whole chunk ready
 1522|   209k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1522:28): [True: 44.1k, False: 165k]
  |  Branch (1522:56): [True: 26.9k, False: 138k]
  ------------------
 1523|   138k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1523:28): [True: 25.6k, False: 112k]
  ------------------
 1524|   209k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1524:9): [True: 96.7k, False: 112k]
  |  Branch (1524:29): [True: 96.7k, False: 0]
  ------------------
 1525|  96.7k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1525:10): [True: 30.3k, False: 66.4k]
  |  Branch (1525:39): [True: 53.9k, False: 12.5k]
  ------------------
 1526|  84.2k|      _dest = dest + offset;
 1527|   125k|    } else {
 1528|   125k|      _dest = (_src == src) ? tmp : src;
  ------------------
  |  Branch (1528:15): [True: 66.0k, False: 59.3k]
  ------------------
 1529|   125k|    }
 1530|   209k|    int rc = BLOSC2_ERROR_SUCCESS;
 1531|   209k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1531:9): [True: 161k, False: 48.3k]
  ------------------
 1532|   161k|      switch (filters[i]) {
 1533|  39.3k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1533:9): [True: 39.3k, False: 121k]
  ------------------
 1534|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1535|  39.3k|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1535:28): [True: 2.69k, False: 36.6k]
  ------------------
 1536|  39.3k|          break;
 1537|  32.7k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1537:9): [True: 32.7k, False: 128k]
  ------------------
 1538|  32.7k|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1538:15): [True: 0, False: 32.7k]
  ------------------
 1539|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1540|      0|          }
 1541|  32.7k|          break;
 1542|  32.7k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1542:9): [True: 30.3k, False: 131k]
  ------------------
 1543|  30.3k|          if (_src != _dest) {
  ------------------
  |  Branch (1543:15): [True: 54, False: 30.2k]
  ------------------
 1544|     54|            memcpy(_dest, _src, (size_t)bsize);
 1545|     54|          }
 1546|  30.3k|          if (offset != 0 && thread_context != context->serial_context) {
  ------------------
  |  Branch (1546:15): [True: 14.7k, False: 15.5k]
  |  Branch (1546:30): [True: 0, False: 14.7k]
  ------------------
 1547|      0|            delta_wait_dref(context);
 1548|      0|          }
 1549|  30.3k|          delta_decoder(offset == 0 ? _dest : dest, offset, bsize, typesize, _dest);
  ------------------
  |  Branch (1549:25): [True: 15.5k, False: 14.7k]
  ------------------
 1550|  30.3k|          break;
 1551|  26.7k|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1551:9): [True: 26.7k, False: 134k]
  ------------------
 1552|       |          // TRUNC_PREC filter does not need to be undone
 1553|  26.7k|          break;
 1554|  32.1k|        default:
  ------------------
  |  Branch (1554:9): [True: 32.1k, False: 129k]
  ------------------
 1555|  32.1k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1555:15): [True: 5, False: 32.1k]
  ------------------
 1556|      5|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1557|      5|                              filters[i]);
 1558|      5|            errcode = -1;
 1559|      5|          }
 1560|   161k|      }
 1561|   161k|    } else {
 1562|       |        // Look for the filters_meta in user filters and run it
 1563|   175k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1563:30): [True: 175k, False: 11]
  ------------------
 1564|   175k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1564:15): [True: 48.3k, False: 127k]
  ------------------
 1565|  48.3k|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1565:17): [True: 0, False: 48.3k]
  ------------------
 1566|       |              // Dynamically load filter
 1567|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1567:19): [True: 0, False: 0]
  ------------------
 1568|      0|                BLOSC_TRACE_ERROR("Could not load filter %d.", g_filters[j].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1569|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1570|      0|              }
 1571|      0|            }
 1572|  48.3k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1572:17): [True: 48.3k, False: 0]
  ------------------
 1573|  48.3k|              blosc2_dparams dparams;
 1574|  48.3k|              blosc2_ctx_get_dparams(context, &dparams);
 1575|  48.3k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1576|  48.3k|            } else {
 1577|      0|              BLOSC_TRACE_ERROR("Backward function is NULL");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1578|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1579|      0|            }
 1580|  48.3k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1580:17): [True: 2, False: 48.3k]
  ------------------
 1581|      2|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1582|      2|              return rc;
 1583|      2|            }
 1584|  48.3k|            goto urfiltersuccess;
 1585|  48.3k|          }
 1586|   175k|        }
 1587|     11|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1588|     11|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1589|  48.3k|      urfiltersuccess:;
 1590|  48.3k|    }
 1591|       |
 1592|       |    // Update input buffer for the next filter in the backward pipeline
 1593|   209k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1593:9): [True: 177k, False: 32.1k]
  |  Branch (1593:43): [True: 150k, False: 26.7k]
  ------------------
 1594|   150k|      _src = _dest;
 1595|   150k|    }
 1596|   209k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1596:9): [True: 44.1k, False: 165k]
  ------------------
 1597|  44.1k|      break;
 1598|  44.1k|    }
 1599|   209k|  }
 1600|       |
 1601|  44.1k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1601:7): [True: 44.1k, False: 0]
  |  Branch (1601:38): [True: 4.49k, False: 39.6k]
  ------------------
 1602|  4.49k|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1603|  4.49k|  }
 1604|       |
 1605|       |  /* Postfilter function */
 1606|  44.1k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1606:7): [True: 0, False: 44.1k]
  ------------------
 1607|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1608|      0|    blosc2_postfilter_params postparams;
 1609|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1610|      0|    postparams.input = _src;
 1611|      0|    postparams.output = dest + offset;
 1612|      0|    postparams.size = bsize;
 1613|      0|    postparams.typesize = typesize;
 1614|      0|    postparams.offset = nblock * context->blocksize;
 1615|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1615:25): [True: 0, False: 0]
  ------------------
 1616|      0|    postparams.nblock = nblock;
 1617|      0|    postparams.tid = thread_context->tid;
 1618|      0|    postparams.ttmp = thread_context->tmp;
 1619|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1620|      0|    postparams.ctx = context;
 1621|       |
 1622|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1622:9): [True: 0, False: 0]
  ------------------
 1623|      0|      BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1624|      0|      return BLOSC2_ERROR_POSTFILTER;
 1625|      0|    }
 1626|      0|  }
 1627|       |
 1628|  44.1k|  return errcode;
 1629|  44.1k|}
free_thread_context:
 2316|  25.6k|void free_thread_context(struct thread_context* thread_context) {
 2317|  25.6k|  destroy_thread_context(thread_context);
 2318|  25.6k|  my_free(thread_context);
 2319|  25.6k|}
build_filters:
 3838|  11.8k|                   const int32_t typesize, uint8_t* filters) {
 3839|       |
 3840|       |  /* Fill the end part of the filter pipeline */
 3841|  11.8k|  if ((doshuffle == BLOSC_SHUFFLE) && (typesize > 1))
  ------------------
  |  Branch (3841:7): [True: 0, False: 11.8k]
  |  Branch (3841:39): [True: 0, False: 0]
  ------------------
 3842|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
 3843|  11.8k|  if (doshuffle == BLOSC_BITSHUFFLE)
  ------------------
  |  Branch (3843:7): [True: 0, False: 11.8k]
  ------------------
 3844|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
 3845|  11.8k|  if (doshuffle == BLOSC_NOSHUFFLE)
  ------------------
  |  Branch (3845:7): [True: 0, False: 11.8k]
  ------------------
 3846|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_NOSHUFFLE;
 3847|  11.8k|  if (delta)
  ------------------
  |  Branch (3847:7): [True: 0, False: 11.8k]
  ------------------
 3848|      0|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
 3849|  11.8k|}
blosc2_decompress_ctx:
 4099|  31.8k|                          void* dest, int32_t destsize) {
 4100|  31.8k|  int result;
 4101|       |
 4102|  31.8k|  if (context->do_compress != 0) {
  ------------------
  |  Branch (4102:7): [True: 0, False: 31.8k]
  ------------------
 4103|      0|    BLOSC_TRACE_ERROR("Context is not meant for decompression.  Giving up.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4104|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4105|      0|  }
 4106|       |
 4107|  31.8k|  result = blosc_run_decompression_with_context(context, src, srcsize, dest, destsize);
 4108|       |
 4109|       |  // Reset a possible block_maskout
 4110|  31.8k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (4110:7): [True: 0, False: 31.8k]
  ------------------
 4111|      0|    free(context->block_maskout);
 4112|      0|    context->block_maskout = NULL;
 4113|      0|  }
 4114|  31.8k|  context->block_maskout_nitems = 0;
 4115|       |
 4116|  31.8k|  return result;
 4117|  31.8k|}
_blosc_getitem:
 4500|  16.3k|                   int start, int nitems, void* dest, int32_t destsize) {
 4501|  16.3k|  uint8_t* _src = (uint8_t*)(src);  /* current pos for source buffer */
 4502|  16.3k|  uint8_t* _dest = (uint8_t*)(dest);
 4503|  16.3k|  int32_t ntbytes = 0;              /* the number of uncompressed bytes */
 4504|  16.3k|  int32_t bsize, bsize2, ebsize, leftoverblock;
 4505|  16.3k|  int32_t startb, stopb;
 4506|  16.3k|  int32_t stop;
 4507|  16.3k|  int32_t nitems_bytes;
 4508|  16.3k|  int64_t start64 = (int64_t)start;
 4509|  16.3k|  int64_t nitems64 = (int64_t)nitems;
 4510|  16.3k|  int64_t typesize64 = (int64_t)header->typesize;
 4511|  16.3k|  int64_t stop64;
 4512|  16.3k|  int64_t nitems_bytes64;
 4513|  16.3k|  int64_t start_bytes64;
 4514|  16.3k|  int64_t stop_bytes64;
 4515|  16.3k|  int j, rc;
 4516|       |
 4517|  16.3k|  if (nitems == 0) {
  ------------------
  |  Branch (4517:7): [True: 0, False: 16.3k]
  ------------------
 4518|       |    // We have nothing to do
 4519|      0|    return 0;
 4520|      0|  }
 4521|  16.3k|  if (nitems < 0) {
  ------------------
  |  Branch (4521:7): [True: 0, False: 16.3k]
  ------------------
 4522|      0|    BLOSC_TRACE_ERROR("`nitems` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4523|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4524|      0|  }
 4525|       |
 4526|  16.3k|  nitems_bytes64 = nitems64 * typesize64;
 4527|  16.3k|  if (nitems_bytes64 < 0 || nitems_bytes64 > INT32_MAX || nitems_bytes64 > destsize) {
  ------------------
  |  Branch (4527:7): [True: 0, False: 16.3k]
  |  Branch (4527:29): [True: 0, False: 16.3k]
  |  Branch (4527:59): [True: 16, False: 16.3k]
  ------------------
 4528|     16|    BLOSC_TRACE_ERROR("`nitems`*`typesize` out of dest bounds.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4529|     16|    return BLOSC2_ERROR_WRITE_BUFFER;
 4530|     16|  }
 4531|  16.3k|  nitems_bytes = (int32_t)nitems_bytes64;
 4532|       |
 4533|  16.3k|  int32_t* bstarts = (int32_t*)(_src + context->header_overhead);
 4534|       |
 4535|       |  /* Check region boundaries */
 4536|  16.3k|  start_bytes64 = start64 * typesize64;
 4537|  16.3k|  if ((start < 0) || (start_bytes64 < 0) || (start_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4537:7): [True: 0, False: 16.3k]
  |  Branch (4537:22): [True: 0, False: 16.3k]
  |  Branch (4537:45): [True: 0, False: 16.3k]
  ------------------
 4538|      0|    BLOSC_TRACE_ERROR("`start` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4539|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4540|      0|  }
 4541|       |
 4542|  16.3k|  stop64 = start64 + nitems64;
 4543|  16.3k|  if ((stop64 < 0) || (stop64 > INT32_MAX)) {
  ------------------
  |  Branch (4543:7): [True: 0, False: 16.3k]
  |  Branch (4543:23): [True: 0, False: 16.3k]
  ------------------
 4544|      0|    BLOSC_TRACE_ERROR("`start`+`nitems` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4545|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4546|      0|  }
 4547|  16.3k|  stop = (int32_t)stop64;
 4548|       |
 4549|  16.3k|  stop_bytes64 = stop64 * typesize64;
 4550|  16.3k|  if ((stop_bytes64 < 0) || (stop_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4550:7): [True: 0, False: 16.3k]
  |  Branch (4550:29): [True: 0, False: 16.3k]
  ------------------
 4551|      0|    BLOSC_TRACE_ERROR("`start`+`nitems` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4552|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4553|      0|  }
 4554|       |
 4555|  16.3k|  bool chunk_memcpyed = (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0;
 4556|  16.3k|  if (!context->special_type && !chunk_memcpyed &&
  ------------------
  |  Branch (4556:7): [True: 15.6k, False: 636]
  |  Branch (4556:33): [True: 14.3k, False: 1.36k]
  ------------------
 4557|  14.3k|      ((uint8_t *)(_src + srcsize) < (uint8_t *)(bstarts + context->nblocks))) {
  ------------------
  |  Branch (4557:7): [True: 0, False: 14.3k]
  ------------------
 4558|      0|    BLOSC_TRACE_ERROR("`bstarts` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4559|      0|    return BLOSC2_ERROR_READ_BUFFER;
 4560|      0|  }
 4561|       |
 4562|  16.3k|  bool memcpyed = header->flags & (uint8_t)BLOSC_MEMCPYED;
 4563|  16.3k|  if (context->special_type) {
  ------------------
  |  Branch (4563:7): [True: 636, False: 15.6k]
  ------------------
 4564|       |    // Fake a runlen as if its a memcpyed chunk
 4565|    636|    memcpyed = true;
 4566|    636|  }
 4567|       |
 4568|  16.3k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (4568:19): [True: 16.0k, False: 234]
  ------------------
 4569|  16.0k|                  (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (4569:19): [True: 93, False: 16.0k]
  |  Branch (4569:54): [True: 0, False: 93]
  ------------------
 4570|  16.3k|  if (memcpyed && !is_lazy && !context->postfilter) {
  ------------------
  |  Branch (4570:7): [True: 2.00k, False: 14.3k]
  |  Branch (4570:19): [True: 2.00k, False: 0]
  |  Branch (4570:31): [True: 2.00k, False: 0]
  ------------------
 4571|       |    // Short-circuit for (non-lazy) memcpyed or special values
 4572|  2.00k|    ntbytes = nitems_bytes;
 4573|  2.00k|    switch (context->special_type) {
 4574|      0|      case BLOSC2_SPECIAL_VALUE: {
  ------------------
  |  Branch (4574:7): [True: 0, False: 2.00k]
  ------------------
 4575|       |        // The repeated value's width is cbytes minus the header, not the header
 4576|       |        // typesize byte (which is left unconstrained for special-value chunks).
 4577|       |        // Derive it the same way blosc_d() does so a crafted typesize cannot make
 4578|       |        // set_values() read past the end of the chunk.
 4579|      0|        int32_t value_typesize = header->cbytes - context->header_overhead;
 4580|      0|        rc = set_values(value_typesize, _src, _dest, ntbytes);
 4581|      0|        if (rc < 0) {
  ------------------
  |  Branch (4581:13): [True: 0, False: 0]
  ------------------
 4582|      0|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4583|      0|          return BLOSC2_ERROR_DATA;
 4584|      0|        }
 4585|      0|        break;
 4586|      0|      }
 4587|      1|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (4587:7): [True: 1, False: 2.00k]
  ------------------
 4588|      1|        rc = set_nans(context->typesize, _dest, ntbytes);
 4589|      1|        if (rc < 0) {
  ------------------
  |  Branch (4589:13): [True: 0, False: 1]
  ------------------
 4590|      0|          BLOSC_TRACE_ERROR("set_nans 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4591|      0|          return BLOSC2_ERROR_DATA;
 4592|      0|        }
 4593|      1|        break;
 4594|    633|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (4594:7): [True: 633, False: 1.36k]
  ------------------
 4595|    633|        memset(_dest, 0, ntbytes);
 4596|    633|        break;
 4597|      2|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (4597:7): [True: 2, False: 2.00k]
  ------------------
 4598|       |        // We do nothing here
 4599|      2|        break;
 4600|  1.36k|      case BLOSC2_NO_SPECIAL:
  ------------------
  |  Branch (4600:7): [True: 1.36k, False: 636]
  ------------------
 4601|  1.36k|        {
 4602|  1.36k|          int64_t src_offset64 = (int64_t)context->header_overhead + start_bytes64;
 4603|  1.36k|          int64_t src_stop64 = src_offset64 + nitems_bytes64;
 4604|  1.36k|          if ((src_offset64 < 0) || (src_stop64 < src_offset64) || (src_stop64 > srcsize)) {
  ------------------
  |  Branch (4604:15): [True: 0, False: 1.36k]
  |  Branch (4604:37): [True: 0, False: 1.36k]
  |  Branch (4604:68): [True: 0, False: 1.36k]
  ------------------
 4605|      0|            BLOSC_TRACE_ERROR("getitem memcpy source out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4606|      0|            return BLOSC2_ERROR_READ_BUFFER;
 4607|      0|          }
 4608|  1.36k|          _src += (int32_t)src_offset64;
 4609|  1.36k|        }
 4610|      0|        memcpy(_dest, _src, ntbytes);
 4611|  1.36k|        break;
 4612|      0|      default:
  ------------------
  |  Branch (4612:7): [True: 0, False: 2.00k]
  ------------------
 4613|      0|        BLOSC_TRACE_ERROR("Unhandled special value case");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4614|      0|        BLOSC_ERROR(BLOSC2_ERROR_SCHUNK_SPECIAL);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4615|  2.00k|    }
 4616|  2.00k|    return ntbytes;
 4617|  2.00k|  }
 4618|       |
 4619|  16.3k|  bool has_delta = false;
 4620|  79.1k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) {
  ------------------
  |  Branch (4620:19): [True: 72.1k, False: 6.92k]
  ------------------
 4621|  72.1k|    if (context->filters[i] == BLOSC_DELTA) {
  ------------------
  |  Branch (4621:9): [True: 7.39k, False: 64.7k]
  ------------------
 4622|  7.39k|      has_delta = true;
 4623|  7.39k|      break;
 4624|  7.39k|    }
 4625|  72.1k|  }
 4626|  14.3k|  if (has_delta) {
  ------------------
  |  Branch (4626:7): [True: 7.39k, False: 6.92k]
  ------------------
 4627|  7.39k|    uint8_t* full_chunk = malloc((size_t)header->nbytes);
 4628|  7.39k|    if (full_chunk == NULL) {
  ------------------
  |  Branch (4628:9): [True: 0, False: 7.39k]
  ------------------
 4629|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 4630|      0|    }
 4631|  7.39k|    int dbytes = blosc2_decompress_ctx(context, src, srcsize, full_chunk, header->nbytes);
 4632|  7.39k|    context->dest = NULL;
 4633|  7.39k|    context->destsize = 0;
 4634|  7.39k|    if (dbytes < 0 || dbytes != header->nbytes) {
  ------------------
  |  Branch (4634:9): [True: 0, False: 7.39k]
  |  Branch (4634:23): [True: 0, False: 7.39k]
  ------------------
 4635|      0|      free(full_chunk);
 4636|      0|      return dbytes < 0 ? dbytes : BLOSC2_ERROR_DATA;
  ------------------
  |  Branch (4636:14): [True: 0, False: 0]
  ------------------
 4637|      0|    }
 4638|  7.39k|    memcpy(dest, full_chunk + start_bytes64, (size_t)nitems_bytes);
 4639|  7.39k|    free(full_chunk);
 4640|  7.39k|    return nitems_bytes;
 4641|  7.39k|  }
 4642|       |
 4643|  6.92k|  ebsize = header->blocksize + header->typesize * (signed)sizeof(int32_t);
 4644|  6.92k|  struct thread_context* scontext = context->serial_context;
 4645|       |  /* Resize the temporaries in serial context if needed */
 4646|  6.92k|  if (header->blocksize > scontext->tmp_blocksize) {
  ------------------
  |  Branch (4646:7): [True: 0, False: 6.92k]
  ------------------
 4647|      0|    my_free(scontext->tmp);
 4648|      0|    scontext->tmp_nbytes = (size_t)4 * ebsize;
 4649|      0|    scontext->tmp = my_malloc(scontext->tmp_nbytes);
 4650|      0|    BLOSC_ERROR_NULL(scontext->tmp, 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]
  |  |  ------------------
  ------------------
 4651|      0|    scontext->tmp2 = scontext->tmp + ebsize;
 4652|      0|    scontext->tmp3 = scontext->tmp2 + ebsize;
 4653|      0|    scontext->tmp4 = scontext->tmp3 + ebsize;
 4654|      0|    scontext->tmp_blocksize = (int32_t)header->blocksize;
 4655|      0|  }
 4656|       |
 4657|  14.0k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (4657:15): [True: 12.6k, False: 1.41k]
  ------------------
 4658|  12.6k|    bsize = header->blocksize;
 4659|  12.6k|    leftoverblock = 0;
 4660|  12.6k|    if ((j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (4660:9): [True: 6.92k, False: 5.72k]
  |  Branch (4660:40): [True: 5.72k, False: 1.20k]
  ------------------
 4661|  5.72k|      bsize = context->leftover;
 4662|  5.72k|      leftoverblock = 1;
 4663|  5.72k|    }
 4664|       |
 4665|       |    /* Compute start & stop for each block */
 4666|  12.6k|    startb = start * header->typesize - j * header->blocksize;
 4667|  12.6k|    stopb = stop * header->typesize - j * header->blocksize;
 4668|  12.6k|    if (stopb <= 0) {
  ------------------
  |  Branch (4668:9): [True: 5.51k, False: 7.14k]
  ------------------
 4669|       |      // We can exit as soon as this block is beyond stop
 4670|  5.51k|      break;
 4671|  5.51k|    }
 4672|  7.14k|    if (startb >= header->blocksize) {
  ------------------
  |  Branch (4672:9): [True: 201, False: 6.94k]
  ------------------
 4673|    201|      continue;
 4674|    201|    }
 4675|  6.94k|    if (startb < 0) {
  ------------------
  |  Branch (4675:9): [True: 17, False: 6.92k]
  ------------------
 4676|     17|      startb = 0;
 4677|     17|    }
 4678|  6.94k|    if (stopb > header->blocksize) {
  ------------------
  |  Branch (4678:9): [True: 17, False: 6.92k]
  ------------------
 4679|     17|      stopb = header->blocksize;
 4680|     17|    }
 4681|  6.94k|    bsize2 = stopb - startb;
 4682|       |
 4683|  6.94k|#if defined(HAVE_ZFP)
 4684|  6.94k|    if (context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) {
  ------------------
  |  Branch (4684:9): [True: 2.11k, False: 4.83k]
  ------------------
 4685|       |      // The items in this block
 4686|  2.11k|      scontext->zfp_cell_start = startb / context->typesize;
 4687|  2.11k|      scontext->zfp_cell_nitems = bsize2 / context->typesize;
 4688|  2.11k|    }
 4689|  6.94k|#endif /* HAVE_ZFP */
 4690|       |
 4691|       |    /* Do the actual data copy */
 4692|       |    // Regular decompression.  Put results in tmp2.
 4693|       |    // If the items are exactly this block, decompress it in destination and avoid a copy
 4694|  6.94k|    bool get_single_block = ((ntbytes == 0) && (startb == 0) && (bsize == nitems_bytes));
  ------------------
  |  Branch (4694:30): [True: 6.92k, False: 17]
  |  Branch (4694:48): [True: 172, False: 6.75k]
  |  Branch (4694:65): [True: 10, False: 162]
  ------------------
 4695|  6.94k|    uint8_t* tmp2 = get_single_block ? dest : scontext->tmp2;
  ------------------
  |  Branch (4695:21): [True: 10, False: 6.93k]
  ------------------
 4696|       |
 4697|       |    // If memcpyed we don't have a bstarts section (because it is not needed)
 4698|  6.94k|    int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (4698:26): [True: 0, False: 6.94k]
  ------------------
 4699|  6.94k|      context->header_overhead + j * header->blocksize : sw32_(bstarts + j);
 4700|       |
 4701|  6.94k|    int32_t cbytes = blosc_d(context->serial_context, bsize, leftoverblock, memcpyed,
 4702|  6.94k|                             src, srcsize, src_offset, j,
 4703|  6.94k|                             tmp2, 0, scontext->tmp, scontext->tmp3);
 4704|  6.94k|    if (cbytes < 0) {
  ------------------
  |  Branch (4704:9): [True: 0, False: 6.94k]
  ------------------
 4705|      0|      ntbytes = cbytes;
 4706|      0|      break;
 4707|      0|    }
 4708|  6.94k|    if (!get_single_block) {
  ------------------
  |  Branch (4708:9): [True: 6.93k, False: 10]
  ------------------
 4709|       |      /* Copy to destination.  When ZFP decoded just the requested items (a single
 4710|       |         cell), they are at the start of tmp2, else the whole block was decoded. */
 4711|  6.93k|      bool zfp_cell = (scontext->zfp_cell_nitems > 0) && (cbytes == bsize2);
  ------------------
  |  Branch (4711:23): [True: 2.09k, False: 4.84k]
  |  Branch (4711:58): [True: 0, False: 2.09k]
  ------------------
 4712|  6.93k|      memcpy((uint8_t *) dest + ntbytes, tmp2 + (zfp_cell ? 0 : startb), (unsigned int) bsize2);
  ------------------
  |  Branch (4712:50): [True: 0, False: 6.93k]
  ------------------
 4713|  6.93k|    }
 4714|  6.94k|    ntbytes += bsize2;
 4715|  6.94k|  }
 4716|       |
 4717|  6.92k|  scontext->zfp_cell_nitems = 0;
 4718|       |
 4719|  6.92k|  if (ntbytes >= 0 && ntbytes != nitems_bytes) {
  ------------------
  |  Branch (4719:7): [True: 6.92k, False: 0]
  |  Branch (4719:23): [True: 0, False: 6.92k]
  ------------------
 4720|       |    // A partial decode must not look like a success: callers that only test for
 4721|       |    // a negative return would silently keep hold of an incompletely filled dest.
 4722|      0|    BLOSC_TRACE_ERROR("Only %d bytes out of the %d requested could be decoded.",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4723|      0|                      ntbytes, nitems_bytes);
 4724|      0|    return BLOSC2_ERROR_DATA;
 4725|      0|  }
 4726|       |
 4727|  6.92k|  return ntbytes;
 4728|  6.92k|}
blosc2_getitem:
 4730|  16.3k|int blosc2_getitem(const void* src, int32_t srcsize, int start, int nitems, void* dest, int32_t destsize) {
 4731|  16.3k|  blosc2_context context;
 4732|  16.3k|  int result;
 4733|       |
 4734|       |  /* Minimally populate the context */
 4735|  16.3k|  memset(&context, 0, sizeof(blosc2_context));
 4736|       |
 4737|  16.3k|  context.schunk = g_schunk;
 4738|  16.3k|  context.nthreads = 1;  // force a serial decompression; fixes #95
 4739|       |
 4740|       |  /* Call the actual getitem function */
 4741|  16.3k|  result = blosc2_getitem_ctx(&context, src, srcsize, start, nitems, dest, destsize);
 4742|       |
 4743|       |  /* Release resources */
 4744|  16.3k|  if (context.serial_context != NULL) {
  ------------------
  |  Branch (4744:7): [True: 16.3k, False: 0]
  ------------------
 4745|  16.3k|    free_thread_context(context.serial_context);
 4746|  16.3k|  }
 4747|  16.3k|  return result;
 4748|  16.3k|}
blosc2_getitem_ctx:
 4796|  16.3k|    int start, int nitems, void* dest, int32_t destsize) {
 4797|  16.3k|  blosc_header header;
 4798|  16.3k|  int result = getitem_read_header(src, srcsize, &header);
 4799|  16.3k|  if (result < 0) {
  ------------------
  |  Branch (4799:7): [True: 0, False: 16.3k]
  ------------------
 4800|      0|    return result;
 4801|      0|  }
 4802|       |
 4803|  16.3k|  return getitem_with_header(context, &header, src, srcsize, start, nitems, dest, destsize);
 4804|  16.3k|}
blosc2_get_nthreads:
 5905|  18.0k|{
 5906|  18.0k|  int16_t nthreads;
 5907|  18.0k|  if (!g_initlib) {
  ------------------
  |  Branch (5907:7): [True: 0, False: 18.0k]
  ------------------
 5908|      0|    blosc2_init();
 5909|      0|  }
 5910|  18.0k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  18.0k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5911|  18.0k|  nthreads = g_nthreads;
 5912|  18.0k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  18.0k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5913|  18.0k|  return nthreads;
 5914|  18.0k|}
blosc2_set_nthreads:
 5916|  9.07k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5917|  9.07k|  int16_t ret;          /* the previous number of threads */
 5918|       |
 5919|       |  /* Check whether the library should be initialized */
 5920|  9.07k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5920:7): [True: 0, False: 9.07k]
  ------------------
 5921|       |
 5922|  9.07k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  9.07k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5923|  9.07k|  ret = g_nthreads;
 5924|  9.07k|  if (nthreads != ret) {
  ------------------
  |  Branch (5924:7): [True: 0, False: 9.07k]
  ------------------
 5925|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5926|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5927|      0|    g_nthreads = nthreads;
 5928|      0|    g_global_context->new_nthreads = nthreads;
 5929|      0|    int16_t ret2 = check_nthreads(g_global_context, true);
 5930|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5930:9): [True: 0, False: 0]
  ------------------
 5931|      0|      g_nthreads = ret;
 5932|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5933|      0|      g_global_context->nthreads = old_nthreads;
 5934|      0|      check_nthreads(g_global_context, true);
 5935|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5936|      0|      return ret2;
 5937|      0|    }
 5938|      0|  }
 5939|  9.07k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  9.07k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5940|       |
 5941|  9.07k|  return ret;
 5942|  9.07k|}
blosc2_cbuffer_sizes:
 6094|  21.6M|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 6095|  21.6M|  blosc_header header;
 6096|  21.6M|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 6097|  21.6M|  if (rc < 0) {
  ------------------
  |  Branch (6097:7): [True: 15, False: 21.6M]
  ------------------
 6098|       |    /* Return zeros if error reading header */
 6099|     15|    memset(&header, 0, sizeof(header));
 6100|     15|  }
 6101|       |
 6102|       |  /* Read the interesting values */
 6103|  21.6M|  if (nbytes != NULL)
  ------------------
  |  Branch (6103:7): [True: 21.6M, False: 13.4k]
  ------------------
 6104|  21.6M|    *nbytes = header.nbytes;
 6105|  21.6M|  if (cbytes != NULL)
  ------------------
  |  Branch (6105:7): [True: 21.6M, False: 0]
  ------------------
 6106|  21.6M|    *cbytes = header.cbytes;
 6107|  21.6M|  if (blocksize != NULL)
  ------------------
  |  Branch (6107:7): [True: 25.3k, False: 21.6M]
  ------------------
 6108|  25.3k|    *blocksize = header.blocksize;
 6109|  21.6M|  return rc;
 6110|  21.6M|}
blosc2_init:
 6245|  9.07k|void blosc2_init(void) {
 6246|       |  /* Return if Blosc is already initialized */
 6247|  9.07k|  if (g_initlib) return;
  ------------------
  |  Branch (6247:7): [True: 0, False: 9.07k]
  ------------------
 6248|       |
 6249|  9.07k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 6250|  9.07k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 6251|  9.07k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 6252|  9.07k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 6253|  9.07k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 6254|  9.07k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 6255|  9.07k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 6256|  9.07k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 6257|  9.07k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 6258|  9.07k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 6259|       |
 6260|  9.07k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 6261|       |
 6262|  9.07k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 6263|  9.07k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 6264|  9.07k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 6265|  9.07k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 6266|  9.07k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 6267|  9.07k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 6268|  9.07k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 6269|  9.07k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 6270|  9.07k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 6271|  9.07k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 6272|       |
 6273|  9.07k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 6274|       |
 6275|  9.07k|  g_ncodecs = 0;
 6276|  9.07k|  g_nfilters = 0;
 6277|  9.07k|  g_ntuners = 0;
 6278|       |
 6279|  9.07k|#if defined(HAVE_PLUGINS)
 6280|  9.07k|  #include "blosc2/blosc2-common.h"
 6281|  9.07k|  #include "blosc2/blosc2-stdio.h"
 6282|  9.07k|  register_codecs();
 6283|  9.07k|  register_filters();
 6284|  9.07k|  register_tuners();
 6285|  9.07k|#endif
 6286|  9.07k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  9.07k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6287|  9.07k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  9.07k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6288|       |  /* Create a global context */
 6289|  9.07k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6290|  9.07k|  memset(g_global_context, 0, sizeof(blosc2_context));
 6291|  9.07k|  g_global_context->nthreads = g_nthreads;
 6292|  9.07k|  g_global_context->new_nthreads = g_nthreads;
 6293|  9.07k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  9.07k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6294|  9.07k|  g_initlib = 1;
 6295|  9.07k|}
blosc2_free_resources:
 6298|  9.07k|int blosc2_free_resources(void) {
 6299|       |  /* Return if Blosc is not initialized */
 6300|  9.07k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (6300:7): [True: 0, False: 9.07k]
  ------------------
 6301|       |
 6302|  9.07k|  return release_thread_backend(g_global_context);
 6303|  9.07k|}
blosc2_destroy:
 6306|  9.07k|void blosc2_destroy(void) {
 6307|       |  /* Return if Blosc is not initialized */
 6308|  9.07k|  if (!g_initlib) return;
  ------------------
  |  Branch (6308:7): [True: 0, False: 9.07k]
  ------------------
 6309|       |
 6310|  9.07k|  blosc2_free_resources();
 6311|  9.07k|  g_initlib = 0;
 6312|  9.07k|  blosc2_free_ctx(g_global_context);
 6313|       |
 6314|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 6315|       |   * Do this before freeing the pools so that release_thread_backend callers
 6316|       |   * that race with us will take the "skip" path rather than locking the
 6317|       |   * soon-to-be-destroyed pool_registry_mutex. */
 6318|  9.07k|  g_destroy_count++;
 6319|       |
 6320|       |  /* Tear down any remaining shared pools */
 6321|  9.07k|  struct blosc_shared_pool *pool = shared_pools;
 6322|  9.07k|  while (pool != NULL) {
  ------------------
  |  Branch (6322:10): [True: 0, False: 9.07k]
  ------------------
 6323|      0|    struct blosc_shared_pool *next = pool->next;
 6324|      0|    destroy_shared_pool(pool);
 6325|      0|    pool = next;
 6326|      0|  }
 6327|  9.07k|  shared_pools = NULL;
 6328|  9.07k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  9.07k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6329|       |
 6330|  9.07k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  9.07k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6331|  9.07k|}
blosc2_create_cctx:
 6337|  11.8k|blosc2_context* blosc2_create_cctx(blosc2_cparams cparams) {
 6338|  11.8k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6339|  11.8k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  11.8k|    do {                                            \
  |  |  105|  11.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 11.8k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  11.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 11.8k]
  |  |  ------------------
  ------------------
 6340|       |
 6341|       |  /* Populate the context, using zeros as default values */
 6342|  11.8k|  memset(context, 0, sizeof(blosc2_context));
 6343|  11.8k|  context->do_compress = 1;   /* meant for compression */
 6344|  11.8k|  context->use_dict = cparams.use_dict;
 6345|  11.8k|  if (cparams.instr_codec) {
  ------------------
  |  Branch (6345:7): [True: 0, False: 11.8k]
  ------------------
 6346|      0|    context->blosc2_flags = BLOSC2_INSTR_CODEC;
 6347|      0|  }
 6348|       |
 6349|  83.0k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (6349:19): [True: 71.1k, False: 11.8k]
  ------------------
 6350|  71.1k|    context->filters[i] = cparams.filters[i];
 6351|  71.1k|    context->filters_meta[i] = cparams.filters_meta[i];
 6352|       |
 6353|  71.1k|    if (context->filters[i] >= BLOSC_LAST_FILTER && context->filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (6353:9): [True: 4.64k, False: 66.5k]
  |  Branch (6353:53): [True: 1, False: 4.64k]
  ------------------
 6354|      1|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6355|      1|                        context->filters[i]);
 6356|      1|      free(context);
 6357|      1|      return NULL;
 6358|      1|    }
 6359|  71.1k|    if (context->filters[i] > BLOSC_LAST_REGISTERED_FILTER && context->filters[i] <= BLOSC2_GLOBAL_REGISTERED_FILTERS_STOP) {
  ------------------
  |  Branch (6359:9): [True: 4.09k, False: 67.1k]
  |  Branch (6359:63): [True: 1, False: 4.08k]
  ------------------
 6360|      1|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6361|      1|                        context->filters[i]);
 6362|      1|      free(context);
 6363|      1|      return NULL;
 6364|      1|    }
 6365|  71.1k|  }
 6366|       |
 6367|  11.8k|#if defined(HAVE_ZFP)
 6368|  11.8k|#include "blosc2/codecs-registry.h"
 6369|  11.8k|  if ((context->compcode >= BLOSC_CODEC_ZFP_FIXED_ACCURACY) && (context->compcode <= BLOSC_CODEC_ZFP_FIXED_RATE)) {
  ------------------
  |  Branch (6369:7): [True: 0, False: 11.8k]
  |  Branch (6369:64): [True: 0, False: 0]
  ------------------
 6370|      0|    for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) {
  ------------------
  |  Branch (6370:21): [True: 0, False: 0]
  ------------------
 6371|      0|      if ((context->filters[i] == BLOSC_SHUFFLE) || (context->filters[i] == BLOSC_BITSHUFFLE)) {
  ------------------
  |  Branch (6371:11): [True: 0, False: 0]
  |  Branch (6371:53): [True: 0, False: 0]
  ------------------
 6372|      0|        BLOSC_TRACE_ERROR("ZFP cannot be run in presence of SHUFFLE / BITSHUFFLE");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6373|      0|        return NULL;
 6374|      0|      }
 6375|      0|    }
 6376|      0|  }
 6377|  11.8k|#endif /* HAVE_ZFP */
 6378|       |
 6379|       |  /* Check for a BLOSC_SHUFFLE environment variable */
 6380|  11.8k|  int doshuffle = -1;
 6381|  11.8k|  char* envvar = getenv("BLOSC_SHUFFLE");
 6382|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6382:7): [True: 0, False: 11.8k]
  ------------------
 6383|      0|    if (strcmp(envvar, "NOSHUFFLE") == 0) {
  ------------------
  |  Branch (6383:9): [True: 0, False: 0]
  ------------------
 6384|      0|      doshuffle = BLOSC_NOSHUFFLE;
 6385|      0|    }
 6386|      0|    else if (strcmp(envvar, "SHUFFLE") == 0) {
  ------------------
  |  Branch (6386:14): [True: 0, False: 0]
  ------------------
 6387|      0|      doshuffle = BLOSC_SHUFFLE;
 6388|      0|    }
 6389|      0|    else if (strcmp(envvar, "BITSHUFFLE") == 0) {
  ------------------
  |  Branch (6389:14): [True: 0, False: 0]
  ------------------
 6390|      0|      doshuffle = BLOSC_BITSHUFFLE;
 6391|      0|    }
 6392|      0|    else {
 6393|      0|      BLOSC_TRACE_WARNING("BLOSC_SHUFFLE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6394|      0|    }
 6395|      0|  }
 6396|       |  /* Check for a BLOSC_DELTA environment variable */
 6397|  11.8k|  int dodelta = BLOSC_NOFILTER;
 6398|  11.8k|  envvar = getenv("BLOSC_DELTA");
 6399|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6399:7): [True: 0, False: 11.8k]
  ------------------
 6400|      0|    if (strcmp(envvar, "1") == 0) {
  ------------------
  |  Branch (6400:9): [True: 0, False: 0]
  ------------------
 6401|      0|      dodelta = BLOSC_DELTA;
 6402|      0|    } else if (strcmp(envvar, "0") == 0){
  ------------------
  |  Branch (6402:16): [True: 0, False: 0]
  ------------------
 6403|      0|      dodelta = BLOSC_NOFILTER;
 6404|      0|    }
 6405|      0|    else {
 6406|      0|      BLOSC_TRACE_WARNING("BLOSC_DELTA environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6407|      0|    }
 6408|      0|  }
 6409|       |  /* Check for a BLOSC_TYPESIZE environment variable */
 6410|  11.8k|  context->typesize = cparams.typesize;
 6411|  11.8k|  envvar = getenv("BLOSC_TYPESIZE");
 6412|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6412:7): [True: 0, False: 11.8k]
  ------------------
 6413|      0|    int32_t value;
 6414|      0|    errno = 0; /* To distinguish success/failure after call */
 6415|      0|    value = (int32_t) strtol(envvar, NULL, 10);
 6416|      0|    if ((errno != EINVAL) && (value > 0)) {
  ------------------
  |  Branch (6416:9): [True: 0, False: 0]
  |  Branch (6416:30): [True: 0, False: 0]
  ------------------
 6417|      0|      context->typesize = value;
 6418|      0|    }
 6419|      0|    else {
 6420|      0|      BLOSC_TRACE_WARNING("BLOSC_TYPESIZE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6421|      0|    }
 6422|      0|  }
 6423|  11.8k|  build_filters(doshuffle, dodelta, context->typesize, context->filters);
 6424|       |
 6425|  11.8k|  context->clevel = cparams.clevel;
 6426|       |  /* Check for a BLOSC_CLEVEL environment variable */
 6427|  11.8k|  envvar = getenv("BLOSC_CLEVEL");
 6428|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6428:7): [True: 0, False: 11.8k]
  ------------------
 6429|      0|    int value;
 6430|      0|    errno = 0; /* To distinguish success/failure after call */
 6431|      0|    value = (int)strtol(envvar, NULL, 10);
 6432|      0|    if ((errno != EINVAL) && (value >= 0)) {
  ------------------
  |  Branch (6432:9): [True: 0, False: 0]
  |  Branch (6432:30): [True: 0, False: 0]
  ------------------
 6433|      0|      context->clevel = value;
 6434|      0|    }
 6435|      0|    else {
 6436|      0|      BLOSC_TRACE_WARNING("BLOSC_CLEVEL environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6437|      0|    }
 6438|      0|  }
 6439|       |
 6440|  11.8k|  context->compcode = cparams.compcode;
 6441|       |  /* Check for a BLOSC_COMPRESSOR environment variable */
 6442|  11.8k|  envvar = getenv("BLOSC_COMPRESSOR");
 6443|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6443:7): [True: 0, False: 11.8k]
  ------------------
 6444|      0|    int codec = blosc2_compname_to_compcode(envvar);
 6445|      0|    if (codec >= BLOSC_LAST_CODEC) {
  ------------------
  |  Branch (6445:9): [True: 0, False: 0]
  ------------------
 6446|      0|      BLOSC_TRACE_ERROR("User defined codecs cannot be set here. Use Blosc2 mechanism instead.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6447|      0|      return NULL;
 6448|      0|    }
 6449|      0|    context->compcode = codec;
 6450|      0|  }
 6451|  11.8k|  context->compcode_meta = cparams.compcode_meta;
 6452|       |
 6453|  11.8k|  context->blocksize = cparams.blocksize;
 6454|       |  /* Check for a BLOSC_BLOCKSIZE environment variable */
 6455|  11.8k|  envvar = getenv("BLOSC_BLOCKSIZE");
 6456|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6456:7): [True: 0, False: 11.8k]
  ------------------
 6457|      0|    int32_t blocksize;
 6458|      0|    errno = 0; /* To distinguish success/failure after call */
 6459|      0|    blocksize = (int32_t) strtol(envvar, NULL, 10);
 6460|      0|    if ((errno != EINVAL) && (blocksize > 0)) {
  ------------------
  |  Branch (6460:9): [True: 0, False: 0]
  |  Branch (6460:30): [True: 0, False: 0]
  ------------------
 6461|      0|      context->blocksize = blocksize;
 6462|      0|    }
 6463|      0|    else {
 6464|      0|      BLOSC_TRACE_WARNING("BLOSC_BLOCKSIZE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6465|      0|    }
 6466|      0|  }
 6467|       |
 6468|  11.8k|  context->nthreads = cparams.nthreads;
 6469|       |  /* Check for a BLOSC_NTHREADS environment variable */
 6470|  11.8k|  envvar = getenv("BLOSC_NTHREADS");
 6471|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6471:7): [True: 0, False: 11.8k]
  ------------------
 6472|      0|    errno = 0; /* To distinguish success/failure after call */
 6473|      0|    int16_t nthreads = (int16_t) strtol(envvar, NULL, 10);
 6474|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (6474:9): [True: 0, False: 0]
  |  Branch (6474:30): [True: 0, False: 0]
  ------------------
 6475|      0|      context->nthreads = nthreads;
 6476|      0|    }
 6477|      0|    else {
 6478|      0|      BLOSC_TRACE_WARNING("BLOSC_NTHREADS environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6479|      0|    }
 6480|      0|  }
 6481|  11.8k|  context->new_nthreads = context->nthreads;
 6482|       |
 6483|  11.8k|  context->splitmode = cparams.splitmode;
 6484|       |  /* Check for a BLOSC_SPLITMODE environment variable */
 6485|  11.8k|  envvar = getenv("BLOSC_SPLITMODE");
 6486|  11.8k|  if (envvar != NULL) {
  ------------------
  |  Branch (6486:7): [True: 0, False: 11.8k]
  ------------------
 6487|      0|    int32_t splitmode = -1;
 6488|      0|    if (strcmp(envvar, "ALWAYS") == 0) {
  ------------------
  |  Branch (6488:9): [True: 0, False: 0]
  ------------------
 6489|      0|      splitmode = BLOSC_ALWAYS_SPLIT;
 6490|      0|    }
 6491|      0|    else if (strcmp(envvar, "NEVER") == 0) {
  ------------------
  |  Branch (6491:14): [True: 0, False: 0]
  ------------------
 6492|      0|      splitmode = BLOSC_NEVER_SPLIT;
 6493|      0|    }
 6494|      0|    else if (strcmp(envvar, "AUTO") == 0) {
  ------------------
  |  Branch (6494:14): [True: 0, False: 0]
  ------------------
 6495|      0|      splitmode = BLOSC_AUTO_SPLIT;
 6496|      0|    }
 6497|      0|    else if (strcmp(envvar, "FORWARD_COMPAT") == 0) {
  ------------------
  |  Branch (6497:14): [True: 0, False: 0]
  ------------------
 6498|      0|      splitmode = BLOSC_FORWARD_COMPAT_SPLIT;
 6499|      0|    }
 6500|      0|    else {
 6501|      0|      BLOSC_TRACE_WARNING("BLOSC_SPLITMODE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6502|      0|    }
 6503|      0|    if (splitmode >= 0) {
  ------------------
  |  Branch (6503:9): [True: 0, False: 0]
  ------------------
 6504|      0|      context->splitmode = splitmode;
 6505|      0|    }
 6506|      0|  }
 6507|       |
 6508|  11.8k|  context->threads_started = 0;
 6509|  11.8k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  11.8k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6510|  11.8k|  context->schunk = cparams.schunk;
 6511|       |
 6512|  11.8k|  if (cparams.prefilter != NULL) {
  ------------------
  |  Branch (6512:7): [True: 0, False: 11.8k]
  ------------------
 6513|      0|    context->prefilter = cparams.prefilter;
 6514|      0|    context->preparams = (blosc2_prefilter_params*)my_malloc(sizeof(blosc2_prefilter_params));
 6515|      0|    BLOSC_ERROR_NULL(context->preparams, NULL);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 6516|      0|    memcpy(context->preparams, cparams.preparams, sizeof(blosc2_prefilter_params));
 6517|      0|  }
 6518|       |
 6519|  11.8k|  if (cparams.tuner_id <= 0) {
  ------------------
  |  Branch (6519:7): [True: 11.8k, False: 0]
  ------------------
 6520|  11.8k|    cparams.tuner_id = g_tuner;
 6521|  11.8k|  } else {
 6522|      0|    for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6522:21): [True: 0, False: 0]
  ------------------
 6523|      0|      if (g_tuners[i].id == cparams.tuner_id) {
  ------------------
  |  Branch (6523:11): [True: 0, False: 0]
  ------------------
 6524|      0|        if (g_tuners[i].init == NULL) {
  ------------------
  |  Branch (6524:13): [True: 0, False: 0]
  ------------------
 6525|      0|          if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6525:15): [True: 0, False: 0]
  ------------------
 6526|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6527|      0|            return NULL;
 6528|      0|          }
 6529|      0|        }
 6530|      0|        if (g_tuners[i].init(cparams.tuner_params, context, NULL) < 0) {
  ------------------
  |  Branch (6530:13): [True: 0, False: 0]
  ------------------
 6531|      0|          BLOSC_TRACE_ERROR("Error in user-defined tuner %d init function\n", cparams.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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6532|      0|          return NULL;
 6533|      0|        }
 6534|      0|        goto urtunersuccess;
 6535|      0|      }
 6536|      0|    }
 6537|      0|    BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", cparams.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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6538|      0|    return NULL;
 6539|      0|  }
 6540|  11.8k|  urtunersuccess:;
 6541|       |
 6542|  11.8k|  context->tuner_id = cparams.tuner_id;
 6543|       |
 6544|  11.8k|  context->codec_params = cparams.codec_params;
 6545|  11.8k|  memcpy(context->filter_params, cparams.filter_params, BLOSC2_MAX_FILTERS * sizeof(void*));
 6546|       |
 6547|  11.8k|  return context;
 6548|  11.8k|}
blosc2_create_dctx:
 6551|  17.9k|blosc2_context* blosc2_create_dctx(blosc2_dparams dparams) {
 6552|  17.9k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6553|  17.9k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  17.9k|    do {                                            \
  |  |  105|  17.9k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 17.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|  17.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 17.9k]
  |  |  ------------------
  ------------------
 6554|       |
 6555|       |  /* Populate the context, using zeros as default values */
 6556|  17.9k|  memset(context, 0, sizeof(blosc2_context));
 6557|  17.9k|  context->do_compress = 0;   /* Meant for decompression */
 6558|       |
 6559|  17.9k|  context->nthreads = dparams.nthreads;
 6560|  17.9k|  char* envvar = getenv("BLOSC_NTHREADS");
 6561|  17.9k|  if (envvar != NULL) {
  ------------------
  |  Branch (6561:7): [True: 0, False: 17.9k]
  ------------------
 6562|      0|    errno = 0; /* To distinguish success/failure after call */
 6563|      0|    long nthreads = strtol(envvar, NULL, 10);
 6564|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (6564:9): [True: 0, False: 0]
  |  Branch (6564:30): [True: 0, False: 0]
  ------------------
 6565|      0|      context->nthreads = (int16_t) nthreads;
 6566|      0|    }
 6567|      0|  }
 6568|  17.9k|  context->new_nthreads = context->nthreads;
 6569|       |
 6570|  17.9k|  context->threads_started = 0;
 6571|  17.9k|  context->block_maskout = NULL;
 6572|  17.9k|  context->block_maskout_nitems = 0;
 6573|  17.9k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  17.9k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6574|  17.9k|  context->schunk = dparams.schunk;
 6575|       |
 6576|  17.9k|  if (dparams.postfilter != NULL) {
  ------------------
  |  Branch (6576:7): [True: 0, False: 17.9k]
  ------------------
 6577|      0|    context->postfilter = dparams.postfilter;
 6578|      0|    context->postparams = (blosc2_postfilter_params*)my_malloc(sizeof(blosc2_postfilter_params));
 6579|      0|    BLOSC_ERROR_NULL(context->postparams, NULL);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 6580|      0|    memcpy(context->postparams, dparams.postparams, sizeof(blosc2_postfilter_params));
 6581|      0|  }
 6582|       |
 6583|  17.9k|  return context;
 6584|  17.9k|}
blosc2_free_ctx:
 6587|  38.9k|void blosc2_free_ctx(blosc2_context* context) {
 6588|  38.9k|  if (g_initlib ||
  ------------------
  |  Branch (6588:7): [True: 29.8k, False: 9.07k]
  ------------------
 6589|  9.07k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  47.9k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6589:7): [True: 0, False: 9.07k]
  ------------------
 6590|  29.8k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  9.07k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6590:7): [True: 0, False: 9.07k]
  ------------------
 6591|  29.8k|    release_thread_backend(context);
 6592|  29.8k|  }
 6593|  38.9k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6593:7): [True: 9.10k, False: 29.8k]
  ------------------
 6594|  9.10k|    free_thread_context(context->serial_context);
 6595|  9.10k|  }
 6596|  38.9k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  38.9k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6597|  38.9k|  release_context_dict_buffer(context);
 6598|  38.9k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6598:7): [True: 0, False: 38.9k]
  ------------------
 6599|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6599:9): [True: 0, False: 0]
  ------------------
 6600|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6601|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6601:16): [True: 0, False: 0]
  ------------------
 6602|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6603|      0|    }
 6604|      0|#ifdef HAVE_ZSTD
 6605|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6605:14): [True: 0, False: 0]
  ------------------
 6606|      0|      ZSTD_freeCDict(context->dict_cdict);
 6607|      0|    }
 6608|      0|#endif
 6609|      0|  }
 6610|  38.9k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6610:7): [True: 2.68k, False: 36.2k]
  ------------------
 6611|  2.68k|#ifdef HAVE_ZSTD
 6612|  2.68k|    ZSTD_freeDDict(context->dict_ddict);
 6613|  2.68k|#endif
 6614|  2.68k|  }
 6615|  38.9k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6615:7): [True: 0, False: 38.9k]
  ------------------
 6616|      0|    int rc;
 6617|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6617:9): [True: 0, False: 0]
  |  Branch (6617:49): [True: 0, False: 0]
  ------------------
 6618|      0|      rc = blosc_stune_free(context);
 6619|      0|    } else {
 6620|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6620:23): [True: 0, False: 0]
  ------------------
 6621|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6621:13): [True: 0, False: 0]
  ------------------
 6622|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6622:15): [True: 0, False: 0]
  ------------------
 6623|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6623:17): [True: 0, False: 0]
  ------------------
 6624|      0|              BLOSC_TRACE_ERROR("Could not load tuner %d.", g_tuners[i].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6625|      0|              return;
 6626|      0|            }
 6627|      0|          }
 6628|      0|          rc = g_tuners[i].free(context);
 6629|      0|          goto urtunersuccess;
 6630|      0|        }
 6631|      0|      }
 6632|      0|      BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", context->tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6633|      0|      return;
 6634|      0|      urtunersuccess:;
 6635|      0|    }
 6636|      0|    if (rc < 0) {
  ------------------
  |  Branch (6636:9): [True: 0, False: 0]
  ------------------
 6637|      0|      BLOSC_TRACE_ERROR("Error in user-defined tuner free function\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6638|      0|      return;
 6639|      0|    }
 6640|      0|  }
 6641|       |  /* May be needed if codec_params ever contains nested objects
 6642|       |  if (context->codec_params != NULL) {
 6643|       |    int rc;
 6644|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6645|       |      if (g_codecs[i].compcode == context->compcode) {
 6646|       |        if (g_codecs[i].free == NULL) {
 6647|       |          // Dynamically load codec plugin
 6648|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6649|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6650|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6651|       |          }
 6652|       |        }
 6653|       |        if (g_codecs[i].free == NULL){
 6654|       |          // no free func, codec_params is simple
 6655|       |          my_free(context->codec_params);
 6656|       |        }
 6657|       |        else{ // has free function for codec_params (e.g. openzl)
 6658|       |        rc = g_codecs[i].free(context->codec_params);
 6659|       |          goto urcodecsuccess;
 6660|       |        }
 6661|       |      }
 6662|       |    }
 6663|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6664|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6665|       |    urcodecsuccess:;
 6666|       |    if (rc < 0) {
 6667|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6668|       |      return;
 6669|       |    }
 6670|       |  }
 6671|       |  */
 6672|  38.9k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6672:7): [True: 0, False: 38.9k]
  ------------------
 6673|      0|    my_free(context->preparams);
 6674|      0|  }
 6675|  38.9k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6675:7): [True: 0, False: 38.9k]
  ------------------
 6676|      0|    my_free(context->postparams);
 6677|      0|  }
 6678|       |
 6679|  38.9k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6679:7): [True: 0, False: 38.9k]
  ------------------
 6680|      0|    free(context->block_maskout);
 6681|      0|  }
 6682|  38.9k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6682:7): [True: 26, False: 38.8k]
  ------------------
 6683|     26|    free(context->blocknbytes);
 6684|     26|  }
 6685|  38.9k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6685:7): [True: 26, False: 38.8k]
  ------------------
 6686|     26|    free(context->blockoffsets);
 6687|     26|  }
 6688|  38.9k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6688:7): [True: 26, False: 38.8k]
  ------------------
 6689|     26|    free(context->blockcbytes);
 6690|     26|  }
 6691|  38.9k|  my_free(context);
 6692|  38.9k|}
blosc2_ctx_get_dparams:
 6719|  48.7k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6720|  48.7k|  dparams->nthreads = ctx->nthreads;
 6721|  48.7k|  dparams->schunk = ctx->schunk;
 6722|  48.7k|  dparams->postfilter = ctx->postfilter;
 6723|  48.7k|  dparams->postparams = ctx->postparams;
 6724|  48.7k|  dparams->typesize = ctx->typesize;
 6725|       |
 6726|  48.7k|  return BLOSC2_ERROR_SUCCESS;
 6727|  48.7k|}
blosc2_chunk_zeros:
 6749|  1.71k|int blosc2_chunk_zeros(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6750|  1.71k|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6750:7): [True: 0, False: 1.71k]
  ------------------
 6751|      0|    BLOSC_TRACE_ERROR("dest buffer is not long enough");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6752|      0|    return BLOSC2_ERROR_DATA;
 6753|      0|  }
 6754|       |
 6755|  1.71k|  if ((nbytes > 0) && (nbytes % cparams.typesize)) {
  ------------------
  |  Branch (6755:7): [True: 1.71k, False: 0]
  |  Branch (6755:23): [True: 2, False: 1.71k]
  ------------------
 6756|      2|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6757|      2|    return BLOSC2_ERROR_DATA;
 6758|      2|  }
 6759|       |
 6760|  1.71k|  blosc_header header;
 6761|  1.71k|  blosc2_context* context = blosc2_create_cctx(cparams);
 6762|  1.71k|  if (context == NULL) {
  ------------------
  |  Branch (6762:7): [True: 0, False: 1.71k]
  ------------------
 6763|      0|    BLOSC_TRACE_ERROR("Error while creating the compression 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6764|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6765|      0|  }
 6766|       |
 6767|  1.71k|  int error = initialize_context_compression(
 6768|  1.71k|          context, NULL, nbytes, dest, destsize,
 6769|  1.71k|          context->clevel, context->filters, context->filters_meta,
 6770|  1.71k|          context->typesize, context->compcode, context->blocksize,
 6771|  1.71k|          context->new_nthreads, context->nthreads, context->splitmode,
 6772|  1.71k|          context->tuner_id, context->tuner_params, context->schunk);
 6773|  1.71k|  if (error <= 0) {
  ------------------
  |  Branch (6773:7): [True: 0, False: 1.71k]
  ------------------
 6774|      0|    blosc2_free_ctx(context);
 6775|      0|    return error;
 6776|      0|  }
 6777|       |
 6778|  1.71k|  memset(&header, 0, sizeof(header));
 6779|  1.71k|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6780|  1.71k|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6781|  1.71k|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6782|  1.71k|  header.typesize = context->typesize;
 6783|  1.71k|  header.nbytes = (int32_t)nbytes;
 6784|  1.71k|  header.blocksize = context->blocksize;
 6785|  1.71k|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6786|  1.71k|  header.blosc2_flags = BLOSC2_SPECIAL_ZERO << 4;  // mark chunk as all zeros
 6787|  1.71k|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6788|       |
 6789|  1.71k|  blosc2_free_ctx(context);
 6790|       |
 6791|  1.71k|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6792|  1.71k|}
blosc2_chunk_uninit:
 6796|  1.03k|int blosc2_chunk_uninit(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6797|  1.03k|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6797:7): [True: 0, False: 1.03k]
  ------------------
 6798|      0|    BLOSC_TRACE_ERROR("dest buffer is not long enough");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6799|      0|    return BLOSC2_ERROR_DATA;
 6800|      0|  }
 6801|       |
 6802|  1.03k|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6802:7): [True: 5, False: 1.02k]
  ------------------
 6803|      5|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6804|      5|    return BLOSC2_ERROR_DATA;
 6805|      5|  }
 6806|       |
 6807|  1.02k|  blosc_header header;
 6808|  1.02k|  blosc2_context* context = blosc2_create_cctx(cparams);
 6809|  1.02k|  if (context == NULL) {
  ------------------
  |  Branch (6809:7): [True: 0, False: 1.02k]
  ------------------
 6810|      0|    BLOSC_TRACE_ERROR("Error while creating the compression 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6811|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6812|      0|  }
 6813|  1.02k|  int error = initialize_context_compression(
 6814|  1.02k|          context, NULL, nbytes, dest, destsize,
 6815|  1.02k|          context->clevel, context->filters, context->filters_meta,
 6816|  1.02k|          context->typesize, context->compcode, context->blocksize,
 6817|  1.02k|          context->new_nthreads, context->nthreads, context->splitmode,
 6818|  1.02k|          context->tuner_id, context->tuner_params, context->schunk);
 6819|  1.02k|  if (error <= 0) {
  ------------------
  |  Branch (6819:7): [True: 0, False: 1.02k]
  ------------------
 6820|      0|    blosc2_free_ctx(context);
 6821|      0|    return error;
 6822|      0|  }
 6823|       |
 6824|  1.02k|  memset(&header, 0, sizeof(header));
 6825|  1.02k|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6826|  1.02k|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6827|  1.02k|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6828|  1.02k|  header.typesize = context->typesize;
 6829|  1.02k|  header.nbytes = (int32_t)nbytes;
 6830|  1.02k|  header.blocksize = context->blocksize;
 6831|  1.02k|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6832|  1.02k|  header.blosc2_flags = BLOSC2_SPECIAL_UNINIT << 4;  // mark chunk as uninitialized
 6833|  1.02k|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6834|       |
 6835|  1.02k|  blosc2_free_ctx(context);
 6836|       |
 6837|  1.02k|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6838|  1.02k|}
blosc2_chunk_nans:
 6842|    123|int blosc2_chunk_nans(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6843|    123|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6843:7): [True: 0, False: 123]
  ------------------
 6844|      0|    BLOSC_TRACE_ERROR("dest buffer is not long enough");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6845|      0|    return BLOSC2_ERROR_DATA;
 6846|      0|  }
 6847|       |
 6848|    123|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6848:7): [True: 5, False: 118]
  ------------------
 6849|      5|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6850|      5|    return BLOSC2_ERROR_DATA;
 6851|      5|  }
 6852|       |
 6853|    118|  blosc_header header;
 6854|    118|  blosc2_context* context = blosc2_create_cctx(cparams);
 6855|    118|  if (context == NULL) {
  ------------------
  |  Branch (6855:7): [True: 0, False: 118]
  ------------------
 6856|      0|    BLOSC_TRACE_ERROR("Error while creating the compression 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6857|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6858|      0|  }
 6859|       |
 6860|    118|  int error = initialize_context_compression(
 6861|    118|          context, NULL, nbytes, dest, destsize,
 6862|    118|          context->clevel, context->filters, context->filters_meta,
 6863|    118|          context->typesize, context->compcode, context->blocksize,
 6864|    118|          context->new_nthreads, context->nthreads, context->splitmode,
 6865|    118|          context->tuner_id, context->tuner_params, context->schunk);
 6866|    118|  if (error <= 0) {
  ------------------
  |  Branch (6866:7): [True: 0, False: 118]
  ------------------
 6867|      0|    blosc2_free_ctx(context);
 6868|      0|    return error;
 6869|      0|  }
 6870|       |
 6871|    118|  memset(&header, 0, sizeof(header));
 6872|    118|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6873|    118|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6874|    118|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6875|    118|  header.typesize = context->typesize;
 6876|    118|  header.nbytes = (int32_t)nbytes;
 6877|    118|  header.blocksize = context->blocksize;
 6878|    118|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6879|    118|  header.blosc2_flags = BLOSC2_SPECIAL_NAN << 4;  // mark chunk as all NaNs
 6880|    118|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6881|       |
 6882|    118|  blosc2_free_ctx(context);
 6883|       |
 6884|    118|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6885|    118|}
register_filter_private:
 6939|  45.3k|int register_filter_private(blosc2_filter *filter) {
 6940|  45.3k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  45.3k|    do {                                            \
  |  |  105|  45.3k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 45.3k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  45.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 45.3k]
  |  |  ------------------
  ------------------
 6941|  45.3k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6941:9): [True: 0, False: 45.3k]
  ------------------
 6942|      0|        BLOSC_TRACE_ERROR("Can not register more filters");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6943|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6944|      0|    }
 6945|  45.3k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6945:9): [True: 0, False: 45.3k]
  ------------------
 6946|      0|        BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_FILTERS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6947|      0|        return BLOSC2_ERROR_FAILURE;
 6948|      0|    }
 6949|       |    /* This condition can never be fulfilled
 6950|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6951|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6952|       |        return BLOSC2_ERROR_FAILURE;
 6953|       |    }
 6954|       |    */
 6955|       |
 6956|   136k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6956:26): [True: 90.7k, False: 45.3k]
  ------------------
 6957|  90.7k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6957:11): [True: 0, False: 90.7k]
  ------------------
 6958|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6958:13): [True: 0, False: 0]
  ------------------
 6959|      0|          BLOSC_TRACE_ERROR("The filter (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6960|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6961|      0|          return BLOSC2_ERROR_FAILURE;
 6962|      0|        }
 6963|      0|        else {
 6964|       |          // Already registered, so no more actions needed
 6965|      0|          return BLOSC2_ERROR_SUCCESS;
 6966|      0|        }
 6967|      0|      }
 6968|  90.7k|    }
 6969|       |
 6970|  45.3k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6971|  45.3k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6972|       |
 6973|  45.3k|    return BLOSC2_ERROR_SUCCESS;
 6974|  45.3k|}
register_codec_private:
 6989|  81.7k|int register_codec_private(blosc2_codec *codec) {
 6990|  81.7k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  81.7k|    do {                                            \
  |  |  105|  81.7k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 81.7k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  81.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 81.7k]
  |  |  ------------------
  ------------------
 6991|  81.7k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6991:9): [True: 0, False: 81.7k]
  ------------------
 6992|      0|      BLOSC_TRACE_ERROR("Can not register more codecs");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6993|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6994|      0|    }
 6995|  81.7k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6995:9): [True: 0, False: 81.7k]
  ------------------
 6996|      0|      BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_CODECS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6997|      0|      return BLOSC2_ERROR_FAILURE;
 6998|      0|    }
 6999|       |    /* This condition can never be fulfilled
 7000|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 7001|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 7002|       |      return BLOSC2_ERROR_FAILURE;
 7003|       |    }
 7004|       |     */
 7005|       |
 7006|   408k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (7006:21): [True: 326k, False: 81.7k]
  ------------------
 7007|   326k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (7007:11): [True: 0, False: 326k]
  ------------------
 7008|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (7008:13): [True: 0, False: 0]
  ------------------
 7009|      0|          BLOSC_TRACE_ERROR("The codec (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7010|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 7011|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 7012|      0|        }
 7013|      0|        else {
 7014|       |          // Already registered, so no more actions needed
 7015|      0|          return BLOSC2_ERROR_SUCCESS;
 7016|      0|        }
 7017|      0|      }
 7018|   326k|    }
 7019|       |
 7020|  81.7k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 7021|  81.7k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 7022|       |
 7023|  81.7k|    return BLOSC2_ERROR_SUCCESS;
 7024|  81.7k|}
register_tuner_private:
 7039|  9.07k|int register_tuner_private(blosc2_tuner *tuner) {
 7040|  9.07k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  9.07k|    do {                                            \
  |  |  105|  9.07k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 9.07k]
  |  |  ------------------
  |  |  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|  9.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 9.07k]
  |  |  ------------------
  ------------------
 7041|  9.07k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (7041:7): [True: 0, False: 9.07k]
  ------------------
 7042|      0|    BLOSC_TRACE_ERROR("Can not register more tuners");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7043|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 7044|      0|  }
 7045|  9.07k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (7045:7): [True: 0, False: 9.07k]
  ------------------
 7046|      0|    BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_TUNER_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7047|      0|    return BLOSC2_ERROR_FAILURE;
 7048|      0|  }
 7049|       |
 7050|  9.07k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (7050:19): [True: 0, False: 9.07k]
  ------------------
 7051|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (7051:9): [True: 0, False: 0]
  ------------------
 7052|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (7052:11): [True: 0, False: 0]
  ------------------
 7053|      0|        BLOSC_TRACE_ERROR("The tuner (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7054|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 7055|      0|        return BLOSC2_ERROR_FAILURE;
 7056|      0|      }
 7057|      0|      else {
 7058|       |        // Already registered, so no more actions needed
 7059|      0|        return BLOSC2_ERROR_SUCCESS;
 7060|      0|      }
 7061|      0|    }
 7062|      0|  }
 7063|       |
 7064|  9.07k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 7065|  9.07k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 7066|       |
 7067|  9.07k|  return BLOSC2_ERROR_SUCCESS;
 7068|  9.07k|}
_blosc2_register_io_cb:
 7081|  18.1k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 7082|       |
 7083|  27.2k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (7083:24): [True: 27.2k, False: 2]
  ------------------
 7084|  27.2k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (7084:9): [True: 18.1k, False: 9.07k]
  ------------------
 7085|  18.1k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (7085:11): [True: 0, False: 18.1k]
  ------------------
 7086|      0|        BLOSC_TRACE_ERROR("The IO (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7087|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 7088|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 7089|      0|      }
 7090|  18.1k|      else {
 7091|       |        // Already registered, so no more actions needed
 7092|  18.1k|        return BLOSC2_ERROR_SUCCESS;
 7093|  18.1k|      }
 7094|  18.1k|    }
 7095|  27.2k|  }
 7096|       |
 7097|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 7098|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 7099|       |
 7100|      2|  return BLOSC2_ERROR_SUCCESS;
 7101|  18.1k|}
blosc2_get_io_cb:
 7118|  48.8k|blosc2_io_cb *blosc2_get_io_cb(uint8_t id) {
 7119|       |  // If g_initlib is not set by blosc2_init() this function will try to read
 7120|       |  // uninitialized memory. We should therefore always return NULL in that case
 7121|  48.8k|  if (!g_initlib) {
  ------------------
  |  Branch (7121:7): [True: 0, False: 48.8k]
  ------------------
 7122|      0|    return NULL;
 7123|      0|  }
 7124|  48.8k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (7124:24): [True: 48.8k, False: 0]
  ------------------
 7125|  48.8k|    if (g_ios[i].id == id) {
  ------------------
  |  Branch (7125:9): [True: 48.8k, False: 0]
  ------------------
 7126|  48.8k|      return &g_ios[i];
 7127|  48.8k|    }
 7128|  48.8k|  }
 7129|      0|  if (id == BLOSC2_IO_FILESYSTEM) {
  ------------------
  |  Branch (7129:7): [True: 0, False: 0]
  ------------------
 7130|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS) < 0) {
  ------------------
  |  Branch (7130:9): [True: 0, False: 0]
  ------------------
 7131|      0|      BLOSC_TRACE_ERROR("Error registering the default IO 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7132|      0|      return NULL;
 7133|      0|    }
 7134|      0|    return blosc2_get_io_cb(id);
 7135|      0|  }
 7136|      0|  else if (id == BLOSC2_IO_FILESYSTEM_MMAP) {
  ------------------
  |  Branch (7136:12): [True: 0, False: 0]
  ------------------
 7137|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP) < 0) {
  ------------------
  |  Branch (7137:9): [True: 0, False: 0]
  ------------------
 7138|      0|      BLOSC_TRACE_ERROR("Error registering the mmap IO 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7139|      0|      return NULL;
 7140|      0|    }
 7141|      0|    return blosc2_get_io_cb(id);
 7142|      0|  }
 7143|      0|  return NULL;
 7144|      0|}
blosc2_error_string:
 7213|      5|const char *blosc2_error_string(int error_code) {
 7214|      5|  switch (error_code) {
 7215|      1|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (7215:5): [True: 1, False: 4]
  ------------------
 7216|      1|      return "Generic failure";
 7217|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (7217:5): [True: 0, False: 5]
  ------------------
 7218|      0|      return "Bad stream";
 7219|      4|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (7219:5): [True: 4, False: 1]
  ------------------
 7220|      4|      return "Invalid data";
 7221|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (7221:5): [True: 0, False: 5]
  ------------------
 7222|      0|      return "Memory alloc/realloc failure";
 7223|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (7223:5): [True: 0, False: 5]
  ------------------
 7224|      0|      return "Not enough space to read";
 7225|      0|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (7225:5): [True: 0, False: 5]
  ------------------
 7226|      0|      return "Not enough space to write";
 7227|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (7227:5): [True: 0, False: 5]
  ------------------
 7228|      0|      return "Codec not supported";
 7229|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (7229:5): [True: 0, False: 5]
  ------------------
 7230|      0|      return "Invalid parameter supplied to codec";
 7231|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (7231:5): [True: 0, False: 5]
  ------------------
 7232|      0|      return "Codec dictionary error";
 7233|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (7233:5): [True: 0, False: 5]
  ------------------
 7234|      0|      return "Version not supported";
 7235|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (7235:5): [True: 0, False: 5]
  ------------------
 7236|      0|      return "Invalid value in header";
 7237|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (7237:5): [True: 0, False: 5]
  ------------------
 7238|      0|      return "Invalid parameter supplied to function";
 7239|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (7239:5): [True: 0, False: 5]
  ------------------
 7240|      0|      return "File read failure";
 7241|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (7241:5): [True: 0, False: 5]
  ------------------
 7242|      0|      return "File write failure";
 7243|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (7243:5): [True: 0, False: 5]
  ------------------
 7244|      0|      return "File open failure";
 7245|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (7245:5): [True: 0, False: 5]
  ------------------
 7246|      0|      return "Not found";
 7247|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (7247:5): [True: 0, False: 5]
  ------------------
 7248|      0|      return "Bad run length encoding";
 7249|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (7249:5): [True: 0, False: 5]
  ------------------
 7250|      0|      return "Filter pipeline error";
 7251|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (7251:5): [True: 0, False: 5]
  ------------------
 7252|      0|      return "Chunk insert failure";
 7253|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (7253:5): [True: 0, False: 5]
  ------------------
 7254|      0|      return "Chunk append failure";
 7255|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (7255:5): [True: 0, False: 5]
  ------------------
 7256|      0|      return "Chunk update failure";
 7257|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (7257:5): [True: 0, False: 5]
  ------------------
 7258|      0|      return "Sizes larger than 2gb not supported";
 7259|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (7259:5): [True: 0, False: 5]
  ------------------
 7260|      0|      return "Super-chunk copy failure";
 7261|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (7261:5): [True: 0, False: 5]
  ------------------
 7262|      0|      return "Wrong type for frame";
 7263|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (7263:5): [True: 0, False: 5]
  ------------------
 7264|      0|      return "File truncate failure";
 7265|      0|    case BLOSC2_ERROR_LOCK:
  ------------------
  |  Branch (7265:5): [True: 0, False: 5]
  ------------------
 7266|      0|      return "Frame lock failure";
 7267|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (7267:5): [True: 0, False: 5]
  ------------------
 7268|      0|      return "Thread or thread context creation failure";
 7269|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (7269:5): [True: 0, False: 5]
  ------------------
 7270|      0|      return "Postfilter failure";
 7271|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (7271:5): [True: 0, False: 5]
  ------------------
 7272|      0|      return "Special frame failure";
 7273|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (7273:5): [True: 0, False: 5]
  ------------------
 7274|      0|      return "Special super-chunk failure";
 7275|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (7275:5): [True: 0, False: 5]
  ------------------
 7276|      0|      return "IO plugin error";
 7277|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (7277:5): [True: 0, False: 5]
  ------------------
 7278|      0|      return "Remove file failure";
 7279|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (7279:5): [True: 0, False: 5]
  ------------------
 7280|      0|      return "Pointer is null";
 7281|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (7281:5): [True: 0, False: 5]
  ------------------
 7282|      0|      return "Invalid index";
 7283|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (7283:5): [True: 0, False: 5]
  ------------------
 7284|      0|      return "Metalayer has not been found";
 7285|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (7285:5): [True: 0, False: 5]
  ------------------
 7286|      0|      return "Maximum buffersize exceeded";
 7287|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (7287:5): [True: 0, False: 5]
  ------------------
 7288|      0|      return "Tuner failure";
 7289|      0|    default:
  ------------------
  |  Branch (7289:5): [True: 0, False: 5]
  ------------------
 7290|      0|      return "Unknown error";
 7291|      5|  }
 7292|      5|}
blosc2.c:flags_to_filters:
  672|  21.6M|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  673|       |  /* Initialize the filter pipeline */
  674|  21.6M|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  675|       |  /* Fill the filter pipeline */
  676|  21.6M|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (676:7): [True: 21.6M, False: 2.07k]
  ------------------
  677|  21.6M|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  678|  21.6M|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (678:7): [True: 21.6M, False: 2.73k]
  ------------------
  679|  21.6M|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  680|  21.6M|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (680:7): [True: 271k, False: 21.3M]
  ------------------
  681|   271k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  682|  21.6M|}
blosc2.c:destroy_thread_context:
 2298|  25.6k|static void destroy_thread_context(struct thread_context* thread_context) {
 2299|  25.6k|  my_free(thread_context->tmp);
 2300|  25.6k|#if defined(HAVE_ZSTD)
 2301|  25.6k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2301:7): [True: 0, False: 25.6k]
  ------------------
 2302|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2303|      0|  }
 2304|  25.6k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2304:7): [True: 6.22k, False: 19.4k]
  ------------------
 2305|  6.22k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2306|  6.22k|  }
 2307|  25.6k|#endif
 2308|  25.6k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2308:7): [True: 0, False: 25.6k]
  ------------------
 2309|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2310|      0|  }
 2311|  25.6k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2311:7): [True: 0, False: 25.6k]
  ------------------
 2312|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2313|      0|  }
 2314|  25.6k|}
blosc2.c:my_free:
  257|  90.1k|static void my_free(void* block) {
  258|       |#if defined(_WIN32)
  259|       |  _aligned_free(block);
  260|       |#else
  261|  90.1k|  free(block);
  262|  90.1k|#endif  /* _WIN32 */
  263|  90.1k|}
blosc2.c:initialize_context_compression:
 2431|  2.86k|        blosc2_schunk* schunk) {
 2432|       |
 2433|       |  /* The block size and the filters divide by the typesize */
 2434|  2.86k|  if (typesize <= 0) {
  ------------------
  |  Branch (2434:7): [True: 0, False: 2.86k]
  ------------------
 2435|      0|    BLOSC_TRACE_ERROR("The typesize must be positive, not %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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2436|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2437|      0|  }
 2438|       |
 2439|       |  /* Check typesize limits */
 2440|  2.86k|  if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (2440:7): [True: 0, False: 2.86k]
  ------------------
 2441|       |    // If typesize is too large for Blosc2, return an error
 2442|      0|    BLOSC_TRACE_ERROR("Typesize cannot exceed %d bytes.", BLOSC2_MAXTYPESIZE);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2443|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2444|      0|  }
 2445|       |  /* Now, cap typesize so that blosc2 split machinery can continue to work.  This has to be
 2446|       |     done before the tuner chooses the block size, which depends on the typesize: a buffer
 2447|       |     with a larger typesize is a plain stream of bytes and is blocked as one. */
 2448|  2.86k|  if (typesize > BLOSC_MAX_TYPESIZE) {
  ------------------
  |  Branch (2448:7): [True: 265, False: 2.59k]
  ------------------
 2449|       |    /* If typesize is too large, treat buffer as an 1-byte stream. */
 2450|    265|    typesize = 1;
 2451|    265|  }
 2452|       |
 2453|       |  /* Set parameters */
 2454|  2.86k|  context->do_compress = 1;
 2455|  2.86k|  context->src = (const uint8_t*)src;
 2456|  2.86k|  context->srcsize = srcsize;
 2457|  2.86k|  context->dest = (uint8_t*)dest;
 2458|  2.86k|  context->output_bytes = 0;
 2459|  2.86k|  context->destsize = destsize;
 2460|  2.86k|  context->sourcesize = srcsize;
 2461|  2.86k|  context->typesize = typesize;
 2462|  2.86k|  context->filter_flags = filters_to_flags(filters);
 2463|  20.0k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (2463:19): [True: 17.1k, False: 2.86k]
  ------------------
 2464|  17.1k|    context->filters[i] = filters[i];
 2465|  17.1k|    context->filters_meta[i] = filters_meta[i];
 2466|  17.1k|  }
 2467|  2.86k|  context->compcode = compressor;
 2468|  2.86k|  context->nthreads = nthreads;
 2469|  2.86k|  context->new_nthreads = new_nthreads;
 2470|  2.86k|  context->clevel = clevel;
 2471|  2.86k|  context->schunk = schunk;
 2472|  2.86k|  context->tuner_params = tuner_params;
 2473|  2.86k|  context->tuner_id = tuner_id;
 2474|  2.86k|  context->splitmode = splitmode;
 2475|  2.86k|  context->blosc2_flags2 = 0;
 2476|  2.86k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2476:7): [True: 0, False: 2.86k]
  ------------------
 2477|      0|    free(context->blocknbytes);
 2478|      0|    context->blocknbytes = NULL;
 2479|      0|  }
 2480|  2.86k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2480:7): [True: 0, False: 2.86k]
  ------------------
 2481|      0|    free(context->blockoffsets);
 2482|      0|    context->blockoffsets = NULL;
 2483|      0|  }
 2484|  2.86k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2484:7): [True: 0, False: 2.86k]
  ------------------
 2485|      0|    free(context->blockcbytes);
 2486|      0|    context->blockcbytes = NULL;
 2487|      0|  }
 2488|  2.86k|  context->vlblock_sources = NULL;
 2489|  2.86k|  context->vlblock_dests = NULL;
 2490|       |  /* tuner some compression parameters */
 2491|  2.86k|  context->blocksize = (int32_t)blocksize;
 2492|  2.86k|  int rc = 0;
 2493|  2.86k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (2493:7): [True: 0, False: 2.86k]
  ------------------
 2494|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2494:9): [True: 0, False: 0]
  |  Branch (2494:49): [True: 0, False: 0]
  ------------------
 2495|      0|      if (blosc_stune_next_cparams(context) < 0) {
  ------------------
  |  Branch (2495:11): [True: 0, False: 0]
  ------------------
 2496|      0|        BLOSC_TRACE_ERROR("Error in stune next_cparams func\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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|      0|        return BLOSC2_ERROR_TUNER;
 2498|      0|      }
 2499|      0|    } else {
 2500|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2500:23): [True: 0, False: 0]
  ------------------
 2501|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2501:13): [True: 0, False: 0]
  ------------------
 2502|      0|          if (g_tuners[i].next_cparams == NULL) {
  ------------------
  |  Branch (2502:15): [True: 0, False: 0]
  ------------------
 2503|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2503:17): [True: 0, False: 0]
  ------------------
 2504|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2505|      0|              return BLOSC2_ERROR_FAILURE;
 2506|      0|            }
 2507|      0|          }
 2508|      0|          if (g_tuners[i].next_cparams(context) < 0) {
  ------------------
  |  Branch (2508:15): [True: 0, False: 0]
  ------------------
 2509|      0|            BLOSC_TRACE_ERROR("Error in tuner %d next_cparams func\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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2510|      0|            return BLOSC2_ERROR_TUNER;
 2511|      0|          }
 2512|      0|          if (g_tuners[i].id == BLOSC_BTUNE && context->blocksize == 0) {
  ------------------
  |  Branch (2512:15): [True: 0, False: 0]
  |  Branch (2512:48): [True: 0, False: 0]
  ------------------
 2513|       |            // Call stune for initializing blocksize
 2514|      0|            if (blosc_stune_next_blocksize(context) < 0) {
  ------------------
  |  Branch (2514:17): [True: 0, False: 0]
  ------------------
 2515|      0|              BLOSC_TRACE_ERROR("Error in stune next_blocksize func\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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2516|      0|              return BLOSC2_ERROR_TUNER;
 2517|      0|            }
 2518|      0|          }
 2519|      0|          goto urtunersuccess;
 2520|      0|        }
 2521|      0|      }
 2522|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2523|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2524|      0|    }
 2525|  2.86k|  } else {
 2526|  2.86k|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|  2.86k|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2526:9): [True: 2.86k, False: 0]
  |  Branch (2526:49): [True: 2.86k, False: 0]
  ------------------
 2527|  2.86k|      rc = blosc_stune_next_blocksize(context);
 2528|  2.86k|    } else {
 2529|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2529:23): [True: 0, False: 0]
  ------------------
 2530|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2530:13): [True: 0, False: 0]
  ------------------
 2531|      0|          if (g_tuners[i].next_blocksize == NULL) {
  ------------------
  |  Branch (2531:15): [True: 0, False: 0]
  ------------------
 2532|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2532:17): [True: 0, False: 0]
  ------------------
 2533|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2534|      0|              return BLOSC2_ERROR_FAILURE;
 2535|      0|            }
 2536|      0|          }
 2537|      0|          rc = g_tuners[i].next_blocksize(context);
 2538|      0|          goto urtunersuccess;
 2539|      0|        }
 2540|      0|      }
 2541|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2542|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2543|      0|    }
 2544|  2.86k|  }
 2545|  2.86k|  urtunersuccess:;
 2546|  2.86k|  if (rc < 0) {
  ------------------
  |  Branch (2546:7): [True: 0, False: 2.86k]
  ------------------
 2547|      0|    BLOSC_TRACE_ERROR("Error in tuner next_blocksize func\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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2548|      0|    return BLOSC2_ERROR_TUNER;
 2549|      0|  }
 2550|       |  /* The header must record the block size that the tuner settled on (it rounds a requested
 2551|       |     one to a multiple of the typesize, for instance), not the one that was asked for: a reader
 2552|       |     splits the chunk into blocks of the size in the header.  Variable-length block chunks
 2553|       |     store something else there and set it themselves. */
 2554|  2.86k|  context->header_blocksize = context->blocksize;
 2555|       |
 2556|       |
 2557|       |  /* Check buffer size limits */
 2558|  2.86k|  if (srcsize > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (2558:7): [True: 0, False: 2.86k]
  ------------------
 2559|      0|    BLOSC_TRACE_ERROR("Input buffer size cannot exceed %d bytes.",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2560|      0|                      BLOSC2_MAX_BUFFERSIZE);
 2561|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2562|      0|  }
 2563|       |
 2564|  2.86k|  if (destsize < BLOSC2_MAX_OVERHEAD) {
  ------------------
  |  Branch (2564:7): [True: 0, False: 2.86k]
  ------------------
 2565|      0|    BLOSC_TRACE_ERROR("Output buffer size should be larger than %d bytes.",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2566|      0|                      BLOSC2_MAX_OVERHEAD);
 2567|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2568|      0|  }
 2569|       |
 2570|       |  /* Compression level */
 2571|  2.86k|  if (clevel < 0 || clevel > 9) {
  ------------------
  |  Branch (2571:7): [True: 0, False: 2.86k]
  |  Branch (2571:21): [True: 0, False: 2.86k]
  ------------------
 2572|       |    /* If clevel not in 0..9, print an error */
 2573|      0|    BLOSC_TRACE_ERROR("`clevel` parameter must be between 0 and 9!.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2574|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2575|      0|  }
 2576|       |
 2577|       |  /* Dictionary support is only available for ZSTD, LZ4, and LZ4HC.
 2578|       |   * Skip the check when src is NULL (special-value chunks): no compression
 2579|       |   * will actually happen, so codec compatibility is irrelevant. */
 2580|  2.86k|  if (src != NULL && context->use_dict && context->compcode != BLOSC_ZSTD &&
  ------------------
  |  Branch (2580:7): [True: 0, False: 2.86k]
  |  Branch (2580:22): [True: 0, False: 0]
  |  Branch (2580:43): [True: 0, False: 0]
  ------------------
 2581|      0|      context->compcode != BLOSC_LZ4 && context->compcode != BLOSC_LZ4HC) {
  ------------------
  |  Branch (2581:7): [True: 0, False: 0]
  |  Branch (2581:41): [True: 0, False: 0]
  ------------------
 2582|      0|    BLOSC_TRACE_ERROR("`use_dict` is only supported for ZSTD, LZ4, and LZ4HC 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2583|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2584|      0|  }
 2585|       |
 2586|  2.86k|  blosc2_calculate_blocks(context);
 2587|       |
 2588|  2.86k|  return 1;
 2589|  2.86k|}
blosc2.c:filters_to_flags:
  649|  50.2k|static uint8_t filters_to_flags(const uint8_t* filters) {
  650|  50.2k|  uint8_t flags = 0;
  651|       |
  652|   351k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (652:19): [True: 301k, False: 50.2k]
  ------------------
  653|   301k|    switch (filters[i]) {
  654|  37.8k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (654:7): [True: 37.8k, False: 263k]
  ------------------
  655|  37.8k|        flags |= BLOSC_DOSHUFFLE;
  656|  37.8k|        break;
  657|  25.7k|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (657:7): [True: 25.7k, False: 275k]
  ------------------
  658|  25.7k|        flags |= BLOSC_DOBITSHUFFLE;
  659|  25.7k|        break;
  660|  24.1k|      case BLOSC_DELTA:
  ------------------
  |  Branch (660:7): [True: 24.1k, False: 277k]
  ------------------
  661|  24.1k|        flags |= BLOSC_DODELTA;
  662|  24.1k|        break;
  663|   213k|      default :
  ------------------
  |  Branch (663:7): [True: 213k, False: 87.6k]
  ------------------
  664|   213k|        break;
  665|   301k|    }
  666|   301k|  }
  667|  50.2k|  return flags;
  668|  50.2k|}
blosc2.c:blosc2_calculate_blocks:
  839|  51.0k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  840|       |  /* Compute number of blocks in buffer */
  841|  51.0k|  context->nblocks = context->sourcesize / context->blocksize;
  842|  51.0k|  context->leftover = context->sourcesize % context->blocksize;
  843|  51.0k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (843:22): [True: 39.2k, False: 11.7k]
  ------------------
  844|  39.2k|                     (context->nblocks + 1) : context->nblocks;
  845|  51.0k|}
blosc2.c:blosc_run_decompression_with_context:
 4066|  31.8k|                                                void* dest, int32_t destsize) {
 4067|  31.8k|  blosc_header header;
 4068|  31.8k|  int32_t ntbytes;
 4069|  31.8k|  int rc;
 4070|       |
 4071|  31.8k|  rc = read_chunk_header(src, srcsize, true, &header);
 4072|  31.8k|  if (rc < 0) {
  ------------------
  |  Branch (4072:7): [True: 4, False: 31.8k]
  ------------------
 4073|      4|    return rc;
 4074|      4|  }
 4075|       |
 4076|  31.8k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (4076:7): [True: 0, False: 31.8k]
  ------------------
 4077|       |    // Not enough space for writing into the destination
 4078|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 4079|      0|  }
 4080|       |
 4081|  31.8k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 4082|  31.8k|  if (rc < 0) {
  ------------------
  |  Branch (4082:7): [True: 517, False: 31.3k]
  ------------------
 4083|    517|    return rc;
 4084|    517|  }
 4085|       |
 4086|       |  /* Do the actual decompression */
 4087|  31.3k|  ntbytes = do_job(context);
 4088|  31.3k|  if (ntbytes < 0) {
  ------------------
  |  Branch (4088:7): [True: 8.00k, False: 23.3k]
  ------------------
 4089|  8.00k|    return ntbytes;
 4090|  8.00k|  }
 4091|       |
 4092|  31.3k|  assert(ntbytes <= (int32_t)destsize);
 4093|  23.3k|  return ntbytes;
 4094|  31.3k|}
blosc2.c:initialize_context_decompression:
 2757|  31.8k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2758|  31.8k|  int32_t bstarts_end;
 2759|  31.8k|  bool vlblocks;
 2760|       |
 2761|  31.8k|  context->do_compress = 0;
 2762|  31.8k|  context->src = (const uint8_t*)src;
 2763|  31.8k|  context->srcsize = srcsize;
 2764|  31.8k|  context->dest = (uint8_t*)dest;
 2765|  31.8k|  context->destsize = destsize;
 2766|  31.8k|  context->output_bytes = 0;
 2767|  31.8k|  context->vlblock_sources = NULL;
 2768|  31.8k|  context->vlblock_dests = NULL;
 2769|  31.8k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2769:7): [True: 0, False: 31.8k]
  ------------------
 2770|      0|    free(context->blocknbytes);
 2771|      0|    context->blocknbytes = NULL;
 2772|      0|  }
 2773|  31.8k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2773:7): [True: 0, False: 31.8k]
  ------------------
 2774|      0|    free(context->blockoffsets);
 2775|      0|    context->blockoffsets = NULL;
 2776|      0|  }
 2777|  31.8k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2777:7): [True: 0, False: 31.8k]
  ------------------
 2778|      0|    free(context->blockcbytes);
 2779|      0|    context->blockcbytes = NULL;
 2780|      0|  }
 2781|       |
 2782|  31.8k|  int rc = blosc2_initialize_context_from_header(context, header);
 2783|  31.8k|  if (rc < 0) {
  ------------------
  |  Branch (2783:7): [True: 0, False: 31.8k]
  ------------------
 2784|      0|    return rc;
 2785|      0|  }
 2786|  31.8k|  clear_context_decompression_dict(context);
 2787|  31.8k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2788|  31.8k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2788:19): [True: 31.3k, False: 536]
  ------------------
 2789|  31.3k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2789:19): [True: 261, False: 31.0k]
  ------------------
 2790|       |
 2791|       |  /* Check that we have enough space to decompress */
 2792|  31.8k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2792:7): [True: 0, False: 31.8k]
  ------------------
 2793|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2794|      0|  }
 2795|       |
 2796|  31.8k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (2796:7): [True: 0, False: 31.8k]
  ------------------
 2797|      0|    if (context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2797:9): [True: 0, False: 0]
  ------------------
 2798|      0|      BLOSC_TRACE_ERROR("The number of items in block_maskout (%d) must match the number"
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2799|      0|                        " of blocks in chunk (%d).",
 2800|      0|                        context->block_maskout_nitems, context->nblocks);
 2801|      0|      return BLOSC2_ERROR_DATA;
 2802|      0|    }
 2803|      0|    bool has_delta = false;
 2804|      0|    for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) {
  ------------------
  |  Branch (2804:21): [True: 0, False: 0]
  ------------------
 2805|      0|      if (context->filters[i] == BLOSC_DELTA) {
  ------------------
  |  Branch (2805:11): [True: 0, False: 0]
  ------------------
 2806|      0|        has_delta = true;
 2807|      0|        break;
 2808|      0|      }
 2809|      0|    }
 2810|      0|    if (has_delta) {
  ------------------
  |  Branch (2810:9): [True: 0, False: 0]
  ------------------
 2811|      0|      bool any_needed = false;
 2812|      0|      for (int i = 0; i < context->block_maskout_nitems; ++i) {
  ------------------
  |  Branch (2812:23): [True: 0, False: 0]
  ------------------
 2813|      0|        if (!context->block_maskout[i]) {
  ------------------
  |  Branch (2813:13): [True: 0, False: 0]
  ------------------
 2814|      0|          any_needed = true;
 2815|      0|          break;
 2816|      0|        }
 2817|      0|      }
 2818|      0|      if (any_needed) {
  ------------------
  |  Branch (2818:11): [True: 0, False: 0]
  ------------------
 2819|       |        // Delta filter encodes subsequent blocks relative to block 0; block 0 must be unmasked.
 2820|      0|        context->block_maskout[0] = false;
 2821|      0|      }
 2822|      0|    }
 2823|      0|  }
 2824|       |
 2825|  31.8k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2826|  31.8k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2826:7): [True: 0, False: 31.8k]
  ------------------
 2827|      0|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2828|      0|                      context->special_type);
 2829|      0|    return BLOSC2_ERROR_DATA;
 2830|      0|  }
 2831|       |
 2832|  31.8k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2833|  31.8k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2833:7): [True: 460, False: 31.3k]
  |  Branch (2833:19): [True: 25, False: 435]
  ------------------
 2834|     25|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   93|     25|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     25|    do {                                            \
  |  |  |  |   98|     25|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     25|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 25, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     25|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2835|     25|    return BLOSC2_ERROR_DATA;
 2836|     25|  }
 2837|       |
 2838|  31.8k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2838:7): [True: 1, False: 31.8k]
  |  Branch (2838:32): [True: 0, False: 1]
  ------------------
 2839|      0|      !context->special_type) {
  ------------------
  |  Branch (2839:7): [True: 0, False: 0]
  ------------------
 2840|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 2841|      0|    return 0;
 2842|      0|  }
 2843|       |
 2844|  31.8k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2845|  31.8k|  bstarts_end = context->header_overhead;
 2846|  31.8k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2846:7): [True: 28.3k, False: 3.43k]
  |  Branch (2846:33): [True: 27.9k, False: 420]
  ------------------
 2847|  27.9k|    size_t bstarts_end_tmp;
 2848|  27.9k|    size_t bstarts_nbytes;
 2849|  27.9k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2849:9): [True: 9, False: 27.9k]
  ------------------
 2850|  27.9k|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2850:9): [True: 0, False: 27.9k]
  ------------------
 2851|  27.9k|        !blosc2_checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2851:9): [True: 0, False: 27.9k]
  ------------------
 2852|  27.9k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2852:9): [True: 0, False: 27.9k]
  ------------------
 2853|      9|      BLOSC_TRACE_ERROR("Invalid bstarts size in chunk header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2854|      9|      return BLOSC2_ERROR_INVALID_HEADER;
 2855|      9|    }
 2856|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 2857|  27.9k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2858|  27.9k|  }
 2859|       |
 2860|  31.8k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2860:7): [True: 8, False: 31.7k]
  ------------------
 2861|      8|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2862|      8|    return BLOSC2_ERROR_READ_BUFFER;
 2863|      8|  }
 2864|       |
 2865|  31.7k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2865:7): [True: 27, False: 31.7k]
  |  Branch (2865:19): [True: 19, False: 8]
  |  Branch (2865:30): [True: 19, False: 0]
  |  Branch (2865:56): [True: 19, False: 0]
  ------------------
 2866|     19|    size_t block_csizes_nbytes;
 2867|     19|    size_t trailer_meta_nbytes;
 2868|     19|    size_t lazy_trailer_end;
 2869|     19|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2869:9): [True: 0, False: 19]
  |  Branch (2869:33): [True: 0, False: 19]
  ------------------
 2870|     19|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2870:9): [True: 0, False: 19]
  ------------------
 2871|     19|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2871:9): [True: 0, False: 19]
  ------------------
 2872|     19|        !blosc2_checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2872:9): [True: 0, False: 19]
  ------------------
 2873|     19|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 19]
  ------------------
 2874|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2875|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2876|      0|    }
 2877|     19|  }
 2878|  31.7k|  srcsize -= bstarts_end;
 2879|       |
 2880|       |  /* Read optional dictionary if flag set */
 2881|  31.7k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2881:7): [True: 4.03k, False: 27.7k]
  |  Branch (2881:51): [True: 3.84k, False: 192]
  ------------------
 2882|  3.84k|    context->use_dict = 1;
 2883|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2884|  3.84k|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2884:9): [True: 0, False: 3.84k]
  ------------------
 2885|      0|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2886|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2887|      0|    }
 2888|  3.84k|    srcsize -= sizeof(int32_t);
 2889|       |    // Read dictionary size
 2890|  3.84k|    context->dict_size = sw32_(context->src + bstarts_end);
 2891|  3.84k|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2891:9): [True: 10, False: 3.83k]
  |  Branch (2891:36): [True: 5, False: 3.82k]
  ------------------
 2892|     15|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|     15|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     15|    do {                                            \
  |  |  |  |   98|     15|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     15|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     15|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2893|     15|      return BLOSC2_ERROR_CODEC_DICT;
 2894|     15|    }
 2895|  3.82k|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2895:9): [True: 5, False: 3.82k]
  ------------------
 2896|      5|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2897|      5|      return BLOSC2_ERROR_READ_BUFFER;
 2898|      5|    }
 2899|  3.82k|    srcsize -= context->dict_size;
 2900|       |    // dict_buffer points directly into the source chunk — no copy needed
 2901|  3.82k|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2902|  3.82k|    context->dict_buffer_owned = false;
 2903|  3.82k|#if defined(HAVE_ZSTD)
 2904|       |    // context->compcode during decompression holds the format code (flags >> 5),
 2905|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 2906|  3.82k|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2906:9): [True: 3.43k, False: 391]
  ------------------
 2907|  3.43k|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2908|  3.43k|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2908:11): [True: 238, False: 3.19k]
  ------------------
 2909|    238|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|    238|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    238|    do {                                            \
  |  |  |  |   98|    238|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    238|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 238, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    238|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2910|    238|        return BLOSC2_ERROR_CODEC_DICT;
 2911|    238|      }
 2912|  3.43k|    }
 2913|  3.82k|#endif   // HAVE_ZSTD
 2914|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2915|  3.82k|  }
 2916|  27.9k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2916:12): [True: 192, False: 27.7k]
  |  Branch (2916:56): [True: 192, False: 0]
  ------------------
 2917|    192|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2918|    192|    if (rc < 0) {
  ------------------
  |  Branch (2918:9): [True: 192, False: 0]
  ------------------
 2919|    192|      return rc;
 2920|    192|    }
 2921|    192|  }
 2922|       |
 2923|  31.3k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2923:7): [True: 26, False: 31.3k]
  |  Branch (2923:19): [True: 26, False: 0]
  |  Branch (2923:45): [True: 26, False: 0]
  ------------------
 2924|     26|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2925|     26|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|     26|    do {                                            \
  |  |  105|     26|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 26]
  |  |  ------------------
  |  |  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|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 26]
  |  |  ------------------
  ------------------
 2926|     26|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2927|     26|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|     26|    do {                                            \
  |  |  105|     26|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 26]
  |  |  ------------------
  |  |  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|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 26]
  |  |  ------------------
  ------------------
 2928|     26|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2929|     26|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|     26|    do {                                            \
  |  |  105|     26|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 26]
  |  |  ------------------
  |  |  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|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 26]
  |  |  ------------------
  ------------------
 2930|       |
 2931|     26|    if (is_lazy) {
  ------------------
  |  Branch (2931:9): [True: 18, False: 8]
  ------------------
 2932|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 2933|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 2934|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 2935|     18|      int32_t max_csize = 0;
 2936|     27|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2936:27): [True: 26, False: 1]
  ------------------
 2937|     26|        int32_t bstart = sw32_(context->bstarts + i);
 2938|     26|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2938:31): [True: 25, False: 1]
  ------------------
 2939|     25|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2940|     26|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2940:13): [True: 0, False: 26]
  |  Branch (2940:37): [True: 0, False: 26]
  ------------------
 2941|     26|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2941:13): [True: 17, False: 9]
  ------------------
 2942|     17|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   93|     17|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     17|    do {                                            \
  |  |  |  |   98|     17|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     17|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     17|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2943|     17|          return BLOSC2_ERROR_INVALID_HEADER;
 2944|     17|        }
 2945|      9|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2946|      9|        context->blockoffsets[i] = 0;  // unknown
 2947|      9|        context->blockcbytes[i] = next_bstart - bstart;
 2948|      9|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2948:13): [True: 8, False: 1]
  ------------------
 2949|      8|          max_csize = context->blockcbytes[i];
 2950|      8|        }
 2951|      9|      }
 2952|      1|      context->blocksize = max_csize;
 2953|      1|      context->leftover = 0;
 2954|      1|    }
 2955|      8|    else {
 2956|      8|      int32_t max_blocksize = 0;
 2957|      8|      int64_t total_nbytes = 0;
 2958|      8|      int32_t prev_bstart = 0;
 2959|     13|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2959:27): [True: 12, False: 1]
  ------------------
 2960|     12|        int32_t bstart = sw32_(context->bstarts + i);
 2961|     12|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2961:31): [True: 9, False: 3]
  ------------------
 2962|      9|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2963|     12|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2963:13): [True: 0, False: 12]
  |  Branch (2963:37): [True: 0, False: 12]
  |  Branch (2963:62): [True: 3, False: 9]
  ------------------
 2964|      9|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2964:13): [True: 4, False: 5]
  |  Branch (2964:45): [True: 0, False: 5]
  ------------------
 2965|      7|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2966|      7|          return BLOSC2_ERROR_INVALID_HEADER;
 2967|      7|        }
 2968|      5|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2969|      5|        context->blockcbytes[i] = next_bstart - bstart;
 2970|      5|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2970:13): [True: 0, False: 5]
  ------------------
 2971|      0|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2972|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2973|      0|        }
 2974|      5|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2974:13): [True: 0, False: 5]
  ------------------
 2975|      0|          BLOSC_TRACE_ERROR("Invalid VL-block cumulative size in chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2976|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2977|      0|        }
 2978|      5|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2979|      5|        total_nbytes += context->blocknbytes[i];
 2980|      5|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2980:13): [True: 0, False: 5]
  ------------------
 2981|      0|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2982|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2983|      0|        }
 2984|      5|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2984:13): [True: 4, False: 1]
  ------------------
 2985|      4|          max_blocksize = context->blocknbytes[i];
 2986|      4|        }
 2987|      5|        prev_bstart = bstart;
 2988|      5|      }
 2989|      1|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2989:11): [True: 1, False: 0]
  ------------------
 2990|      1|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2991|      1|        return BLOSC2_ERROR_INVALID_HEADER;
 2992|      1|      }
 2993|      0|      context->blocksize = max_blocksize;
 2994|      0|      context->leftover = 0;
 2995|      0|    }
 2996|     26|  }
 2997|       |
 2998|  31.3k|  return 0;
 2999|  31.3k|}
blosc2.c:load_lazy_chunk_dict:
 2703|    192|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 2704|    192|  int32_t dict_offset = bstarts_end;
 2705|    192|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2705:7): [True: 0, False: 192]
  ------------------
 2706|      0|    BLOSC_TRACE_ERROR("Lazy chunk dictionary header 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2707|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2708|      0|  }
 2709|       |
 2710|    192|  uint8_t dict_size_buf[sizeof(int32_t)];
 2711|    192|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 2712|    192|                                 "Cannot open frame file for lazy chunk dictionary read.",
 2713|    192|                                 "Cannot read lazy chunk dictionary size from disk.");
 2714|    192|  if (rc < 0) {
  ------------------
  |  Branch (2714:7): [True: 192, False: 0]
  ------------------
 2715|    192|    return rc;
 2716|    192|  }
 2717|       |
 2718|      0|  context->dict_size = sw32_(dict_size_buf);
 2719|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2719:7): [True: 0, False: 0]
  |  Branch (2719:34): [True: 0, False: 0]
  ------------------
 2720|      0|    BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2721|      0|    return BLOSC2_ERROR_CODEC_DICT;
 2722|      0|  }
 2723|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (2723:7): [True: 0, False: 0]
  ------------------
 2724|      0|    BLOSC_TRACE_ERROR("Lazy chunk dictionary exceeds chunk length.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2725|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2726|      0|  }
 2727|       |
 2728|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 2729|      0|  BLOSC_ERROR_NULL(context->dict_buffer, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2730|      0|  context->dict_buffer_owned = true;
 2731|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 2732|      0|                             context->dict_buffer, context->dict_size,
 2733|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 2734|      0|                             "Cannot read lazy chunk dictionary from disk.");
 2735|      0|  if (rc < 0) {
  ------------------
  |  Branch (2735:7): [True: 0, False: 0]
  ------------------
 2736|      0|    release_context_dict_buffer(context);
 2737|      0|    return rc;
 2738|      0|  }
 2739|       |
 2740|      0|  context->use_dict = 1;
 2741|      0|#if defined(HAVE_ZSTD)
 2742|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2742:7): [True: 0, False: 0]
  ------------------
 2743|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2744|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2744:9): [True: 0, False: 0]
  ------------------
 2745|      0|      release_context_dict_buffer(context);
 2746|      0|      BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for lazy chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2747|      0|      return BLOSC2_ERROR_CODEC_DICT;
 2748|      0|    }
 2749|      0|  }
 2750|      0|#endif
 2751|       |
 2752|      0|  return 0;
 2753|      0|}
blosc2.c:do_job:
 2382|  31.3k|static int do_job(blosc2_context* context) {
 2383|  31.3k|  int32_t ntbytes;
 2384|       |
 2385|       |  /* Set sentinels */
 2386|  31.3k|  context->dref_not_init = 1;
 2387|       |
 2388|       |  /* Apply thread-count changes before deciding whether this operation actually
 2389|       |     needs a parallel backend.  POSIX defers backend startup for serial jobs.
 2390|       |     Windows keeps its existing per-context thread lifecycle and starts/rebinds
 2391|       |     the backend eagerly. */
 2392|       |#if defined(_WIN32)
 2393|       |  int rc = check_nthreads(context, true);
 2394|       |#else
 2395|  31.3k|  int rc = check_nthreads(context, false);
 2396|  31.3k|#endif
 2397|       |
 2398|       |  /* Run serially with one thread, with fewer than two full blocks of source
 2399|       |     data, or if thread configuration/backend setup fails. */
 2400|  31.3k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1 || rc < 0) {
  ------------------
  |  Branch (2400:7): [True: 31.3k, False: 0]
  |  Branch (2400:33): [True: 0, False: 0]
  |  Branch (2400:84): [True: 0, False: 0]
  ------------------
 2401|  31.3k|    if (ensure_serial_context(context) < 0) {
  ------------------
  |  Branch (2401:9): [True: 0, False: 31.3k]
  ------------------
 2402|      0|      return BLOSC2_ERROR_THREAD_CREATE;
 2403|      0|    }
 2404|  31.3k|    ntbytes = serial_blosc(context->serial_context);
 2405|  31.3k|  }
 2406|      0|  else {
 2407|      0|    rc = check_nthreads(context, true);
 2408|      0|    if (rc < 0) {
  ------------------
  |  Branch (2408:9): [True: 0, False: 0]
  ------------------
 2409|       |      /* Backend startup failed; run serially and retry on the next parallel job. */
 2410|      0|      if (ensure_serial_context(context) < 0) {
  ------------------
  |  Branch (2410:11): [True: 0, False: 0]
  ------------------
 2411|      0|        return BLOSC2_ERROR_THREAD_CREATE;
 2412|      0|      }
 2413|      0|      ntbytes = serial_blosc(context->serial_context);
 2414|      0|    }
 2415|      0|    else {
 2416|      0|      ntbytes = parallel_blosc(context);
 2417|      0|    }
 2418|      0|  }
 2419|       |
 2420|  31.3k|  return ntbytes;
 2421|  31.3k|}
blosc2.c:ensure_serial_context:
 2369|  31.3k|static int ensure_serial_context(blosc2_context* context) {
 2370|  31.3k|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (2370:7): [True: 9.10k, False: 22.2k]
  ------------------
 2371|  9.10k|    context->serial_context = create_thread_context(context, 0);
 2372|  9.10k|  }
 2373|  22.2k|  else if (context->blocksize != context->serial_context->tmp_blocksize) {
  ------------------
  |  Branch (2373:12): [True: 192, False: 22.0k]
  ------------------
 2374|    192|    free_thread_context(context->serial_context);
 2375|    192|    context->serial_context = create_thread_context(context, 0);
 2376|    192|  }
 2377|  31.3k|  return context->serial_context != NULL ? 0 : BLOSC2_ERROR_THREAD_CREATE;
  ------------------
  |  Branch (2377:10): [True: 31.3k, False: 0]
  ------------------
 2378|  31.3k|}
blosc2.c:serial_blosc:
 2183|  31.3k|static int serial_blosc(struct thread_context* thread_context) {
 2184|  31.3k|  blosc2_context* context = thread_context->parent_context;
 2185|  31.3k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2186|  31.3k|  int32_t j, bsize, leftoverblock;
 2187|  31.3k|  int32_t cbytes;
 2188|  31.3k|  int32_t ntbytes = context->output_bytes;
 2189|  31.3k|  int32_t* bstarts = context->bstarts;
 2190|  31.3k|  uint8_t* tmp = thread_context->tmp;
 2191|  31.3k|  uint8_t* tmp2 = thread_context->tmp2;
 2192|  31.3k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2192:23): [True: 3.58k, False: 27.7k]
  |  Branch (2192:44): [True: 3.58k, False: 0]
  ------------------
 2193|  31.3k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2194|  31.3k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2194:7): [True: 31.3k, False: 0]
  |  Branch (2194:32): [True: 3.10k, False: 28.2k]
  ------------------
 2195|       |    // Fake a runlen as if it was a memcpyed chunk
 2196|  3.10k|    memcpyed = true;
 2197|  3.10k|  }
 2198|       |
 2199|  21.6M|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2199:15): [True: 21.5M, False: 23.3k]
  ------------------
 2200|  21.5M|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2200:9): [True: 0, False: 21.5M]
  |  Branch (2200:33): [True: 0, False: 0]
  |  Branch (2200:46): [True: 0, False: 0]
  ------------------
 2201|      0|      _sw32(bstarts + j, ntbytes);
 2202|      0|    }
 2203|  21.5M|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2203:13): [True: 1, False: 21.5M]
  ------------------
 2204|  21.5M|    leftoverblock = 0;
 2205|  21.5M|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2205:9): [True: 21.5M, False: 1]
  |  Branch (2205:22): [True: 25.5k, False: 21.5M]
  |  Branch (2205:53): [True: 19.4k, False: 6.10k]
  ------------------
 2206|  19.4k|      bsize = context->leftover;
 2207|  19.4k|      leftoverblock = 1;
 2208|  19.4k|    }
 2209|  21.5M|    if (context->do_compress) {
  ------------------
  |  Branch (2209:9): [True: 0, False: 21.5M]
  ------------------
 2210|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2210:11): [True: 0, False: 0]
  |  Branch (2210:23): [True: 0, False: 0]
  ------------------
 2211|       |        /* We want to memcpy only */
 2212|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2213|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2214|      0|        cbytes = (int32_t)bsize;
 2215|      0|      }
 2216|      0|      else {
 2217|       |        /* Regular compression */
 2218|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2219|      0|                         context->destsize,
 2220|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2220:26): [True: 0, False: 0]
  ------------------
 2221|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2221:26): [True: 0, False: 0]
  ------------------
 2222|      0|                         context->dest + ntbytes, tmp, tmp2);
 2223|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2223:13): [True: 0, False: 0]
  ------------------
 2224|      0|          ntbytes = 0;              /* incompressible data */
 2225|      0|          break;
 2226|      0|        }
 2227|      0|      }
 2228|      0|    }
 2229|  21.5M|    else {
 2230|       |      /* Regular decompression */
 2231|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2232|  21.5M|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2232:28): [True: 21.5M, False: 46.4k]
  ------------------
 2233|  21.5M|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2234|  21.5M|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2234:30): [True: 1, False: 21.5M]
  |  Branch (2234:42): [True: 0, False: 1]
  ------------------
 2235|  21.5M|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2235:30): [True: 1, False: 21.5M]
  |  Branch (2235:42): [True: 0, False: 1]
  ------------------
 2236|  21.5M|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2236:30): [True: 1, False: 21.5M]
  ------------------
 2237|  21.5M|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2238|  21.5M|                       context->src, context->srcsize, src_offset, j,
 2239|  21.5M|                       dest_block, dest_offset, tmp, tmp2);
 2240|  21.5M|    }
 2241|       |
 2242|  21.5M|    if (cbytes < 0) {
  ------------------
  |  Branch (2242:9): [True: 8.00k, False: 21.5M]
  ------------------
 2243|  8.00k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2244|  8.00k|      break;
 2245|  8.00k|    }
 2246|  21.5M|    ntbytes += cbytes;
 2247|  21.5M|  }
 2248|       |
 2249|  31.3k|  return ntbytes;
 2250|  31.3k|}
blosc2.c:read_lazy_chunk_bytes:
 2616|    192|                                 const char* open_error, const char* read_error) {
 2617|    192|  int32_t chunk_cbytes;
 2618|    192|  if (context->src == NULL || context->srcsize < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2618:7): [True: 0, False: 192]
  |  Branch (2618:31): [True: 0, False: 192]
  ------------------
 2619|    192|      offset < 0 || nbytes < 0 || context->nblocks <= 0 ||
  ------------------
  |  Branch (2619:7): [True: 0, False: 192]
  |  Branch (2619:21): [True: 0, False: 192]
  |  Branch (2619:35): [True: 18, False: 174]
  ------------------
 2620|    174|      blosc2_cbuffer_sizes(context->src, NULL, &chunk_cbytes, NULL) < 0 ||
  ------------------
  |  Branch (2620:7): [True: 0, False: 174]
  ------------------
 2621|    174|      offset > chunk_cbytes || nbytes > chunk_cbytes - offset) {
  ------------------
  |  Branch (2621:7): [True: 0, False: 174]
  |  Branch (2621:32): [True: 0, False: 174]
  ------------------
 2622|     18|    return BLOSC2_ERROR_INVALID_HEADER;
 2623|     18|  }
 2624|    174|  int64_t trailer_end = BLOSC_EXTENDED_HEADER_LENGTH +
 2625|    174|      (int64_t)context->nblocks * sizeof(int32_t) + sizeof(int32_t) + sizeof(int64_t);
 2626|    174|  if (trailer_end > context->srcsize) return BLOSC2_ERROR_READ_BUFFER;
  ------------------
  |  Branch (2626:7): [True: 3, False: 171]
  ------------------
 2627|    171|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (2627:7): [True: 5, False: 166]
  |  Branch (2627:34): [True: 0, False: 166]
  ------------------
 2628|      5|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2629|      5|    return BLOSC2_ERROR_INVALID_PARAM;
 2630|      5|  }
 2631|       |
 2632|    166|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2633|    166|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2634|    166|  if (io_cb == NULL) {
  ------------------
  |  Branch (2634:7): [True: 0, False: 166]
  ------------------
 2635|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2636|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 2637|      0|  }
 2638|       |
 2639|    166|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 2640|    166|                           context->nblocks * (int32_t)sizeof(int32_t);
 2641|    166|  int32_t nchunk_lazy;
 2642|    166|  int64_t chunk_offset;
 2643|    166|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 2644|    166|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 2645|    166|  if (nchunk_lazy < 0 || chunk_offset < 0 || frame->file_offset < 0 ||
  ------------------
  |  Branch (2645:7): [True: 23, False: 143]
  |  Branch (2645:26): [True: 49, False: 94]
  |  Branch (2645:46): [True: 0, False: 94]
  ------------------
 2646|     94|      (!frame->sframe && (chunk_offset < FRAME_HEADER_MINLEN ||
  ------------------
  |  |   49|    188|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|     94|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     94|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     94|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|     94|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|     94|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|     94|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|     94|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|     94|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|     94|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|     94|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|     94|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|     94|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|     94|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2646:8): [True: 94, False: 0]
  |  Branch (2646:27): [True: 1, False: 93]
  ------------------
 2647|    153|       chunk_offset > frame->len || chunk_cbytes > frame->len - chunk_offset))) {
  ------------------
  |  Branch (2647:8): [True: 79, False: 14]
  |  Branch (2647:37): [True: 1, False: 13]
  ------------------
 2648|    153|    return BLOSC2_ERROR_INVALID_HEADER;
 2649|    153|  }
 2650|       |
 2651|     13|  void* fp = NULL;
 2652|     13|  int64_t io_pos;
 2653|     13|  if (frame->sframe) {
  ------------------
  |  Branch (2653:7): [True: 0, False: 13]
  ------------------
 2654|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 2655|      0|    io_pos = offset;
 2656|      0|  }
 2657|     13|  else {
 2658|     13|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (2658:9): [True: 0, False: 13]
  |  Branch (2658:29): [True: 0, False: 13]
  ------------------
 2659|      0|      BLOSC_TRACE_ERROR("Lazy chunk offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2660|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2661|      0|    }
 2662|     13|    fp = frame_reader_acquire(frame, context->schunk->storage->io);
 2663|     13|    if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (2663:9): [True: 0, False: 13]
  ------------------
 2664|      0|      BLOSC_TRACE_ERROR("Lazy chunk offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2665|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2665:11): [True: 0, False: 0]
  ------------------
 2666|      0|        frame_reader_release(frame, io_cb, fp);
 2667|      0|      }
 2668|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2669|      0|    }
 2670|     13|    if (!blosc2_checked_add_i64(io_pos, offset, &io_pos)) {
  ------------------
  |  Branch (2670:9): [True: 0, False: 13]
  ------------------
 2671|      0|      BLOSC_TRACE_ERROR("Lazy block offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2672|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2672:11): [True: 0, False: 0]
  ------------------
 2673|      0|        frame_reader_release(frame, io_cb, fp);
 2674|      0|      }
 2675|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2676|      0|    }
 2677|     13|  }
 2678|     13|  if (fp == NULL) {
  ------------------
  |  Branch (2678:7): [True: 13, False: 0]
  ------------------
 2679|     13|    BLOSC_TRACE_ERROR("%s", open_error);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2680|     13|    return BLOSC2_ERROR_FILE_OPEN;
 2681|     13|  }
 2682|      0|  if (!blosc2_checked_add_i64(io_pos, nbytes, NULL)) {
  ------------------
  |  Branch (2682:7): [True: 0, False: 0]
  ------------------
 2683|      0|    frame_reader_release(frame, io_cb, fp);
 2684|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2685|      0|  }
 2686|       |
 2687|      0|  uint8_t* read_buffer = buffer;
 2688|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 2689|      0|  frame_reader_release(frame, io_cb, fp);
 2690|      0|  if (read_buffer != buffer) {
  ------------------
  |  Branch (2690:7): [True: 0, False: 0]
  ------------------
 2691|      0|    if (rbytes == nbytes && read_buffer != NULL) memcpy(buffer, read_buffer, (size_t)nbytes);
  ------------------
  |  Branch (2691:9): [True: 0, False: 0]
  |  Branch (2691:29): [True: 0, False: 0]
  ------------------
 2692|      0|    free(read_buffer);
 2693|      0|  }
 2694|      0|  if (rbytes != nbytes || read_buffer == NULL) {
  ------------------
  |  Branch (2694:7): [True: 0, False: 0]
  |  Branch (2694:27): [True: 0, False: 0]
  ------------------
 2695|      0|    BLOSC_TRACE_ERROR("%s", read_error);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2696|      0|    return BLOSC2_ERROR_FILE_READ;
 2697|      0|  }
 2698|       |
 2699|      0|  return 0;
 2700|      0|}
blosc2.c:create_thread_context:
 2286|  25.6k|create_thread_context(blosc2_context* context, int32_t tid) {
 2287|  25.6k|  struct thread_context* thread_context;
 2288|  25.6k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2289|  25.6k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  25.6k|    do {                                            \
  |  |  105|  25.6k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 25.6k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  25.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 25.6k]
  |  |  ------------------
  ------------------
 2290|  25.6k|  int rc = init_thread_context(thread_context, context, tid);
 2291|  25.6k|  if (rc < 0) {
  ------------------
  |  Branch (2291:7): [True: 0, False: 25.6k]
  ------------------
 2292|      0|    return NULL;
 2293|      0|  }
 2294|  25.6k|  return thread_context;
 2295|  25.6k|}
blosc2.c:init_thread_context:
 2256|  25.6k|{
 2257|  25.6k|  int32_t ebsize;
 2258|       |
 2259|  25.6k|  thread_context->parent_context = context;
 2260|  25.6k|  thread_context->owner_pool = NULL;
 2261|  25.6k|  thread_context->tid = tid;
 2262|       |
 2263|  25.6k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2263:23): [True: 25.6k, False: 0]
  ------------------
 2264|  25.6k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2264:22): [True: 25.6k, False: 0]
  ------------------
 2265|  25.6k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2266|  25.6k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2267|  25.6k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2268|  25.6k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  25.6k|    do {                                            \
  |  |  105|  25.6k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 25.6k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  25.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 25.6k]
  |  |  ------------------
  ------------------
 2269|  25.6k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2270|  25.6k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2271|  25.6k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2272|  25.6k|  thread_context->tmp_blocksize = blocksize;
 2273|  25.6k|  thread_context->zfp_cell_nitems = 0;
 2274|  25.6k|  thread_context->zfp_cell_start = 0;
 2275|  25.6k|  #if defined(HAVE_ZSTD)
 2276|  25.6k|  thread_context->zstd_cctx = NULL;
 2277|  25.6k|  thread_context->zstd_dctx = NULL;
 2278|  25.6k|  #endif
 2279|  25.6k|  thread_context->lz4_cstream = NULL;
 2280|  25.6k|  thread_context->lz4hc_cstream = NULL;
 2281|       |
 2282|  25.6k|  return 0;
 2283|  25.6k|}
blosc2.c:blosc_d:
 1733|  21.5M|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1734|  21.5M|  blosc2_context* context = thread_context->parent_context;
 1735|  21.5M|  uint8_t* filters = context->filters;
 1736|  21.5M|  uint8_t *tmp3 = thread_context->tmp4;
 1737|  21.5M|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1738|  21.5M|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1739|  21.5M|  int dont_split = (context->header_flags & 0x10) >> 4;
 1740|  21.5M|  int32_t chunk_nbytes;
 1741|  21.5M|  int32_t chunk_cbytes;
 1742|  21.5M|  int nstreams;
 1743|  21.5M|  int32_t neblock;
 1744|  21.5M|  int32_t nbytes;                /* number of decompressed bytes in split */
 1745|  21.5M|  int32_t cbytes;                /* number of compressed bytes in split */
 1746|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1747|  21.5M|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1748|  21.5M|  uint8_t* _dest;
 1749|  21.5M|  int32_t typesize = context->typesize;
 1750|  21.5M|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1751|  21.5M|  const char* compname;
 1752|  21.5M|  int rc;
 1753|       |
 1754|  21.5M|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1754:7): [True: 0, False: 21.5M]
  |  Branch (1754:41): [True: 0, False: 0]
  ------------------
 1755|       |    // Do not decompress, but act as if we successfully decompressed everything
 1756|      0|    return bsize;
 1757|      0|  }
 1758|       |
 1759|  21.5M|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1760|  21.5M|  if (rc < 0) {
  ------------------
  |  Branch (1760:7): [True: 0, False: 21.5M]
  ------------------
 1761|      0|    return rc;
 1762|      0|  }
 1763|  21.5M|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1763:7): [True: 9, False: 21.5M]
  ------------------
 1764|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1765|      9|    typesize = chunk_cbytes - context->header_overhead;
 1766|      9|  }
 1767|       |
 1768|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1769|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1770|  21.5M|  if (context->src == NULL) {
  ------------------
  |  Branch (1770:7): [True: 0, False: 21.5M]
  ------------------
 1771|      0|    context->src = src;
 1772|      0|  }
 1773|       |
 1774|       |  // Chunks with special values cannot be lazy
 1775|  21.5M|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1775:19): [True: 21.5M, False: 709]
  ------------------
 1776|  21.5M|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1776:11): [True: 2.09k, False: 21.5M]
  |  Branch (1776:46): [True: 5, False: 2.09k]
  ------------------
 1777|  21.5M|  if (is_lazy) {
  ------------------
  |  Branch (1777:7): [True: 5, False: 21.5M]
  ------------------
 1778|       |    // The chunk is on disk, so just lazily load the block
 1779|      5|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1779:9): [True: 1, False: 4]
  ------------------
 1780|      1|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1781|      1|      return BLOSC2_ERROR_INVALID_PARAM;
 1782|      1|    }
 1783|      4|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1783:9): [True: 0, False: 4]
  ------------------
 1784|      0|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1785|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1786|      0|    }
 1787|      4|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1788|      4|    size_t bstarts_nbytes;
 1789|      4|    size_t trailer_offset;
 1790|      4|    size_t block_csizes_nbytes;
 1791|      4|    size_t trailer_meta_nbytes;
 1792|      4|    size_t lazy_trailer_end;
 1793|      4|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1793:9): [True: 0, False: 4]
  |  Branch (1793:24): [True: 0, False: 4]
  ------------------
 1794|      4|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1794:9): [True: 0, False: 4]
  ------------------
 1795|      4|        !blosc2_checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1795:9): [True: 0, False: 4]
  ------------------
 1796|      4|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1796:9): [True: 0, False: 4]
  ------------------
 1797|      4|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1797:9): [True: 0, False: 4]
  ------------------
 1798|      4|        !blosc2_checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1798:9): [True: 0, False: 4]
  ------------------
 1799|      4|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1799:9): [True: 1, False: 3]
  ------------------
 1800|      1|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1801|      1|      return BLOSC2_ERROR_READ_BUFFER;
 1802|      1|    }
 1803|      3|    int32_t nchunk;
 1804|      3|    int64_t chunk_offset;
 1805|       |    // The nchunk and the offset of the current chunk are in the trailer
 1806|      3|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1807|      3|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1808|       |    // Get the csize of the nblock
 1809|      3|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1809:9): [True: 0, False: 3]
  |  Branch (1809:23): [True: 0, False: 3]
  ------------------
 1810|      0|      BLOSC_TRACE_ERROR("Invalid block index in lazy trailer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1811|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1812|      0|    }
 1813|      3|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1814|      3|    int32_t block_csize = block_csizes[nblock];
 1815|      3|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1816|      3|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1816:9): [True: 1, False: 2]
  |  Branch (1816:29): [True: 2, False: 0]
  ------------------
 1817|      3|      BLOSC_TRACE_ERROR("Invalid lazy block size in trailer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1818|      3|      return BLOSC2_ERROR_INVALID_HEADER;
 1819|      3|    }
 1820|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1820:9): [True: 0, False: 0]
  |  Branch (1820:21): [True: 0, False: 0]
  ------------------
 1821|      0|      BLOSC_TRACE_ERROR("Lazy VL block compressed size is too small.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1822|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1823|      0|    }
 1824|       |    // Read the lazy block on disk
 1825|      0|    void* fp = NULL;
 1826|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1827|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1827:9): [True: 0, False: 0]
  ------------------
 1828|      0|      BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1829|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1830|      0|    }
 1831|       |
 1832|      0|    int64_t io_pos = 0;
 1833|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1833:9): [True: 0, False: 0]
  ------------------
 1834|       |      // The chunk is not in the frame
 1835|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1836|      0|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1837|       |      // The offset of the block is src_offset
 1838|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1838:11): [True: 0, False: 0]
  ------------------
 1839|      0|        frame_reader_release(frame, io_cb, fp);
 1840|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1841|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1842|      0|      }
 1843|      0|      io_pos = src_offset;
 1844|      0|    }
 1845|      0|    else {
 1846|      0|      fp = frame_reader_acquire(frame, context->schunk->storage->io);
 1847|      0|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1848|       |      // The offset of the block is src_offset
 1849|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1849:11): [True: 0, False: 0]
  ------------------
 1850|      0|        frame_reader_release(frame, io_cb, fp);
 1851|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1852|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1853|      0|      }
 1854|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1854:11): [True: 0, False: 0]
  ------------------
 1855|      0|        frame_reader_release(frame, io_cb, fp);
 1856|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1858|      0|      }
 1859|      0|      if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (1859:11): [True: 0, False: 0]
  ------------------
 1860|      0|        frame_reader_release(frame, io_cb, fp);
 1861|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1862|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1863|      0|      }
 1864|      0|      if (!blosc2_checked_add_i64(io_pos, src_offset, &io_pos)) {
  ------------------
  |  Branch (1864:11): [True: 0, False: 0]
  ------------------
 1865|      0|        frame_reader_release(frame, io_cb, fp);
 1866|      0|        BLOSC_TRACE_ERROR("Lazy block offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1867|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1868|      0|      }
 1869|      0|    }
 1870|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1871|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1872|      0|    frame_reader_release(frame, io_cb, fp);
 1873|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1873:9): [True: 0, False: 0]
  ------------------
 1874|      0|      BLOSC_TRACE_ERROR("Cannot read the (lazy) block out of the fileframe.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1875|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1876|      0|    }
 1877|      0|    src = tmp3;
 1878|      0|    src_offset = 0;
 1879|      0|    srcsize = block_csize;
 1880|      0|  }
 1881|       |
 1882|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1883|  21.5M|  if (memcpyed) {
  ------------------
  |  Branch (1883:7): [True: 21.5M, False: 53.3k]
  ------------------
 1884|  21.5M|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1884:18): [True: 846, False: 21.5M]
  ------------------
 1885|  21.5M|    if (!context->special_type) {
  ------------------
  |  Branch (1885:9): [True: 1.96k, False: 21.5M]
  ------------------
 1886|  1.96k|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1886:11): [True: 0, False: 1.96k]
  ------------------
 1887|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1888|      0|      }
 1889|  1.96k|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1889:11): [True: 0, False: 1.96k]
  ------------------
 1890|       |        /* Not enough input to copy block */
 1891|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1892|      0|      }
 1893|  1.96k|    }
 1894|  21.5M|    if (!is_lazy) {
  ------------------
  |  Branch (1894:9): [True: 21.5M, False: 0]
  ------------------
 1895|  21.5M|      src += context->header_overhead + nblock * context->blocksize;
 1896|  21.5M|    }
 1897|  21.5M|    _dest = dest + dest_offset;
 1898|  21.5M|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1898:9): [True: 0, False: 21.5M]
  ------------------
 1899|       |      // We are making use of a postfilter, so use a temp for destination
 1900|      0|      _dest = tmp;
 1901|      0|    }
 1902|  21.5M|    rc = 0;
 1903|  21.5M|    switch (context->special_type) {
 1904|      9|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1904:7): [True: 9, False: 21.5M]
  ------------------
 1905|       |        // All repeated values
 1906|      9|        rc = set_values(typesize, context->src, _dest, bsize_);
 1907|      9|        if (rc < 0) {
  ------------------
  |  Branch (1907:13): [True: 0, False: 9]
  ------------------
 1908|      0|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1909|      0|          return BLOSC2_ERROR_DATA;
 1910|      0|        }
 1911|      9|        break;
 1912|  21.7k|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1912:7): [True: 21.7k, False: 21.5M]
  ------------------
 1913|  21.7k|        rc = set_nans(context->typesize, _dest, bsize_);
 1914|  21.7k|        if (rc < 0) {
  ------------------
  |  Branch (1914:13): [True: 8, False: 21.7k]
  ------------------
 1915|      8|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1916|      8|          return BLOSC2_ERROR_DATA;
 1917|      8|        }
 1918|  21.7k|        break;
 1919|  11.7M|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1919:7): [True: 11.7M, False: 9.81M]
  ------------------
 1920|  11.7M|        memset(_dest, 0, bsize_);
 1921|  11.7M|        break;
 1922|  9.79M|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1922:7): [True: 9.79M, False: 11.7M]
  ------------------
 1923|       |        // We do nothing here
 1924|  9.79M|        break;
 1925|  1.96k|      default:
  ------------------
  |  Branch (1925:7): [True: 1.96k, False: 21.5M]
  ------------------
 1926|  1.96k|        memcpy(_dest, src, bsize_);
 1927|  21.5M|    }
 1928|  21.5M|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1928:9): [True: 0, False: 21.5M]
  ------------------
 1929|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1930|      0|      blosc2_postfilter_params postparams;
 1931|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1932|      0|      postparams.input = tmp;
 1933|      0|      postparams.output = dest + dest_offset;
 1934|      0|      postparams.size = bsize;
 1935|      0|      postparams.typesize = typesize;
 1936|      0|      postparams.offset = nblock * context->blocksize;
 1937|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1937:27): [True: 0, False: 0]
  ------------------
 1938|      0|      postparams.nblock = nblock;
 1939|      0|      postparams.tid = thread_context->tid;
 1940|      0|      postparams.ttmp = thread_context->tmp;
 1941|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1942|      0|      postparams.ctx = context;
 1943|       |
 1944|       |      // Execute the postfilter (the processed block will be copied to dest)
 1945|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1945:11): [True: 0, False: 0]
  ------------------
 1946|      0|        BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1947|      0|        return BLOSC2_ERROR_POSTFILTER;
 1948|      0|      }
 1949|      0|    }
 1950|  21.5M|    thread_context->zfp_cell_nitems = 0;
 1951|       |
 1952|  21.5M|    return bsize_;
 1953|  21.5M|  }
 1954|       |
 1955|  53.3k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1955:7): [True: 53.3k, False: 0]
  |  Branch (1955:20): [True: 16, False: 53.3k]
  |  Branch (1955:39): [True: 12, False: 53.3k]
  ------------------
 1956|       |    /* Invalid block src offset encountered */
 1957|     28|    return BLOSC2_ERROR_DATA;
 1958|     28|  }
 1959|       |
 1960|  53.3k|  src += src_offset;
 1961|  53.3k|  if (vlblocks) {
  ------------------
  |  Branch (1961:7): [True: 0, False: 53.3k]
  ------------------
 1962|      0|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1962:9): [True: 0, False: 0]
  |  Branch (1962:41): [True: 0, False: 0]
  ------------------
 1963|      0|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1963:9): [True: 0, False: 0]
  ------------------
 1964|      0|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1964:9): [True: 0, False: 0]
  ------------------
 1965|      0|      return BLOSC2_ERROR_DATA;
 1966|      0|    }
 1967|      0|    srcsize = context->blockcbytes[nblock];
 1968|      0|  }
 1969|  53.3k|  else {
 1970|  53.3k|    srcsize -= src_offset;
 1971|  53.3k|  }
 1972|       |
 1973|  53.3k|  int last_filter_index = last_filter(filters, 'd');
 1974|  53.3k|  if (instr_codec) {
  ------------------
  |  Branch (1974:7): [True: 1.18k, False: 52.1k]
  ------------------
 1975|       |    // If instrumented, we don't want to run the filters
 1976|  1.18k|    _dest = dest + dest_offset;
 1977|  1.18k|  }
 1978|  52.1k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1978:13): [True: 50.7k, False: 1.35k]
  ------------------
 1979|  50.7k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1979:8): [True: 40.5k, False: 10.2k]
  ------------------
 1980|  40.5k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1980:5): [True: 0, False: 11.6k]
  ------------------
 1981|       |    // We are making use of some filter, so use a temp for destination
 1982|  40.5k|    _dest = tmp;
 1983|  40.5k|  }
 1984|  11.6k|  else {
 1985|       |    // If no filters, or only DELTA in pipeline
 1986|  11.6k|    _dest = dest + dest_offset;
 1987|  11.6k|  }
 1988|       |
 1989|       |  /* The number of compressed data streams for this block */
 1990|  53.3k|  if (vlblocks) {
  ------------------
  |  Branch (1990:7): [True: 0, False: 53.3k]
  ------------------
 1991|      0|    nstreams = 1;
 1992|      0|  }
 1993|  53.3k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1993:12): [True: 1.02k, False: 52.3k]
  |  Branch (1993:27): [True: 1.00k, False: 14]
  ------------------
 1994|  1.00k|    nstreams = context->typesize;
 1995|  1.00k|  }
 1996|  52.3k|  else {
 1997|  52.3k|    nstreams = 1;
 1998|  52.3k|  }
 1999|       |
 2000|  53.3k|  neblock = bsize / nstreams;
 2001|  53.3k|  if (neblock == 0) {
  ------------------
  |  Branch (2001:7): [True: 0, False: 53.3k]
  ------------------
 2002|       |    /* Not enough space to output bytes */
 2003|      0|    BLOSC_ERROR(BLOSC2_ERROR_WRITE_BUFFER);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2004|      0|  }
 2005|       |  /* The splits must cover the whole block, or part of tmp is left unwritten */
 2006|  53.3k|  if (neblock * nstreams != bsize) {
  ------------------
  |  Branch (2006:7): [True: 4, False: 53.3k]
  ------------------
 2007|      4|    BLOSC_ERROR(BLOSC2_ERROR_DATA);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 2008|      4|  }
 2009|  98.8k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (2009:19): [True: 53.4k, False: 45.3k]
  ------------------
 2010|  53.4k|    if (vlblocks) {
  ------------------
  |  Branch (2010:9): [True: 0, False: 53.4k]
  ------------------
 2011|      0|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2011:11): [True: 0, False: 0]
  ------------------
 2012|       |        /* Not enough input to read compressed bytes */
 2013|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2014|      0|      }
 2015|      0|      neblock = sw32_(src);
 2016|      0|      if (neblock != bsize) {
  ------------------
  |  Branch (2016:11): [True: 0, False: 0]
  ------------------
 2017|      0|        return BLOSC2_ERROR_DATA;
 2018|      0|      }
 2019|      0|      src += sizeof(int32_t);
 2020|      0|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 2021|      0|      srcsize = 0;
 2022|      0|    }
 2023|  53.4k|    else {
 2024|  53.4k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2024:11): [True: 0, False: 53.4k]
  ------------------
 2025|       |        /* Not enough input to read compressed size */
 2026|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2027|      0|      }
 2028|  53.4k|      srcsize -= sizeof(int32_t);
 2029|  53.4k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2030|  53.4k|      if (cbytes > 0) {
  ------------------
  |  Branch (2030:11): [True: 8.41k, False: 45.0k]
  ------------------
 2031|  8.41k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2031:13): [True: 6, False: 8.40k]
  ------------------
 2032|       |          /* Not enough input to read compressed bytes */
 2033|      6|          return BLOSC2_ERROR_READ_BUFFER;
 2034|      6|        }
 2035|  8.40k|        srcsize -= cbytes;
 2036|  8.40k|      }
 2037|  53.4k|      src += sizeof(int32_t);
 2038|  53.4k|    }
 2039|       |    // ctbytes += (signed)sizeof(int32_t);
 2040|       |
 2041|       |    /* Uncompress */
 2042|  53.4k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2042:9): [True: 53.4k, False: 0]
  |  Branch (2042:22): [True: 25.1k, False: 28.3k]
  ------------------
 2043|       |      // A run of 0's
 2044|  25.1k|      memset(_dest, 0, (unsigned int)neblock);
 2045|  25.1k|      nbytes = neblock;
 2046|  25.1k|    }
 2047|  28.3k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2047:14): [True: 28.3k, False: 0]
  |  Branch (2047:27): [True: 19.9k, False: 8.40k]
  ------------------
 2048|       |      // A negative number means some encoding depending on the token that comes next
 2049|  19.9k|      uint8_t token;
 2050|       |
 2051|  19.9k|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2051:11): [True: 0, False: 19.9k]
  ------------------
 2052|       |        // Not enough input to read token */
 2053|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2054|      0|      }
 2055|  19.9k|      srcsize -= sizeof(uint8_t);
 2056|       |
 2057|  19.9k|      token = src[0];
 2058|  19.9k|      src += 1;
 2059|       |      // ctbytes += 1;
 2060|       |
 2061|  19.9k|      if (token & 0x1) {
  ------------------
  |  Branch (2061:11): [True: 19.9k, False: 4]
  ------------------
 2062|       |        // A run of bytes that are different than 0
 2063|  19.9k|        if (cbytes < -255) {
  ------------------
  |  Branch (2063:13): [True: 4, False: 19.8k]
  ------------------
 2064|       |          // Runs can only encode a byte
 2065|      4|          return BLOSC2_ERROR_RUN_LENGTH;
 2066|      4|        }
 2067|  19.8k|        uint8_t value = -cbytes;
 2068|  19.8k|        memset(_dest, value, (unsigned int)neblock);
 2069|  19.8k|      } else {
 2070|      4|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2071|      4|        return BLOSC2_ERROR_RUN_LENGTH;
 2072|      4|      }
 2073|  19.8k|      nbytes = neblock;
 2074|  19.8k|      cbytes = 0;  // everything is encoded in the cbytes token
 2075|  19.8k|    }
 2076|  8.40k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2076:14): [True: 98, False: 8.30k]
  ------------------
 2077|     98|      memcpy(_dest, src, (unsigned int)neblock);
 2078|     98|      nbytes = (int32_t)neblock;
 2079|     98|    }
 2080|  8.30k|    else {
 2081|  8.30k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2081:11): [True: 221, False: 8.08k]
  ------------------
 2082|    221|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2083|    221|      }
 2084|  8.08k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2084:16): [True: 645, False: 7.44k]
  ------------------
 2085|    645|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2086|    645|                                     (char*)_dest, (size_t)neblock,
 2087|    645|                                     thread_context);
 2088|    645|      }
 2089|  7.44k|  #if defined(HAVE_ZLIB)
 2090|  7.44k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2090:16): [True: 661, False: 6.77k]
  ------------------
 2091|    661|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2092|    661|                                      (char*)_dest, (size_t)neblock);
 2093|    661|      }
 2094|  6.77k|  #endif /*  HAVE_ZLIB */
 2095|  6.77k|  #if defined(HAVE_ZSTD)
 2096|  6.77k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2096:16): [True: 6.29k, False: 485]
  ------------------
 2097|  6.29k|        nbytes = zstd_wrap_decompress(thread_context,
 2098|  6.29k|                                      (char*)src, (size_t)cbytes,
 2099|  6.29k|                                      (char*)_dest, (size_t)neblock);
 2100|  6.29k|      }
 2101|    485|  #endif /*  HAVE_ZSTD */
 2102|    485|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2102:16): [True: 485, False: 0]
  ------------------
 2103|    485|        bool getcell = false;
 2104|       |
 2105|    485|#if defined(HAVE_ZFP)
 2106|    485|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2106:13): [True: 1, False: 484]
  ------------------
 2107|      1|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2107:13): [True: 0, False: 1]
  ------------------
 2108|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2109|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2109:15): [True: 0, False: 0]
  ------------------
 2110|      0|            return BLOSC2_ERROR_DATA;
 2111|      0|          }
 2112|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2112:15): [True: 0, False: 0]
  ------------------
 2113|      0|            getcell = true;
 2114|      0|          }
 2115|      0|        }
 2116|    485|#endif /* HAVE_ZFP */
 2117|    485|        if (!getcell) {
  ------------------
  |  Branch (2117:13): [True: 485, False: 0]
  ------------------
 2118|    485|          thread_context->zfp_cell_nitems = 0;
 2119|    563|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2119:27): [True: 557, False: 6]
  ------------------
 2120|    557|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2120:17): [True: 479, False: 78]
  ------------------
 2121|    479|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2121:19): [True: 3, False: 476]
  ------------------
 2122|       |                // Dynamically load codec plugin
 2123|      3|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2123:21): [True: 3, False: 0]
  ------------------
 2124|      3|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2125|      3|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2126|      3|                }
 2127|      3|              }
 2128|    476|              blosc2_dparams dparams;
 2129|    476|              blosc2_ctx_get_dparams(context, &dparams);
 2130|    476|              nbytes = g_codecs[i].decoder(src,
 2131|    476|                                           cbytes,
 2132|    476|                                           _dest,
 2133|    476|                                           neblock,
 2134|    476|                                           context->compcode_meta,
 2135|    476|                                           &dparams,
 2136|    476|                                           context->src);
 2137|    476|              goto urcodecsuccess;
 2138|    479|            }
 2139|    557|          }
 2140|      6|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2141|      6|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2142|    485|        }
 2143|    476|      urcodecsuccess:
 2144|    476|        ;
 2145|    476|      }
 2146|      0|      else {
 2147|      0|        compname = clibcode_to_clibname(compformat);
 2148|      0|        BLOSC_TRACE_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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2149|      0|                "Blosc has not been compiled with decompression "
 2150|      0|                "support for '%s' format.  "
 2151|      0|                "Please recompile for adding this support.", compname);
 2152|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2153|      0|      }
 2154|       |
 2155|       |      /* Check that decompressed bytes number is correct */
 2156|  8.29k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2156:11): [True: 7.91k, False: 381]
  |  Branch (2156:34): [True: 7.91k, False: 0]
  ------------------
 2157|  7.91k|        return BLOSC2_ERROR_DATA;
 2158|  7.91k|      }
 2159|       |
 2160|  8.29k|    }
 2161|  45.5k|    src += cbytes;
 2162|       |    // ctbytes += cbytes;
 2163|  45.5k|    _dest += nbytes;
 2164|  45.5k|    ntbytes += nbytes;
 2165|  45.5k|  } /* Closes j < nstreams */
 2166|       |
 2167|  45.3k|  if (!instr_codec) {
  ------------------
  |  Branch (2167:7): [True: 45.3k, False: 25]
  ------------------
 2168|  45.3k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2168:9): [True: 44.1k, False: 1.21k]
  |  Branch (2168:35): [True: 0, False: 1.21k]
  ------------------
 2169|       |      /* Apply regular filter pipeline */
 2170|  44.1k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2171|  44.1k|                                      last_filter_index, nblock);
 2172|  44.1k|      if (errcode < 0)
  ------------------
  |  Branch (2172:11): [True: 16, False: 44.1k]
  ------------------
 2173|     16|        return errcode;
 2174|  44.1k|    }
 2175|  45.3k|  }
 2176|       |
 2177|       |  /* Return the number of uncompressed bytes */
 2178|  45.3k|  return (int)ntbytes;
 2179|  45.3k|}
blosc2.c:lz4_wrap_decompress:
  486|    645|                               struct thread_context* thread_context) {
  487|    645|  int nbytes;
  488|    645|  blosc2_context* context = thread_context->parent_context;
  489|    645|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (489:7): [True: 318, False: 327]
  |  Branch (489:28): [True: 318, False: 0]
  |  Branch (489:60): [True: 318, False: 0]
  ------------------
  490|    318|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  491|    318|                                           (int)compressed_length, (int)maxout,
  492|    318|                                           (const char*)context->dict_buffer,
  493|    318|                                           (int)context->dict_size);
  494|    327|  } else {
  495|    327|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  496|    327|  }
  497|    645|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (497:7): [True: 527, False: 118]
  ------------------
  498|    527|    return 0;
  499|    527|  }
  500|    118|  return (int)maxout;
  501|    645|}
blosc2.c:zlib_wrap_decompress:
  525|    661|                                char* output, size_t maxout) {
  526|    661|  int status;
  527|    661|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  528|    661|  size_t ul = maxout;
  529|    661|  status = zng_uncompress(
  530|    661|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  531|       |#else
  532|       |  uLongf ul = (uLongf)maxout;
  533|       |  status = uncompress(
  534|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  535|       |#endif
  536|    661|  if (status != Z_OK) {
  ------------------
  |  |  180|    661|#define Z_OK            0
  ------------------
  |  Branch (536:7): [True: 591, False: 70]
  ------------------
  537|    591|    return 0;
  538|    591|  }
  539|     70|  return (int)ul;
  540|    661|}
blosc2.c:zstd_wrap_decompress:
  577|  6.29k|                                char* output, size_t maxout) {
  578|  6.29k|  size_t code;
  579|  6.29k|  blosc2_context* context = thread_context->parent_context;
  580|       |
  581|  6.29k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (581:7): [True: 6.22k, False: 66]
  ------------------
  582|  6.22k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  583|  6.22k|  }
  584|       |
  585|  6.29k|  if (context->use_dict) {
  ------------------
  |  Branch (585:7): [True: 2.65k, False: 3.64k]
  ------------------
  586|  2.65k|    assert(context->dict_ddict != NULL);
  587|  2.65k|    code = ZSTD_decompress_usingDDict(
  588|  2.65k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  589|  2.65k|            compressed_length, context->dict_ddict);
  590|  3.64k|  } else {
  591|  3.64k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  592|  3.64k|        (void*)output, maxout, (void*)input, compressed_length);
  593|  3.64k|  }
  594|  6.29k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (594:7): [True: 6.13k, False: 159]
  ------------------
  595|  6.13k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  6.13k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  6.13k|    do {                                            \
  |  |  |  |   98|  6.13k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  6.13k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6.13k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  6.13k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|  6.13k|                      ZDICT_getErrorName(code));
  597|  6.13k|    return 0;
  598|  6.13k|  }
  599|    159|  return (int)code;
  600|  6.29k|}
blosc2.c:set_values:
 1664|      9|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 1665|       |#if defined(BLOSC_STRICT_ALIGN)
 1666|       |  if (destsize % typesize != 0) {
 1667|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 1668|       |  }
 1669|       |  int32_t nitems = destsize / typesize;
 1670|       |  if (nitems == 0) {
 1671|       |    return 0;
 1672|       |  }
 1673|       |  for (int i = 0; i < nitems; i++) {
 1674|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1675|       |  }
 1676|       |#else
 1677|      9|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1677:7): [True: 0, False: 9]
  ------------------
 1678|      0|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1679|      0|  }
 1680|      9|  int32_t nitems = destsize / typesize;
 1681|      9|  if (nitems == 0) {
  ------------------
  |  Branch (1681:7): [True: 0, False: 9]
  ------------------
 1682|      0|    return 0;
 1683|      0|  }
 1684|       |
 1685|      9|  switch (typesize) {
 1686|      0|    case 8: {
  ------------------
  |  Branch (1686:5): [True: 0, False: 9]
  ------------------
 1687|      0|      int64_t val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1688|      0|      int64_t* dest8 = (int64_t*)dest;
 1689|      0|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1689:23): [True: 0, False: 0]
  ------------------
 1690|      0|        dest8[i] = val8;
 1691|      0|      }
 1692|      0|      break;
 1693|      0|    }
 1694|      9|    case 4: {
  ------------------
  |  Branch (1694:5): [True: 9, False: 0]
  ------------------
 1695|      9|      int32_t val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1696|      9|      int32_t* dest4 = (int32_t*)dest;
 1697|   450k|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1697:23): [True: 450k, False: 9]
  ------------------
 1698|   450k|        dest4[i] = val4;
 1699|   450k|      }
 1700|      9|      break;
 1701|      0|    }
 1702|      0|    case 2: {
  ------------------
  |  Branch (1702:5): [True: 0, False: 9]
  ------------------
 1703|      0|      int16_t val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1704|      0|      int16_t* dest2 = (int16_t*)dest;
 1705|      0|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1705:23): [True: 0, False: 0]
  ------------------
 1706|      0|        dest2[i] = val2;
 1707|      0|      }
 1708|      0|      break;
 1709|      0|    }
 1710|      0|    case 1: {
  ------------------
  |  Branch (1710:5): [True: 0, False: 9]
  ------------------
 1711|      0|      int8_t val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1712|      0|      int8_t* dest1 = (int8_t*)dest;
 1713|      0|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1713:23): [True: 0, False: 0]
  ------------------
 1714|      0|        dest1[i] = val1;
 1715|      0|      }
 1716|      0|      break;
 1717|      0|    }
 1718|      0|    default:
  ------------------
  |  Branch (1718:5): [True: 0, False: 9]
  ------------------
 1719|      0|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1719:23): [True: 0, False: 0]
  ------------------
 1720|      0|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1721|      0|      }
 1722|      9|  }
 1723|      9|#endif
 1724|       |
 1725|      9|  return nitems;
 1726|      9|}
blosc2.c:set_nans:
 1632|  21.7k|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1633|  21.7k|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1633:7): [True: 1, False: 21.7k]
  ------------------
 1634|      1|    BLOSC_TRACE_ERROR("destsize can only be a multiple of typesize");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1635|      1|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      1|    do {                                            \
  |  |  112|      1|        int rc_ = (rc);                             \
  |  |  113|      1|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  114|      1|            char *error_msg = print_error(rc_);     \
  |  |  115|      1|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      1|            return rc_;                             \
  |  |  117|      1|        }                                           \
  |  |  118|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1636|      1|  }
 1637|  21.7k|  int32_t nitems = destsize / typesize;
 1638|  21.7k|  if (nitems == 0) {
  ------------------
  |  Branch (1638:7): [True: 0, False: 21.7k]
  ------------------
 1639|      0|    return 0;
 1640|      0|  }
 1641|       |
 1642|  21.7k|  if (typesize == 4) {
  ------------------
  |  Branch (1642:7): [True: 21.7k, False: 15]
  ------------------
 1643|  21.7k|    float* dest_ = (float*)dest;
 1644|  21.7k|    float val = nanf("");
 1645|  2.28M|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1645:21): [True: 2.25M, False: 21.7k]
  ------------------
 1646|  2.25M|      dest_[i] = val;
 1647|  2.25M|    }
 1648|  21.7k|    return nitems;
 1649|  21.7k|  }
 1650|     15|  else if (typesize == 8) {
  ------------------
  |  Branch (1650:12): [True: 8, False: 7]
  ------------------
 1651|      8|    double* dest_ = (double*)dest;
 1652|      8|    double val = nan("");
 1653|  25.0k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1653:21): [True: 25.0k, False: 8]
  ------------------
 1654|  25.0k|      dest_[i] = val;
 1655|  25.0k|    }
 1656|      8|    return nitems;
 1657|      8|  }
 1658|       |
 1659|      7|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1660|      7|  return BLOSC2_ERROR_DATA;
 1661|  21.7k|}
blosc2.c:my_malloc:
  228|  90.1k|static uint8_t* my_malloc(size_t size) {
  229|  90.1k|  void* block = NULL;
  230|  90.1k|  int res = 0;
  231|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  232|  90.1k|  if (size == 0) {
  ------------------
  |  Branch (232:7): [True: 0, False: 90.1k]
  ------------------
  233|      0|    size = 1;
  234|      0|  }
  235|       |
  236|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  237|       |#if defined(_WIN32)
  238|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  239|       |  block = (void *)_aligned_malloc(size, 32);
  240|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  241|       |  /* Platform does have an implementation of posix_memalign */
  242|  90.1k|  res = posix_memalign(&block, 32, size);
  243|       |#else
  244|       |  block = malloc(size);
  245|       |#endif  /* _WIN32 */
  246|       |
  247|  90.1k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (247:7): [True: 0, False: 90.1k]
  |  Branch (247:24): [True: 0, False: 90.1k]
  ------------------
  248|      0|    BLOSC_TRACE_ERROR("Error allocating memory!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|      0|    return NULL;
  250|      0|  }
  251|       |
  252|  90.1k|  return (uint8_t*)block;
  253|  90.1k|}
blosc2.c:getitem_read_header:
 4759|  16.3k|static int getitem_read_header(const void* src, int32_t srcsize, blosc_header* header) {
 4760|  16.3k|  int result = read_chunk_header((uint8_t *) src, srcsize, true, header);
 4761|  16.3k|  if (result < 0) {
  ------------------
  |  Branch (4761:7): [True: 0, False: 16.3k]
  ------------------
 4762|      0|    return result;
 4763|      0|  }
 4764|  16.3k|  if (header->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (4764:7): [True: 0, False: 16.3k]
  ------------------
 4765|      0|    BLOSC_TRACE_ERROR("getitem is not supported for VL-block chunks.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4766|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4767|      0|  }
 4768|  16.3k|  return 0;
 4769|  16.3k|}
blosc2.c:getitem_with_header:
 4775|  16.3k|                               int start, int nitems, void* dest, int32_t destsize) {
 4776|       |  /* Minimally populate the context */
 4777|  16.3k|  context->src = src;
 4778|  16.3k|  context->srcsize = srcsize;
 4779|  16.3k|  context->dest = dest;
 4780|  16.3k|  context->destsize = destsize;
 4781|       |
 4782|  16.3k|  int result = blosc2_initialize_context_from_header(context, header);
 4783|  16.3k|  if (result < 0) {
  ------------------
  |  Branch (4783:7): [True: 0, False: 16.3k]
  ------------------
 4784|      0|    return result;
 4785|      0|  }
 4786|       |
 4787|  16.3k|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (4787:7): [True: 16.3k, False: 0]
  ------------------
 4788|  16.3k|    context->serial_context = create_thread_context(context, 0);
 4789|  16.3k|  }
 4790|  16.3k|  BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  16.3k|    do {                                            \
  |  |  105|  16.3k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 4791|       |  /* Call the actual getitem function */
 4792|  16.3k|  return _blosc_getitem(context, header, src, srcsize, start, nitems, dest, destsize);
 4793|  16.3k|}
blosc2.c:blosc2_initialize_context_from_header:
  847|  48.1k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  848|  48.1k|  context->header_flags = header->flags;
  849|  48.1k|  context->typesize = header->typesize;
  850|  48.1k|  context->sourcesize = header->nbytes;
  851|  48.1k|  context->header_blocksize = header->blocksize;
  852|  48.1k|  context->blocksize = header->blocksize;
  853|  48.1k|  context->blosc2_flags2 = header->blosc2_flags2;
  854|  48.1k|  context->blosc2_flags = header->blosc2_flags;
  855|  48.1k|  context->compcode = header->flags >> 5;
  856|  48.1k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (856:7): [True: 28.6k, False: 19.5k]
  ------------------
  857|  28.6k|    context->compcode = header->udcompcode;
  858|  28.6k|  }
  859|  48.1k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (859:7): [True: 34, False: 48.1k]
  ------------------
  860|     34|    context->nblocks = header->blocksize;
  861|     34|    context->leftover = 0;
  862|     34|    context->blocksize = 0;
  863|     34|  }
  864|  48.1k|  else {
  865|  48.1k|    blosc2_calculate_blocks(context);
  866|  48.1k|  }
  867|       |
  868|  48.1k|  bool is_lazy = false;
  869|  48.1k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (869:7): [True: 47.6k, False: 489]
  ------------------
  870|  47.6k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (870:7): [True: 47.4k, False: 282]
  ------------------
  871|       |    /* Extended header */
  872|  47.4k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  873|       |
  874|  47.4k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  875|  47.4k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  876|  47.4k|    context->compcode_meta = header->compcode_meta;
  877|       |
  878|  47.4k|    context->filter_flags = filters_to_flags(header->filters);
  879|  47.4k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  880|       |
  881|  47.4k|    is_lazy = (context->blosc2_flags & 0x08u);
  882|  47.4k|  }
  883|    771|  else {
  884|    771|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  885|    771|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  886|    771|    flags_to_filters(context->header_flags, context->filters);
  887|    771|  }
  888|       |
  889|       |  // Some checks for malformed headers
  890|  48.1k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (890:7): [True: 47.8k, False: 354]
  |  Branch (890:19): [True: 0, False: 47.8k]
  ------------------
  891|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  892|      0|  }
  893|       |
  894|  48.1k|  return 0;
  895|  48.1k|}
blosc2.c:get_filter_flags:
  687|    771|                                const int32_t typesize) {
  688|    771|  uint8_t flags = 0;
  689|       |
  690|    771|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (690:7): [True: 282, False: 489]
  |  Branch (690:43): [True: 196, False: 86]
  ------------------
  691|    196|    flags |= BLOSC_DOSHUFFLE;
  692|    196|  }
  693|    771|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (693:7): [True: 138, False: 633]
  ------------------
  694|    138|    flags |= BLOSC_DOBITSHUFFLE;
  695|    138|  }
  696|    771|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (696:7): [True: 413, False: 358]
  ------------------
  697|    413|    flags |= BLOSC_DODELTA;
  698|    413|  }
  699|    771|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (699:7): [True: 22, False: 749]
  ------------------
  700|     22|    flags |= BLOSC_MEMCPYED;
  701|     22|  }
  702|    771|  return flags;
  703|    771|}
blosc2.c:clear_context_decompression_dict:
 2601|  31.8k|static void clear_context_decompression_dict(blosc2_context* context) {
 2602|  31.8k|  context->use_dict = 0;
 2603|  31.8k|  release_context_dict_buffer(context);
 2604|  31.8k|#if defined(HAVE_ZSTD)
 2605|  31.8k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2605:7): [True: 512, False: 31.3k]
  ------------------
 2606|    512|    ZSTD_freeDDict(context->dict_ddict);
 2607|    512|    context->dict_ddict = NULL;
 2608|    512|  }
 2609|       |#else
 2610|       |  context->dict_ddict = NULL;
 2611|       |#endif
 2612|  31.8k|}
blosc2.c:check_nthreads:
 2322|  31.3k|static int check_nthreads(blosc2_context* context, bool start_backend) {
 2323|  31.3k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2323:7): [True: 7.39k, False: 23.9k]
  |  Branch (2323:53): [True: 7.39k, False: 0]
  ------------------
 2324|  7.39k|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|  7.39k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  7.39k|    do {                                            \
  |  |  |  |   98|  7.39k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  7.39k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7.39k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  7.39k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2324|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2325|  7.39k|    return BLOSC2_ERROR_INVALID_PARAM;
 2326|  7.39k|  }
 2327|  23.9k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2327:7): [True: 0, False: 23.9k]
  ------------------
 2328|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2328|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2329|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2330|      0|  }
 2331|       |
 2332|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2333|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2334|       |   * clear it so the re-attach logic below creates a fresh one. */
 2335|  23.9k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|  47.8k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2335:7): [True: 0, False: 23.9k]
  ------------------
 2336|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2336:7): [True: 0, False: 0]
  ------------------
 2337|      0|    context->thread_pool = NULL;
 2338|      0|    context->threads_started = 0;
 2339|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2340|      0|  }
 2341|       |
 2342|  23.9k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2342:7): [True: 0, False: 23.9k]
  ------------------
 2343|      0|    release_thread_backend(context);
 2344|      0|    context->nthreads = context->new_nthreads;
 2345|      0|  }
 2346|  23.9k|  if (start_backend && context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2346:7): [True: 0, False: 23.9k]
  |  Branch (2346:24): [True: 0, False: 0]
  |  Branch (2346:49): [True: 0, False: 0]
  ------------------
 2347|      0|    int rc;
 2348|      0|    if (threads_callback) {
  ------------------
  |  Branch (2348:9): [True: 0, False: 0]
  ------------------
 2349|      0|      rc = init_callback_threads(context);
 2350|      0|    }
 2351|      0|    else {
 2352|       |#if defined(_WIN32)
 2353|       |      rc = init_threadpool(context);
 2354|       |#else
 2355|      0|      rc = attach_shared_pool(context);
 2356|      0|#endif
 2357|      0|    }
 2358|      0|    if (rc < 0) {
  ------------------
  |  Branch (2358:9): [True: 0, False: 0]
  ------------------
 2359|      0|      return rc;
 2360|      0|    }
 2361|      0|  }
 2362|  23.9k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2362:7): [True: 23.9k, False: 0]
  ------------------
 2363|  23.9k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  23.9k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2364|  23.9k|  }
 2365|       |
 2366|  23.9k|  return context->nthreads;
 2367|  23.9k|}
blosc2.c:release_thread_backend:
 5703|  38.9k|static int release_thread_backend(blosc2_context *context) {
 5704|  38.9k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|  77.8k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5704:7): [True: 0, False: 38.9k]
  |  Branch (5704:60): [True: 0, False: 0]
  ------------------
 5705|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5705:25): [True: 0, False: 0]
  ------------------
 5706|      0|      destroy_thread_context(context->thread_contexts + t);
 5707|      0|    }
 5708|      0|    my_free(context->thread_contexts);
 5709|      0|    context->thread_contexts = NULL;
 5710|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5711|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5712|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5713|      0|  }
 5714|       |#if defined(_WIN32)
 5715|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5716|       |    /* Signal all workers to exit. */
 5717|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5718|       |    context->end_threads = 1;
 5719|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5720|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5721|       |
 5722|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5723|       |      blosc2_pthread_join(context->threads[t], NULL);
 5724|       |    }
 5725|       |    my_free(context->threads);
 5726|       |    context->threads = NULL;
 5727|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5728|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5729|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5730|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5731|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5732|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5733|       |  }
 5734|       |#endif  /* _WIN32 */
 5735|  38.9k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|  77.8k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5735:12): [True: 0, False: 38.9k]
  |  Branch (5735:68): [True: 0, False: 0]
  ------------------
 5736|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5737|      0|    struct blosc_shared_pool **prev;
 5738|      0|    bool destroy_pool = false;
 5739|       |
 5740|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5740:9): [True: 0, False: 0]
  ------------------
 5741|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5742|       |       * Just clear the dangling pointer; nothing else to do. */
 5743|      0|      context->thread_pool = NULL;
 5744|      0|      context->threads_started = 0;
 5745|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5746|      0|      return 0;
 5747|      0|    }
 5748|       |
 5749|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5750|      0|    pool->context_refs--;
 5751|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5751:9): [True: 0, False: 0]
  ------------------
 5752|       |      /* Check pool-internal state under the pool's own mutex */
 5753|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5754|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5754:20): [True: 0, False: 0]
  |  Branch (5754:46): [True: 0, False: 0]
  ------------------
 5755|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5756|      0|      if (idle) {
  ------------------
  |  Branch (5756:11): [True: 0, False: 0]
  ------------------
 5757|      0|        prev = &shared_pools;
 5758|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5758:16): [True: 0, False: 0]
  |  Branch (5758:33): [True: 0, False: 0]
  ------------------
 5759|      0|          prev = &(*prev)->next;
 5760|      0|        }
 5761|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5761:13): [True: 0, False: 0]
  ------------------
 5762|      0|          *prev = pool->next;
 5763|      0|        }
 5764|      0|        destroy_pool = true;
 5765|      0|      }
 5766|      0|    }
 5767|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5768|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5768:9): [True: 0, False: 0]
  ------------------
 5769|      0|      destroy_shared_pool(pool);
 5770|      0|    }
 5771|      0|    context->thread_pool = NULL;
 5772|      0|  }
 5773|       |
 5774|  38.9k|  context->threads_started = 0;
 5775|  38.9k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  38.9k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5776|  38.9k|  return 0;
 5777|  38.9k|}
blosc2.c:release_context_dict_buffer:
 2591|  70.7k|static void release_context_dict_buffer(blosc2_context* context) {
 2592|  70.7k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2592:7): [True: 0, False: 70.7k]
  |  Branch (2592:37): [True: 0, False: 0]
  ------------------
 2593|      0|    free(context->dict_buffer);
 2594|      0|  }
 2595|  70.7k|  context->dict_buffer = NULL;
 2596|       |  context->dict_buffer_owned = false;
 2597|  70.7k|  context->dict_size = 0;
 2598|  70.7k|}

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

delta_decoder:
   97|  36.8k|                   int32_t typesize, uint8_t* dest) {
   98|  36.8k|  int32_t i;
   99|       |
  100|  36.8k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 19.2k, False: 17.6k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|  19.2k|    switch (typesize) {
  103|  3.68k|      case 1:
  ------------------
  |  Branch (103:7): [True: 3.68k, False: 15.5k]
  ------------------
  104|  5.19G|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 5.19G, False: 3.68k]
  ------------------
  105|  5.19G|          dest[i] ^= dref[i-1];
  106|  5.19G|        }
  107|  3.68k|        break;
  108|     69|      case 2:
  ------------------
  |  Branch (108:7): [True: 69, False: 19.1k]
  ------------------
  109|  1.07G|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 1.07G, False: 69]
  ------------------
  110|  1.07G|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|  1.07G|        }
  112|     69|        break;
  113|     69|      case 4:
  ------------------
  |  Branch (113:7): [True: 69, False: 19.1k]
  ------------------
  114|   347M|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 347M, False: 69]
  ------------------
  115|   347M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|   347M|        }
  117|     69|        break;
  118|  11.7k|      case 8:
  ------------------
  |  Branch (118:7): [True: 11.7k, False: 7.47k]
  ------------------
  119|   903M|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 903M, False: 11.7k]
  ------------------
  120|   903M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   903M|        }
  122|  11.7k|        break;
  123|  3.64k|      default:
  ------------------
  |  Branch (123:7): [True: 3.64k, False: 15.5k]
  ------------------
  124|  3.64k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 37, False: 3.61k]
  ------------------
  125|     37|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|  3.61k|        } else {
  127|  3.61k|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|  3.61k|        }
  129|  19.2k|    }
  130|  19.2k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  17.6k|    switch (typesize) {
  133|  2.93k|      case 1:
  ------------------
  |  Branch (133:7): [True: 2.93k, False: 14.7k]
  ------------------
  134|  3.58G|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 3.58G, False: 2.93k]
  ------------------
  135|  3.58G|          dest[i] ^= dref[i];
  136|  3.58G|        }
  137|  2.93k|        break;
  138|     49|      case 2:
  ------------------
  |  Branch (138:7): [True: 49, False: 17.5k]
  ------------------
  139|   302M|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 302M, False: 49]
  ------------------
  140|   302M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|   302M|        }
  142|     49|        break;
  143|     46|      case 4:
  ------------------
  |  Branch (143:7): [True: 46, False: 17.5k]
  ------------------
  144|   201M|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 201M, False: 46]
  ------------------
  145|   201M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   201M|        }
  147|     46|        break;
  148|  11.6k|      case 8:
  ------------------
  |  Branch (148:7): [True: 11.6k, False: 5.94k]
  ------------------
  149|   688M|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 688M, False: 11.6k]
  ------------------
  150|   688M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   688M|        }
  152|  11.6k|        break;
  153|  2.91k|      default:
  ------------------
  |  Branch (153:7): [True: 2.91k, False: 14.7k]
  ------------------
  154|  2.91k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 33, False: 2.88k]
  ------------------
  155|     33|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  2.88k|        } else {
  157|  2.88k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  2.88k|        }
  159|  17.6k|    }
  160|  17.6k|  }
  161|  36.8k|}

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

frame_reader_acquire:
  207|     13|void* frame_reader_acquire(blosc2_frame_s* frame, const blosc2_io* io) {
  208|     13|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
  209|     13|  if (io_cb == NULL) {
  ------------------
  |  Branch (209:7): [True: 0, False: 13]
  ------------------
  210|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|      0|    return NULL;
  212|      0|  }
  213|     13|  if (io->id != BLOSC2_IO_FILESYSTEM) {
  ------------------
  |  Branch (213:7): [True: 0, False: 13]
  ------------------
  214|       |    // Third-party backends keep the documented one-handle-per-reader contract
  215|       |    // (and the mmap one already makes open() a cheap pointer return).
  216|      0|    return io_cb->open(frame->urlpath, "rb", io->params);
  217|      0|  }
  218|       |#if defined(_WIN32)
  219|       |  // No handle caching on Windows.  The CRT opens files without
  220|       |  // FILE_SHARE_DELETE, so a cached handle turns every unlink or rename of the
  221|       |  // frame file into a sharing violation.  Callers that replace a frame rather
  222|       |  // than rewrite it in place -- python-blosc2 does, both via os.replace and via
  223|       |  // remove-then-recreate for mode="w" -- would get hard errors instead of the
  224|       |  // stale read that frame_reader_revalidate() handles elsewhere.  Caching here
  225|       |  // needs CreateFileW(..., FILE_SHARE_DELETE) plus POSIX-semantics deletion
  226|       |  // (Win10 1709+), which is only worth its cost once measured on Windows.
  227|       |  return io_cb->open(frame->urlpath, "rb", io->params);
  228|       |#else
  229|       |  // The cached handle pins the inode it was opened on, so a frame file that is
  230|       |  // replaced instead of rewritten in place would keep serving the old bytes.
  231|       |  // frame_reader_revalidate() catches that ahead of each header read.
  232|       |  //
  233|       |  // No unlocked fast path on read_fp: reading it outside the mutex races the
  234|       |  // store below (C11 data race, and TSan says so).  An uncontended lock is a
  235|       |  // handful of ns against the ~600 ns pread this hands a handle to.
  236|     13|  blosc2_pthread_mutex_lock(&frame->read_fp_mutex);
  ------------------
  |  |   92|     13|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  237|     13|  if (frame->read_fp == NULL && !frame->read_fp_nocache) {
  ------------------
  |  Branch (237:7): [True: 13, False: 0]
  |  Branch (237:33): [True: 13, False: 0]
  ------------------
  238|     13|    if (reader_cache_claim()) {
  ------------------
  |  Branch (238:9): [True: 13, False: 0]
  ------------------
  239|     13|      frame->read_fp = io_cb->open(frame->urlpath, "rb", io->params);
  240|     13|      if (frame->read_fp == NULL) {
  ------------------
  |  Branch (240:11): [True: 13, False: 0]
  ------------------
  241|     13|        reader_cache_return();
  242|     13|      }
  243|      0|      else {
  244|      0|        record_handle_identity(frame->read_fp, &frame->read_fp_dev, &frame->read_fp_ino);
  245|      0|      }
  246|     13|    }
  247|      0|    else {
  248|       |      // Remember that this frame goes uncached, so the process-wide cache mutex
  249|       |      // is asked once rather than on every read for the rest of its life
  250|      0|      frame->read_fp_nocache = true;
  251|      0|    }
  252|     13|  }
  253|     13|  void* fp = frame->read_fp;
  254|     13|  if (fp != NULL) {
  ------------------
  |  Branch (254:7): [True: 0, False: 13]
  ------------------
  255|       |    // Held until the matching release, so nothing can close it underneath a
  256|       |    // caller that keeps it across several reads (frame_to_schunk does)
  257|      0|    frame->read_fp_refs++;
  258|      0|  }
  259|     13|  blosc2_pthread_mutex_unlock(&frame->read_fp_mutex);
  ------------------
  |  |   93|     13|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  260|     13|  if (fp == NULL) {
  ------------------
  |  Branch (260:7): [True: 13, False: 0]
  ------------------
  261|       |    // Cache full (or the cached open failed): hand out a private handle, which
  262|       |    // the matching frame_reader_release() closes since it is not frame->read_fp
  263|     13|    fp = io_cb->open(frame->urlpath, "rb", io->params);
  264|     13|  }
  265|     13|  return fp;
  266|     13|#endif
  267|     13|}
frame_reader_invalidate:
  335|  9.02k|void frame_reader_invalidate(blosc2_frame_s* frame) {
  336|  9.02k|  blosc2_pthread_mutex_lock(&frame->read_fp_mutex);
  ------------------
  |  |   92|  9.02k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  337|  9.02k|  frame_writer_close_locked(frame);
  338|  9.02k|  frame_reader_close_locked(frame, true);
  339|  9.02k|  blosc2_pthread_mutex_unlock(&frame->read_fp_mutex);
  ------------------
  |  |   93|  9.02k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  340|  9.02k|}
frame_lock:
  649|  15.6k|int frame_lock(blosc2_frame_s* frame, bool exclusive) {
  650|  15.6k|  if (frame == NULL || !frame->locking) {
  ------------------
  |  Branch (650:7): [True: 0, False: 15.6k]
  |  Branch (650:24): [True: 15.6k, False: 0]
  ------------------
  651|  15.6k|    return BLOSC2_ERROR_SUCCESS;
  652|  15.6k|  }
  653|      0|  if (frame->lock_depth > 0) {
  ------------------
  |  Branch (653:7): [True: 0, False: 0]
  ------------------
  654|       |    // Already held by this handle (a nested call); the outer lock covers us
  655|      0|    frame->lock_depth++;
  656|      0|    return BLOSC2_ERROR_SUCCESS;
  657|      0|  }
  658|      0|  if (frame->lock_fd == -1) {
  ------------------
  |  Branch (658:7): [True: 0, False: 0]
  ------------------
  659|       |    // Lazily open the sidecar, kept for the frame's lifetime
  660|      0|    char* path = frame_lock_path(frame);
  661|      0|    if (path == NULL) {
  ------------------
  |  Branch (661:9): [True: 0, False: 0]
  ------------------
  662|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
  663|      0|    }
  664|       |#if defined(_WIN32)
  665|       |    HANDLE h = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
  666|       |                           FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
  667|       |                           NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
  668|       |    if (h == INVALID_HANDLE_VALUE) {
  669|       |      BLOSC_TRACE_ERROR("Cannot open the lock file in: %s", path);
  670|       |      free(path);
  671|       |      return BLOSC2_ERROR_LOCK;
  672|       |    }
  673|       |    frame->lock_fd = (intptr_t)h;
  674|       |#else
  675|      0|    int fd = open(path, O_CREAT | O_RDWR | O_CLOEXEC, 0666);
  676|      0|    if (fd < 0) {
  ------------------
  |  Branch (676:9): [True: 0, False: 0]
  ------------------
  677|      0|      BLOSC_TRACE_ERROR("Cannot open the lock file in: %s", path);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  678|      0|      free(path);
  679|      0|      return BLOSC2_ERROR_LOCK;
  680|      0|    }
  681|      0|    frame->lock_fd = fd;
  682|      0|#endif
  683|      0|    free(path);
  684|      0|  }
  685|      0|  if (frame_os_lock(frame, exclusive) < 0) {
  ------------------
  |  Branch (685:7): [True: 0, False: 0]
  ------------------
  686|      0|    BLOSC_TRACE_ERROR("Cannot lock the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  687|      0|    return BLOSC2_ERROR_LOCK;
  688|      0|  }
  689|       |  // Generation counter: writers bump it, everyone compares it with the last
  690|       |  // value it saw.  This detects mutations by other handles exactly, even when
  691|       |  // the frame length on disk ends up unchanged (which the length-based
  692|       |  // staleness check in frame_refresh_if_stale() cannot see).
  693|      0|  uint64_t seq;
  694|      0|  if (frame_lock_read_seq(frame, &seq) < 0 ||
  ------------------
  |  Branch (694:7): [True: 0, False: 0]
  ------------------
  695|      0|      (exclusive && frame_lock_write_seq(frame, seq + 1) < 0)) {
  ------------------
  |  Branch (695:8): [True: 0, False: 0]
  |  Branch (695:21): [True: 0, False: 0]
  ------------------
  696|      0|    BLOSC_TRACE_ERROR("Cannot access the frame lock generation counter.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  697|      0|    frame_os_unlock(frame);
  698|      0|    return BLOSC2_ERROR_LOCK;
  699|      0|  }
  700|      0|  if (seq != frame->lock_seq) {
  ------------------
  |  Branch (700:7): [True: 0, False: 0]
  ------------------
  701|      0|    frame->force_refresh = true;
  702|      0|  }
  703|      0|  if (exclusive) {
  ------------------
  |  Branch (703:7): [True: 0, False: 0]
  ------------------
  704|      0|    seq++;
  705|      0|  }
  706|      0|  frame->lock_seq = seq;
  707|      0|  frame->lock_depth = 1;
  708|      0|  return BLOSC2_ERROR_SUCCESS;
  709|      0|}
frame_unlock:
  712|  15.6k|int frame_unlock(blosc2_frame_s* frame) {
  713|  15.6k|  if (frame == NULL || !frame->locking || frame->lock_depth == 0) {
  ------------------
  |  Branch (713:7): [True: 0, False: 15.6k]
  |  Branch (713:24): [True: 15.6k, False: 0]
  |  Branch (713:43): [True: 0, False: 0]
  ------------------
  714|  15.6k|    return BLOSC2_ERROR_SUCCESS;
  715|  15.6k|  }
  716|      0|  if (--frame->lock_depth > 0) {
  ------------------
  |  Branch (716:7): [True: 0, False: 0]
  ------------------
  717|      0|    return BLOSC2_ERROR_SUCCESS;
  718|      0|  }
  719|       |  // Hand our writes over before the next lock holder looks: closing the cached
  720|       |  // writer is what pushes them to the server on NFS (close-to-open consistency).
  721|       |  // A no-op unless this handle wrote since it last let go of the lock.
  722|      0|  frame_writer_close(frame);
  723|      0|  if (frame_os_unlock(frame) < 0) {
  ------------------
  |  Branch (723:7): [True: 0, False: 0]
  ------------------
  724|      0|    BLOSC_TRACE_ERROR("Cannot unlock the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  725|      0|    return BLOSC2_ERROR_LOCK;
  726|      0|  }
  727|      0|  return BLOSC2_ERROR_SUCCESS;
  728|      0|}
frame_free:
  732|  9.02k|int frame_free(blosc2_frame_s* frame) {
  733|       |
  734|  9.02k|  frame_reader_invalidate(frame);
  735|  9.02k|  blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|  9.02k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
  736|       |
  737|  9.02k|  if (frame->locking && frame->lock_fd != -1) {
  ------------------
  |  Branch (737:7): [True: 0, False: 9.02k]
  |  Branch (737:25): [True: 0, False: 0]
  ------------------
  738|       |#if defined(_WIN32)
  739|       |    CloseHandle((HANDLE)frame->lock_fd);
  740|       |#else
  741|      0|    close((int)frame->lock_fd);
  742|      0|#endif
  743|      0|  }
  744|       |
  745|  9.02k|  if (frame->cframe != NULL && !frame->avoid_cframe_free) {
  ------------------
  |  Branch (745:7): [True: 9.02k, False: 0]
  |  Branch (745:32): [True: 0, False: 9.02k]
  ------------------
  746|      0|    free(frame->cframe);
  747|      0|  }
  748|       |
  749|  9.02k|  if (frame->coffsets != NULL && frame->coffsets_needs_free) {
  ------------------
  |  Branch (749:7): [True: 0, False: 9.02k]
  |  Branch (749:34): [True: 0, False: 0]
  ------------------
  750|      0|    free(frame->coffsets);
  751|      0|  }
  752|       |
  753|  9.02k|  if (frame->urlpath != NULL) {
  ------------------
  |  Branch (753:7): [True: 0, False: 9.02k]
  ------------------
  754|      0|    free(frame->urlpath);
  755|      0|  }
  756|       |
  757|  9.02k|  free(frame);
  758|       |
  759|  9.02k|  return 0;
  760|  9.02k|}
get_header_info:
 1084|  26.4k|                    uint8_t *splitmode, uint8_t *use_dict, const blosc2_io *io) {
 1085|  26.4k|  uint8_t* framep = frame->cframe;
 1086|  26.4k|  uint8_t* header_ptr;
 1087|  26.4k|  uint8_t header[FRAME_HEADER_MINLEN];
 1088|       |
 1089|  26.4k|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
 1090|  26.4k|  if (io_cb == NULL) {
  ------------------
  |  Branch (1090:7): [True: 0, False: 26.4k]
  ------------------
 1091|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1092|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 1093|      0|  }
 1094|       |
 1095|  26.4k|  if (frame->len <= 0) {
  ------------------
  |  Branch (1095:7): [True: 0, False: 26.4k]
  ------------------
 1096|      0|    return BLOSC2_ERROR_READ_BUFFER;
 1097|      0|  }
 1098|       |
 1099|  26.4k|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (1099:7): [True: 0, False: 26.4k]
  ------------------
 1100|      0|    int64_t rbytes = 0;
 1101|      0|    void* fp = NULL;
 1102|      0|    int64_t io_pos = 0;
 1103|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1103:9): [True: 0, False: 0]
  ------------------
 1104|      0|      fp = sframe_open_index(frame->urlpath, "rb", io);
 1105|      0|      if (fp == NULL) {
  ------------------
  |  Branch (1105:11): [True: 0, False: 0]
  ------------------
 1106|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1107|      0|        return BLOSC2_ERROR_FILE_OPEN;
 1108|      0|      }
 1109|      0|    }
 1110|      0|    else {
 1111|       |      /* Ahead of the header read, not after it: everything downstream (and
 1112|       |         frame_refresh_if_stale in particular) trusts the length this read
 1113|       |         returns, so a stale handle here would pair old metadata with the
 1114|       |         replacement's bytes. */
 1115|      0|      frame_reader_revalidate(frame);
 1116|      0|      fp = frame_reader_acquire(frame, io);
 1117|      0|      if (fp == NULL) {
  ------------------
  |  Branch (1117:11): [True: 0, False: 0]
  ------------------
 1118|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1119|      0|        return BLOSC2_ERROR_FILE_OPEN;
 1120|      0|      }
 1121|      0|      io_pos = frame->file_offset;
 1122|      0|    }
 1123|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (1123:9): [True: 0, False: 0]
  ------------------
 1124|      0|      header_ptr = header;
 1125|      0|    rbytes = io_cb->read((void**)&header_ptr, 1, FRAME_HEADER_MINLEN, io_pos, fp);
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1126|      0|    frame_reader_release(frame, io_cb, fp);
 1127|      0|    if (rbytes != FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1127:9): [True: 0, False: 0]
  ------------------
 1128|      0|      return BLOSC2_ERROR_FILE_READ;
 1129|      0|    }
 1130|      0|    framep = header_ptr;
 1131|      0|  }
 1132|       |
 1133|       |  // Consistency check for frame type
 1134|  26.4k|  uint8_t frame_type = framep[FRAME_TYPE];
  ------------------
  |  |   33|  26.4k|#define FRAME_TYPE (FRAME_FLAGS + 1)  // 26
  |  |  ------------------
  |  |  |  |   32|  26.4k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  26.4k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  26.4k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  26.4k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1135|  26.4k|  uint8_t frame_version = framep[FRAME_FLAGS] & 0x0fu;
  ------------------
  |  |   32|  26.4k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  ------------------
  |  |  |  |   31|  26.4k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  26.4k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   29|  26.4k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1136|  26.4k|  if (frame_version > BLOSC2_VERSION_FRAME_FORMAT) {
  ------------------
  |  Branch (1136:7): [True: 0, False: 26.4k]
  ------------------
 1137|      0|    BLOSC_TRACE_ERROR("Unsupported cframe version: %u", frame_version);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1138|      0|    return BLOSC2_ERROR_VERSION_SUPPORT;
 1139|      0|  }
 1140|  26.4k|  if (frame->sframe) {
  ------------------
  |  Branch (1140:7): [True: 0, False: 26.4k]
  ------------------
 1141|      0|    if (frame_type != FRAME_DIRECTORY_TYPE) {
  ------------------
  |  |   22|      0|#define FRAME_DIRECTORY_TYPE 1
  ------------------
  |  Branch (1141:9): [True: 0, False: 0]
  ------------------
 1142|      0|      return BLOSC2_ERROR_FRAME_TYPE;
 1143|      0|    }
 1144|  26.4k|  } else {
 1145|  26.4k|    if (frame_type != FRAME_CONTIGUOUS_TYPE) {
  ------------------
  |  |   21|  26.4k|#define FRAME_CONTIGUOUS_TYPE 0
  ------------------
  |  Branch (1145:9): [True: 0, False: 26.4k]
  ------------------
 1146|      0|      return BLOSC2_ERROR_FRAME_TYPE;
 1147|      0|    }
 1148|  26.4k|  }
 1149|       |
 1150|       |  // Fetch some internal lengths
 1151|  26.4k|  from_big(header_len, framep + FRAME_HEADER_LEN, sizeof(*header_len));
  ------------------
  |  |   38|  26.4k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1152|  26.4k|  if (*header_len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  26.4k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  26.4k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  26.4k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  26.4k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  26.4k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  26.4k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  26.4k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  26.4k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  26.4k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  26.4k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  26.4k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  26.4k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  26.4k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  26.4k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1152:7): [True: 1, False: 26.4k]
  ------------------
 1153|      1|    BLOSC_TRACE_ERROR("Header length is zero or smaller than min allowed.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1154|      1|    return BLOSC2_ERROR_INVALID_HEADER;
 1155|      1|  }
 1156|  26.4k|  from_big(frame_len, framep + FRAME_LEN, sizeof(*frame_len));
  ------------------
  |  |   38|  26.4k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1157|  26.4k|  if (*header_len > *frame_len) {
  ------------------
  |  Branch (1157:7): [True: 1, False: 26.4k]
  ------------------
 1158|      1|    BLOSC_TRACE_ERROR("Header length exceeds length of the frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1159|      1|    return BLOSC2_ERROR_INVALID_HEADER;
 1160|      1|  }
 1161|  26.4k|  from_big(nbytes, framep + FRAME_NBYTES, sizeof(*nbytes));
  ------------------
  |  |   38|  26.4k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1162|  26.4k|  from_big(cbytes, framep + FRAME_CBYTES, sizeof(*cbytes));
  ------------------
  |  |   38|  26.4k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1163|  26.4k|  from_big(blocksize, framep + FRAME_BLOCKSIZE, sizeof(*blocksize));
  ------------------
  |  |   38|  26.4k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1164|  26.4k|  if (chunksize != NULL) {
  ------------------
  |  Branch (1164:7): [True: 26.4k, False: 0]
  ------------------
 1165|  26.4k|    from_big(chunksize, framep + FRAME_CHUNKSIZE, sizeof(*chunksize));
  ------------------
  |  |   38|  26.4k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1166|  26.4k|  }
 1167|  26.4k|  if (typesize != NULL) {
  ------------------
  |  Branch (1167:7): [True: 25.3k, False: 1.07k]
  ------------------
 1168|  25.3k|    from_big(typesize, framep + FRAME_TYPESIZE, sizeof(*typesize));
  ------------------
  |  |   38|  25.3k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1169|  25.3k|    if (*typesize <= 0) {
  ------------------
  |  Branch (1169:9): [True: 3, False: 25.3k]
  ------------------
 1170|      3|      BLOSC_TRACE_ERROR("`typesize` cannot be zero or negative.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1171|      3|      return BLOSC2_ERROR_INVALID_HEADER;
 1172|      3|    }
 1173|  25.3k|  }
 1174|       |
 1175|       |  // Codecs
 1176|  26.4k|  uint8_t frame_codecs = framep[FRAME_CODECS];
  ------------------
  |  |   34|  26.4k|#define FRAME_CODECS (FRAME_FLAGS + 2)  // 27
  |  |  ------------------
  |  |  |  |   32|  26.4k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  26.4k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  26.4k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  26.4k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1177|  26.4k|  if (clevel != NULL) {
  ------------------
  |  Branch (1177:7): [True: 9.01k, False: 17.4k]
  ------------------
 1178|  9.01k|    *clevel = frame_codecs >> 4u;
 1179|  9.01k|  }
 1180|  26.4k|  if (compcode != NULL) {
  ------------------
  |  Branch (1180:7): [True: 9.01k, False: 17.4k]
  ------------------
 1181|  9.01k|    *compcode = frame_codecs & 0xFu;
 1182|  9.01k|    if (*compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (1182:9): [True: 128, False: 8.88k]
  ------------------
 1183|    128|      from_big(compcode, framep + FRAME_UDCODEC, sizeof(*compcode));
  ------------------
  |  |   38|    128|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1184|    128|    }
 1185|  9.01k|  }
 1186|       |
 1187|       |  // Other flags
 1188|  26.4k|  uint8_t other_flags = framep[FRAME_OTHER_FLAGS];
  ------------------
  |  |   35|  26.4k|#define FRAME_OTHER_FLAGS (FRAME_FLAGS + 3)  // 28
  |  |  ------------------
  |  |  |  |   32|  26.4k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  26.4k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  26.4k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  26.4k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1189|  26.4k|  if (splitmode != NULL) {
  ------------------
  |  Branch (1189:7): [True: 9.01k, False: 17.4k]
  ------------------
 1190|  9.01k|    *splitmode = (other_flags & 0x03u) + 1;
 1191|  9.01k|  }
 1192|       |
 1193|       |  // Other flags 2: bit 0 = use_dict
 1194|  26.4k|  if (use_dict != NULL) {
  ------------------
  |  Branch (1194:7): [True: 9.01k, False: 17.4k]
  ------------------
 1195|  9.01k|    *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   47|  9.01k|#define FRAME_OTHER_FLAGS2 (FRAME_FILTER_PIPELINE + 1 + 14)  // 85
  |  |  ------------------
  |  |  |  |   44|  9.01k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  9.01k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  9.01k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  9.01k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  9.01k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  9.01k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  9.01k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  9.01k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  9.01k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  9.01k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  9.01k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  9.01k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  9.01k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   48|  9.01k|#define FRAME_USE_DICT (1U << 0)   //!< bit 0 of other_flags2: use dictionary compression
  ------------------
  |  Branch (1195:17): [True: 3.39k, False: 5.62k]
  ------------------
 1196|  9.01k|  }
 1197|       |
 1198|  26.4k|  if (compcode_meta != NULL) {
  ------------------
  |  Branch (1198:7): [True: 9.01k, False: 17.4k]
  ------------------
 1199|  9.01k|    from_big(compcode_meta, framep + FRAME_CODEC_META, sizeof(*compcode_meta));
  ------------------
  |  |   38|  9.01k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1200|  9.01k|  }
 1201|       |
 1202|       |  // Filters
 1203|  26.4k|  if (filters != NULL && filters_meta != NULL) {
  ------------------
  |  Branch (1203:7): [True: 9.01k, False: 17.4k]
  |  Branch (1203:26): [True: 9.01k, False: 0]
  ------------------
 1204|  9.01k|    uint8_t nfilters = framep[FRAME_FILTER_PIPELINE];
  ------------------
  |  |   44|  9.01k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  9.01k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  9.01k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  9.01k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  9.01k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  9.01k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  9.01k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  9.01k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  9.01k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  9.01k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  9.01k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  9.01k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  9.01k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1205|  9.01k|    if (nfilters > BLOSC2_MAX_FILTERS) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 9.01k]
  ------------------
 1206|      0|      BLOSC_TRACE_ERROR("The number of filters in frame header are too large for Blosc2.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1207|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1208|      0|    }
 1209|  9.01k|    uint8_t *filters_ = framep + FRAME_FILTER_PIPELINE + 1;
  ------------------
  |  |   44|  9.01k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  9.01k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  9.01k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  9.01k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  9.01k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  9.01k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  9.01k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  9.01k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  9.01k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  9.01k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  9.01k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  9.01k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  9.01k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1210|  9.01k|    uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   44|  9.01k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  9.01k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  9.01k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  9.01k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  9.01k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  9.01k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  9.01k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  9.01k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  9.01k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  9.01k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  9.01k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  9.01k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  9.01k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   53|  9.01k|#define FRAME_FILTER_PIPELINE_MAX (8)  // the maximum number of filters that can be stored in header
  ------------------
 1211|  17.9k|    for (int i = 0; i < nfilters; i++) {
  ------------------
  |  Branch (1211:21): [True: 8.97k, False: 9.01k]
  ------------------
 1212|  8.97k|      filters[i] = filters_[i];
 1213|  8.97k|      filters_meta[i] = filters_meta_[i];
 1214|  8.97k|    }
 1215|  9.01k|  }
 1216|       |
 1217|  26.4k|  if (*nbytes > 0) {
  ------------------
  |  Branch (1217:7): [True: 26.3k, False: 51]
  ------------------
 1218|  26.3k|    if (*chunksize > 0) {
  ------------------
  |  Branch (1218:9): [True: 21.7k, False: 4.65k]
  ------------------
 1219|       |      // We can compute the number of chunks directly when there is a fixed chunk size.
 1220|  21.7k|      *nchunks = *nbytes / *chunksize;
 1221|  21.7k|      if (*nbytes % *chunksize > 0) {
  ------------------
  |  Branch (1221:11): [True: 18.7k, False: 2.98k]
  ------------------
 1222|  18.7k|        *nchunks += 1;
 1223|  18.7k|      }
 1224|       |
 1225|       |      // Sanity check for compressed sizes
 1226|  21.7k|      if ((*cbytes < 0) || ((int64_t)*nchunks * *chunksize < *nbytes)) {
  ------------------
  |  Branch (1226:11): [True: 0, False: 21.7k]
  |  Branch (1226:28): [True: 0, False: 21.7k]
  ------------------
 1227|      0|        BLOSC_TRACE_ERROR("Invalid compressed size in frame 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1228|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1229|      0|      }
 1230|  21.7k|    }
 1231|  4.65k|    else if (*chunksize == 0) {
  ------------------
  |  Branch (1231:14): [True: 4.65k, False: 0]
  ------------------
 1232|  4.65k|      int32_t coffsets_nbytes;
 1233|  4.65k|      int rc2 = get_coffsets_nbytes(frame, *header_len, *cbytes, &coffsets_nbytes, io);
 1234|  4.65k|      if (rc2 < 0) {
  ------------------
  |  Branch (1234:11): [True: 11, False: 4.64k]
  ------------------
 1235|     11|        return rc2;
 1236|     11|      }
 1237|  4.64k|      if (coffsets_nbytes < 0 || coffsets_nbytes % (int32_t)sizeof(int64_t) != 0) {
  ------------------
  |  Branch (1237:11): [True: 0, False: 4.64k]
  |  Branch (1237:34): [True: 0, False: 4.64k]
  ------------------
 1238|      0|        BLOSC_TRACE_ERROR("Invalid offsets chunk in frame 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1239|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1240|      0|      }
 1241|  4.64k|      *nchunks = coffsets_nbytes / (int32_t)sizeof(int64_t);
 1242|  4.64k|    }
 1243|      0|    else {
 1244|      0|      BLOSC_TRACE_ERROR("Invalid chunk size in frame 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1245|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1246|      0|    }
 1247|  26.3k|  } else {
 1248|     51|    *nchunks = 0;
 1249|     51|  }
 1250|       |
 1251|  26.4k|  if (*nchunks > 0) {
  ------------------
  |  Branch (1251:7): [True: 26.3k, False: 57]
  ------------------
 1252|  26.3k|    int32_t off_nbytes;
 1253|  26.3k|    if (!blosc2_nchunks_to_offsets_nbytes(*nchunks, &off_nbytes)) {
  ------------------
  |  Branch (1253:9): [True: 1, False: 26.3k]
  ------------------
 1254|      1|      BLOSC_TRACE_ERROR("Invalid number of chunks in frame header.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1255|      1|      return BLOSC2_ERROR_INVALID_HEADER;
 1256|      1|    }
 1257|  26.3k|  }
 1258|       |
 1259|  26.4k|  return 0;
 1260|  26.4k|}
get_trailer_offset:
 1263|    523|int64_t get_trailer_offset(blosc2_frame_s *frame, int32_t header_len, bool has_coffsets) {
 1264|    523|  if (!has_coffsets) {
  ------------------
  |  Branch (1264:7): [True: 3, False: 520]
  ------------------
 1265|       |    // No data chunks yet
 1266|      3|    return header_len;
 1267|      3|  }
 1268|    520|  return frame->len - frame->trailer_len;
 1269|    523|}
frame_from_cframe:
 2088|  9.02k|blosc2_frame_s* frame_from_cframe(uint8_t *cframe, int64_t len, bool copy) {
 2089|       |  // Get the length of the frame
 2090|  9.02k|  const uint8_t* header = cframe;
 2091|  9.02k|  int64_t frame_len;
 2092|  9.02k|  if (len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  9.02k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  9.02k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  9.02k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  9.02k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  9.02k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  9.02k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  9.02k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  9.02k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  9.02k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  9.02k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  9.02k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  9.02k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  9.02k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  9.02k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2092:7): [True: 0, False: 9.02k]
  ------------------
 2093|      0|    return NULL;
 2094|      0|  }
 2095|       |
 2096|  9.02k|  from_big(&frame_len, header + FRAME_LEN, sizeof(frame_len));
  ------------------
  |  |   38|  9.02k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2097|  9.02k|  if (frame_len != len) {   // sanity check
  ------------------
  |  Branch (2097:7): [True: 2, False: 9.02k]
  ------------------
 2098|      2|    return NULL;
 2099|      2|  }
 2100|       |
 2101|  9.02k|  blosc2_frame_s* frame = frame_alloc();
 2102|  9.02k|  if (frame == NULL) {
  ------------------
  |  Branch (2102:7): [True: 0, False: 9.02k]
  ------------------
 2103|      0|    return NULL;
 2104|      0|  }
 2105|  9.02k|  frame->len = frame_len;
 2106|  9.02k|  frame->file_offset = 0;
 2107|       |
 2108|       |  // Now, the trailer length
 2109|  9.02k|  const uint8_t* trailer = cframe + frame_len - FRAME_TRAILER_MINLEN;
  ------------------
  |  |   58|  9.02k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 2110|  9.02k|  int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   58|  9.02k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
                int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   59|  9.02k|#define FRAME_TRAILER_LEN_OFFSET (22)  // offset to trailer length (counting from the end)
  ------------------
 2111|  9.02k|  if (trailer[trailer_offset - 1] != 0xce) {
  ------------------
  |  Branch (2111:7): [True: 0, False: 9.02k]
  ------------------
 2112|      0|    blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 2113|      0|    free(frame);
 2114|      0|    return NULL;
 2115|      0|  }
 2116|  9.02k|  uint32_t trailer_len;
 2117|  9.02k|  from_big(&trailer_len, trailer + trailer_offset, sizeof(trailer_len));
  ------------------
  |  |   38|  9.02k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2118|  9.02k|  if (trailer_len < FRAME_TRAILER_MINLEN || trailer_len > INT32_MAX ||
  ------------------
  |  |   58|  18.0k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (2118:7): [True: 0, False: 9.02k]
  |  Branch (2118:45): [True: 0, False: 9.02k]
  ------------------
 2119|  9.02k|      (int64_t)trailer_len > frame_len ||
  ------------------
  |  Branch (2119:7): [True: 2, False: 9.02k]
  ------------------
 2120|  9.02k|      (int64_t)trailer_len > frame_len - FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  9.02k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  9.02k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  9.02k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  9.02k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  9.02k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  9.02k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  9.02k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  9.02k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  9.02k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  9.02k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  9.02k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  9.02k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  9.02k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  9.02k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2120:7): [True: 1, False: 9.02k]
  ------------------
 2121|      3|    blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|      3|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 2122|      3|    free(frame);
 2123|      3|    return NULL;
 2124|      3|  }
 2125|  9.02k|  frame->trailer_len = trailer_len;
 2126|       |
 2127|  9.02k|  if (copy) {
  ------------------
  |  Branch (2127:7): [True: 0, False: 9.02k]
  ------------------
 2128|      0|    frame->cframe = malloc((size_t)len);
 2129|      0|    memcpy(frame->cframe, cframe, (size_t)len);
 2130|      0|  }
 2131|  9.02k|  else {
 2132|  9.02k|    frame->cframe = cframe;
 2133|  9.02k|    frame->avoid_cframe_free = true;
 2134|  9.02k|  }
 2135|       |
 2136|  9.02k|  return frame;
 2137|  9.02k|}
get_coffsets:
 2320|  25.3k|                      int64_t nchunks, int32_t *off_cbytes) {
 2321|  25.3k|  int32_t chunk_cbytes;
 2322|  25.3k|  int rc;
 2323|       |
 2324|  25.3k|  if (frame->coffsets != NULL) {
  ------------------
  |  Branch (2324:7): [True: 0, False: 25.3k]
  ------------------
 2325|      0|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (2325:9): [True: 0, False: 0]
  ------------------
 2326|      0|      rc = blosc2_cbuffer_sizes(frame->coffsets, NULL, &chunk_cbytes, NULL);
 2327|      0|      if (rc < 0) {
  ------------------
  |  Branch (2327:11): [True: 0, False: 0]
  ------------------
 2328|      0|        return NULL;
 2329|      0|      }
 2330|      0|      *off_cbytes = (int32_t)chunk_cbytes;
 2331|      0|    }
 2332|      0|    return frame->coffsets;
 2333|      0|  }
 2334|  25.3k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2334:7): [True: 25.3k, False: 0]
  ------------------
 2335|  25.3k|    int64_t off_pos = header_len;
 2336|  25.3k|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (2336:9): [True: 1.92k, False: 23.4k]
  ------------------
 2337|  1.92k|      off_pos += cbytes;
 2338|  1.92k|    }
 2339|       |    // Check that there is enough room to read Blosc header
 2340|  25.3k|    if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2340:9): [True: 0, False: 25.3k]
  |  Branch (2340:24): [True: 0, False: 25.3k]
  ------------------
 2341|  25.3k|        off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (2341:9): [True: 3, False: 25.3k]
  ------------------
 2342|      3|      BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2343|      3|      return NULL;
 2344|      3|    }
 2345|       |    // For in-memory frames, the coffset is just one pointer away
 2346|  25.3k|    uint8_t* off_start = frame->cframe + off_pos;
 2347|  25.3k|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (2347:9): [True: 25.3k, False: 0]
  ------------------
 2348|  25.3k|      int32_t chunk_nbytes;
 2349|  25.3k|      int32_t chunk_blocksize;
 2350|  25.3k|      rc = blosc2_cbuffer_sizes(off_start, &chunk_nbytes, &chunk_cbytes, &chunk_blocksize);
 2351|  25.3k|      if (rc < 0) {
  ------------------
  |  Branch (2351:11): [True: 1, False: 25.3k]
  ------------------
 2352|      1|        return NULL;
 2353|      1|      }
 2354|  25.3k|      *off_cbytes = (int32_t)chunk_cbytes;
 2355|  25.3k|      if (*off_cbytes < 0 || off_pos + *off_cbytes > frame->len) {
  ------------------
  |  Branch (2355:11): [True: 0, False: 25.3k]
  |  Branch (2355:30): [True: 8, False: 25.3k]
  ------------------
 2356|      8|        BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2357|      8|        return NULL;
 2358|      8|      }
 2359|  25.3k|      int32_t expected_off_nbytes;
 2360|  25.3k|      if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &expected_off_nbytes)) {
  ------------------
  |  Branch (2360:11): [True: 0, False: 25.3k]
  ------------------
 2361|      0|        BLOSC_TRACE_ERROR("Too many chunks for offsets representation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2362|      0|        return NULL;
 2363|      0|      }
 2364|  25.3k|      if (chunk_nbytes != expected_off_nbytes) {
  ------------------
  |  Branch (2364:11): [True: 6, False: 25.3k]
  ------------------
 2365|      6|        BLOSC_TRACE_ERROR("The number of chunks in offset idx "
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|      6|                          "does not match the ones in the header frame.");
 2367|      6|        return NULL;
 2368|      6|      }
 2369|       |
 2370|  25.3k|    }
 2371|  25.3k|    return off_start;
 2372|  25.3k|  }
 2373|       |
 2374|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
 2375|       |
 2376|      0|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + FRAME_TRAILER_MINLEN > frame->len) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (2376:7): [True: 0, False: 0]
  |  Branch (2376:56): [True: 0, False: 0]
  ------------------
 2377|      0|    BLOSC_TRACE_ERROR("Cannot read the trailer out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2378|      0|    return NULL;
 2379|      0|  }
 2380|       |
 2381|      0|  int64_t coffsets_cbytes64;
 2382|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2382:7): [True: 0, False: 0]
  ------------------
 2383|      0|    coffsets_cbytes64 = trailer_offset - header_len;
 2384|      0|  }
 2385|      0|  else {
 2386|      0|    coffsets_cbytes64 = trailer_offset - (header_len + cbytes);
 2387|      0|  }
 2388|      0|  if (coffsets_cbytes64 <= 0 || coffsets_cbytes64 > INT32_MAX) {
  ------------------
  |  Branch (2388:7): [True: 0, False: 0]
  |  Branch (2388:33): [True: 0, False: 0]
  ------------------
 2389|      0|    BLOSC_TRACE_ERROR("Offsets chunk size is out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2390|      0|    return NULL;
 2391|      0|  }
 2392|      0|  int32_t coffsets_cbytes = (int32_t)coffsets_cbytes64;
 2393|       |
 2394|      0|  if (off_cbytes != NULL) {
  ------------------
  |  Branch (2394:7): [True: 0, False: 0]
  ------------------
 2395|      0|    *off_cbytes = coffsets_cbytes;
 2396|      0|  }
 2397|       |
 2398|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2399|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (2399:7): [True: 0, False: 0]
  ------------------
 2400|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2401|      0|    return NULL;
 2402|      0|  }
 2403|       |
 2404|      0|  void* fp = NULL;
 2405|      0|  uint8_t* coffsets;
 2406|      0|  if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2406:7): [True: 0, False: 0]
  ------------------
 2407|      0|    coffsets = malloc((size_t)coffsets_cbytes);
 2408|      0|    frame->coffsets_needs_free = true;
 2409|      0|  }
 2410|      0|  else {
 2411|      0|    frame->coffsets_needs_free = false;
 2412|      0|  }
 2413|       |
 2414|      0|  int64_t io_pos = 0;
 2415|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2415:7): [True: 0, False: 0]
  ------------------
 2416|      0|    fp = sframe_open_index(frame->urlpath, "rb",
 2417|      0|                           frame->schunk->storage->io);
 2418|      0|    if (fp == NULL) {
  ------------------
  |  Branch (2418:9): [True: 0, False: 0]
  ------------------
 2419|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2420|      0|      return NULL;
 2421|      0|    }
 2422|      0|    io_pos = header_len + 0;
 2423|      0|  }
 2424|      0|  else {
 2425|      0|    fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2426|      0|    if (fp == NULL) {
  ------------------
  |  Branch (2426:9): [True: 0, False: 0]
  ------------------
 2427|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2428|      0|      return NULL;
 2429|      0|    }
 2430|      0|    io_pos = frame->file_offset + header_len + cbytes;
 2431|      0|  }
 2432|      0|  int64_t rbytes = io_cb->read((void**)&coffsets, 1, coffsets_cbytes, io_pos, fp);
 2433|      0|  frame_reader_release(frame, io_cb, fp);
 2434|      0|  if (rbytes != coffsets_cbytes) {
  ------------------
  |  Branch (2434:7): [True: 0, False: 0]
  ------------------
 2435|      0|    BLOSC_TRACE_ERROR("Cannot read the offsets out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2436|      0|    if (frame->coffsets_needs_free)
  ------------------
  |  Branch (2436:9): [True: 0, False: 0]
  ------------------
 2437|      0|      free(coffsets);
 2438|      0|    return NULL;
 2439|      0|  }
 2440|      0|  frame->coffsets = coffsets;
 2441|      0|  return coffsets;
 2442|      0|}
frame_get_metalayers:
 2742|    555|int frame_get_metalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 2743|    555|  int32_t header_len;
 2744|    555|  int64_t frame_len;
 2745|    555|  int64_t nbytes;
 2746|    555|  int64_t cbytes;
 2747|    555|  int32_t blocksize;
 2748|    555|  int32_t chunksize;
 2749|    555|  int64_t nchunks;
 2750|    555|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 2751|    555|                            &blocksize, &chunksize, &nchunks,
 2752|    555|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 2753|    555|                            schunk->storage->io);
 2754|    555|  if (ret < 0) {
  ------------------
  |  Branch (2754:7): [True: 0, False: 555]
  ------------------
 2755|      0|    BLOSC_TRACE_ERROR("Unable to get the header info from 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2756|      0|    return ret;
 2757|      0|  }
 2758|       |
 2759|       |  // Get the header
 2760|    555|  uint8_t* header = NULL;
 2761|    555|  bool needs_free = false;
 2762|    555|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2762:7): [True: 555, False: 0]
  ------------------
 2763|    555|    header = frame->cframe;
 2764|    555|  } else {
 2765|      0|    int64_t rbytes = 0;
 2766|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2767|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2767:9): [True: 0, False: 0]
  ------------------
 2768|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2769|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2770|      0|    }
 2771|       |
 2772|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2772:9): [True: 0, False: 0]
  ------------------
 2773|      0|      header = malloc(header_len);
 2774|      0|      needs_free = true;
 2775|      0|    }
 2776|      0|    else {
 2777|      0|      needs_free = false;
 2778|      0|    }
 2779|       |
 2780|      0|    void* fp = NULL;
 2781|      0|    int64_t io_pos = 0;
 2782|      0|    if (frame->sframe) {
  ------------------
  |  Branch (2782:9): [True: 0, False: 0]
  ------------------
 2783|      0|      fp = sframe_open_index(frame->urlpath, "rb",
 2784|      0|                             frame->schunk->storage->io);
 2785|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2785:11): [True: 0, False: 0]
  ------------------
 2786|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2787|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2788|      0|      }
 2789|      0|    }
 2790|      0|    else {
 2791|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2792|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2792:11): [True: 0, False: 0]
  ------------------
 2793|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2794|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2795|      0|      }
 2796|      0|      io_pos = frame->file_offset;
 2797|      0|    }
 2798|      0|    if (fp != NULL) {
  ------------------
  |  Branch (2798:9): [True: 0, False: 0]
  ------------------
 2799|      0|      rbytes = io_cb->read((void**)&header, 1, header_len, io_pos, fp);
 2800|      0|      frame_reader_release(frame, io_cb, fp);
 2801|      0|    }
 2802|      0|    if (rbytes != header_len) {
  ------------------
  |  Branch (2802:9): [True: 0, False: 0]
  ------------------
 2803|      0|      BLOSC_TRACE_ERROR("Cannot access the header out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2804|      0|      if (needs_free)
  ------------------
  |  Branch (2804:11): [True: 0, False: 0]
  ------------------
 2805|      0|        free(header);
 2806|      0|      return BLOSC2_ERROR_FILE_READ;
 2807|      0|    }
 2808|      0|  }
 2809|       |
 2810|    555|  ret = get_meta_from_header(frame, schunk, header, header_len);
 2811|       |
 2812|    555|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (2812:7): [True: 0, False: 555]
  |  Branch (2812:32): [True: 0, False: 0]
  ------------------
 2813|      0|    free(header);
 2814|      0|  }
 2815|       |
 2816|    555|  return ret;
 2817|    555|}
frame_get_vlmetalayers:
 2953|    523|int frame_get_vlmetalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 2954|    523|  int32_t header_len;
 2955|    523|  int64_t frame_len;
 2956|    523|  int64_t nbytes;
 2957|    523|  int64_t cbytes;
 2958|    523|  int32_t blocksize;
 2959|    523|  int32_t chunksize;
 2960|    523|  int64_t nchunks;
 2961|    523|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 2962|    523|                            &blocksize, &chunksize, &nchunks,
 2963|    523|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 2964|    523|                            schunk->storage->io);
 2965|    523|  if (ret < 0) {
  ------------------
  |  Branch (2965:7): [True: 0, False: 523]
  ------------------
 2966|      0|    BLOSC_TRACE_ERROR("Unable to get the trailer info from 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2967|      0|    return ret;
 2968|      0|  }
 2969|       |
 2970|    523|  int64_t trailer_offset = get_trailer_offset(frame, header_len, nbytes > 0);
 2971|    523|  int32_t trailer_len = (int32_t) frame->trailer_len;
 2972|       |
 2973|    523|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + trailer_len > frame->len) {
  ------------------
  |  Branch (2973:7): [True: 0, False: 523]
  |  Branch (2973:56): [True: 1, False: 522]
  ------------------
 2974|      1|    BLOSC_TRACE_ERROR("Cannot access the trailer out of the frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2975|      1|    return BLOSC2_ERROR_READ_BUFFER;
 2976|      1|  }
 2977|       |
 2978|       |  // Get the trailer
 2979|    522|  uint8_t* trailer = NULL;
 2980|    522|  bool needs_free = false;
 2981|    522|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2981:7): [True: 522, False: 0]
  ------------------
 2982|    522|    trailer = frame->cframe + trailer_offset;
 2983|    522|  } else {
 2984|      0|    int64_t rbytes = 0;
 2985|       |
 2986|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2987|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2987:9): [True: 0, False: 0]
  ------------------
 2988|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2989|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2990|      0|    }
 2991|       |
 2992|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2992:9): [True: 0, False: 0]
  ------------------
 2993|      0|      trailer = malloc(trailer_len);
 2994|      0|      needs_free = true;
 2995|      0|    }
 2996|      0|    else {
 2997|      0|      needs_free = false;
 2998|      0|    }
 2999|       |
 3000|      0|    void* fp = NULL;
 3001|      0|    int64_t io_pos = 0;
 3002|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3002:9): [True: 0, False: 0]
  ------------------
 3003|       |      // Check for overflow before calculating length
 3004|      0|      if (strlen(frame->urlpath) > SIZE_MAX - strlen("/chunks.b2frame") - 1) {
  ------------------
  |  Branch (3004:11): [True: 0, False: 0]
  ------------------
 3005|      0|        BLOSC_TRACE_ERROR("Path too long for frame filename.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3006|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (3006:13): [True: 0, False: 0]
  ------------------
 3007|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 3008|      0|      }
 3009|      0|      size_t _len = strlen(frame->urlpath) + strlen("/chunks.b2frame") + 1;
 3010|      0|      char* eframe_name = malloc(_len);
 3011|      0|      if (eframe_name == NULL) {
  ------------------
  |  Branch (3011:11): [True: 0, False: 0]
  ------------------
 3012|      0|        BLOSC_TRACE_ERROR("Unable to allocate memory for frame filename.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3013|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (3013:13): [True: 0, False: 0]
  ------------------
 3014|      0|        return BLOSC2_ERROR_MEMORY_ALLOC;
 3015|      0|      }
 3016|      0|      int _w = snprintf(eframe_name, _len, "%s/chunks.b2frame", frame->urlpath);
 3017|      0|      if (_w < 0 || (size_t)_w >= _len) {
  ------------------
  |  Branch (3017:11): [True: 0, False: 0]
  |  Branch (3017:21): [True: 0, False: 0]
  ------------------
 3018|      0|        BLOSC_TRACE_ERROR("Error building frame filename");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3019|      0|        free(eframe_name);
 3020|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (3020:13): [True: 0, False: 0]
  ------------------
 3021|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 3022|      0|      }
 3023|      0|      fp = io_cb->open(eframe_name, "rb", frame->schunk->storage->io->params);
 3024|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3024:11): [True: 0, False: 0]
  ------------------
 3025|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", eframe_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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3026|      0|        free(eframe_name);
 3027|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3028|      0|      }
 3029|      0|      free(eframe_name);
 3030|      0|      io_pos = trailer_offset;
 3031|      0|    }
 3032|      0|    else {
 3033|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 3034|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3034:11): [True: 0, False: 0]
  ------------------
 3035|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3036|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3037|      0|      }
 3038|      0|      io_pos = frame->file_offset + trailer_offset;
 3039|      0|    }
 3040|      0|    if (fp != NULL) {
  ------------------
  |  Branch (3040:9): [True: 0, False: 0]
  ------------------
 3041|      0|      rbytes = io_cb->read((void**)&trailer, 1, trailer_len, io_pos, fp);
 3042|      0|      frame_reader_release(frame, io_cb, fp);
 3043|      0|    }
 3044|      0|    if (rbytes != trailer_len) {
  ------------------
  |  Branch (3044:9): [True: 0, False: 0]
  ------------------
 3045|      0|      BLOSC_TRACE_ERROR("Cannot access the trailer 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3046|      0|      if (needs_free)
  ------------------
  |  Branch (3046:11): [True: 0, False: 0]
  ------------------
 3047|      0|        free(trailer);
 3048|      0|      return BLOSC2_ERROR_FILE_READ;
 3049|      0|    }
 3050|      0|  }
 3051|       |
 3052|    522|  ret = get_vlmeta_from_trailer(frame, schunk, trailer, trailer_len);
 3053|       |
 3054|    522|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (3054:7): [True: 0, False: 522]
  |  Branch (3054:32): [True: 0, False: 0]
  ------------------
 3055|      0|    free(trailer);
 3056|      0|  }
 3057|       |
 3058|    522|  return ret;
 3059|    522|}
get_new_storage:
 3065|  9.00k|                                const blosc2_io* iodefaults) {
 3066|       |
 3067|  9.00k|  blosc2_storage* new_storage = (blosc2_storage*)calloc(1, sizeof(blosc2_storage));
 3068|  9.00k|  memcpy(new_storage, storage, sizeof(blosc2_storage));
 3069|  9.00k|  if (storage->urlpath != NULL) {
  ------------------
  |  Branch (3069:7): [True: 0, False: 9.00k]
  ------------------
 3070|      0|    char* urlpath = normalize_urlpath(storage->urlpath);
 3071|      0|    new_storage->urlpath = malloc(strlen(urlpath) + 1);
 3072|      0|    strcpy(new_storage->urlpath, urlpath);
 3073|      0|  }
 3074|       |
 3075|       |  // cparams
 3076|  9.00k|  blosc2_cparams* cparams = malloc(sizeof(blosc2_cparams));
 3077|  9.00k|  if (storage->cparams != NULL) {
  ------------------
  |  Branch (3077:7): [True: 0, False: 9.00k]
  ------------------
 3078|      0|    memcpy(cparams, storage->cparams, sizeof(blosc2_cparams));
 3079|  9.00k|  } else {
 3080|  9.00k|    memcpy(cparams, cdefaults, sizeof(blosc2_cparams));
 3081|  9.00k|  }
 3082|  9.00k|  new_storage->cparams = cparams;
 3083|       |
 3084|       |  // dparams
 3085|  9.00k|  blosc2_dparams* dparams = malloc(sizeof(blosc2_dparams));
 3086|  9.00k|  if (storage->dparams != NULL) {
  ------------------
  |  Branch (3086:7): [True: 0, False: 9.00k]
  ------------------
 3087|      0|    memcpy(dparams, storage->dparams, sizeof(blosc2_dparams));
 3088|      0|  }
 3089|  9.00k|  else {
 3090|  9.00k|    memcpy(dparams, ddefaults, sizeof(blosc2_dparams));
 3091|  9.00k|  }
 3092|  9.00k|  new_storage->dparams = dparams;
 3093|       |
 3094|       |  // iodefaults
 3095|  9.00k|  blosc2_io* udio = malloc(sizeof(blosc2_io));
 3096|  9.00k|  if (storage->io != NULL) {
  ------------------
  |  Branch (3096:7): [True: 0, False: 9.00k]
  ------------------
 3097|      0|    memcpy(udio, storage->io, sizeof(blosc2_io));
 3098|      0|  }
 3099|  9.00k|  else {
 3100|  9.00k|    memcpy(udio, iodefaults, sizeof(blosc2_io));
 3101|  9.00k|  }
 3102|  9.00k|  new_storage->io = udio;
 3103|       |
 3104|  9.00k|  return new_storage;
 3105|  9.00k|}
frame_to_schunk:
 3169|  9.02k|blosc2_schunk* frame_to_schunk(blosc2_frame_s* frame, bool copy, const blosc2_io *udio) {
 3170|  9.02k|  int32_t header_len;
 3171|  9.02k|  int64_t frame_len;
 3172|  9.02k|  int rc;
 3173|  9.02k|  bool frame_attached = true;
 3174|  9.02k|  blosc2_schunk* schunk = calloc(1, sizeof(blosc2_schunk));
 3175|  9.02k|  blosc2_cparams *cparams = NULL;
 3176|  9.02k|  blosc2_dparams *dparams = NULL;
 3177|  9.02k|  int64_t *offsets = NULL;
 3178|  9.02k|  if (schunk == NULL) {
  ------------------
  |  Branch (3178:7): [True: 0, False: 9.02k]
  ------------------
 3179|      0|    return NULL;
 3180|      0|  }
 3181|  9.02k|  schunk->frame = (blosc2_frame*)frame;
 3182|  9.02k|  frame->schunk = schunk;
 3183|       |
 3184|  9.02k|  rc = get_header_info(frame, &header_len, &frame_len, &schunk->nbytes,
 3185|  9.02k|                       &schunk->cbytes, &schunk->blocksize,
 3186|  9.02k|                       &schunk->chunksize, &schunk->nchunks, &schunk->typesize,
 3187|  9.02k|                       &schunk->compcode, &schunk->compcode_meta, &schunk->clevel, schunk->filters,
 3188|  9.02k|                       schunk->filters_meta, &schunk->splitmode, &schunk->use_dict, udio);
 3189|  9.02k|  if (rc < 0) {
  ------------------
  |  Branch (3189:7): [True: 17, False: 9.00k]
  ------------------
 3190|     17|    BLOSC_TRACE_ERROR("Unable to get meta info from frame.");
  ------------------
  |  |   93|     17|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     17|    do {                                            \
  |  |  |  |   98|     17|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     17|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     17|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3191|     17|    goto error;
 3192|     17|  }
 3193|  9.00k|  int64_t nchunks = schunk->nchunks;
 3194|  9.00k|  int64_t nbytes = schunk->nbytes;
 3195|  9.00k|  (void) nbytes;
 3196|  9.00k|  int64_t cbytes = schunk->cbytes;
 3197|       |
 3198|       |  // Compression and decompression contexts
 3199|  9.00k|  blosc2_schunk_get_cparams(schunk, &cparams);
 3200|  9.00k|  schunk->cctx = blosc2_create_cctx(*cparams);
 3201|  9.00k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (3201:7): [True: 2, False: 9.00k]
  ------------------
 3202|      2|    BLOSC_TRACE_ERROR("Error while creating the compression context");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3203|      2|    goto error;
 3204|      2|  }
 3205|  9.00k|  blosc2_schunk_get_dparams(schunk, &dparams);
 3206|  9.00k|  schunk->dctx = blosc2_create_dctx(*dparams);
 3207|  9.00k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (3207:7): [True: 0, False: 9.00k]
  ------------------
 3208|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3209|      0|    goto error;
 3210|      0|  }
 3211|  9.00k|  blosc2_storage storage = {.contiguous = copy ? false : true};
  ------------------
  |  Branch (3211:43): [True: 0, False: 9.00k]
  ------------------
 3212|  9.00k|  schunk->storage = get_new_storage(&storage, cparams, dparams, udio);
 3213|  9.00k|  free(cparams);
 3214|  9.00k|  cparams = NULL;
 3215|  9.00k|  free(dparams);
 3216|  9.00k|  dparams = NULL;
 3217|  9.00k|  if (nchunks > 0) {
  ------------------
  |  Branch (3217:7): [True: 8.97k, False: 26]
  ------------------
 3218|  8.97k|    rc = validate_offsets_chunk(frame, header_len, cbytes, nchunks);
 3219|  8.97k|    if (rc < 0) {
  ------------------
  |  Branch (3219:9): [True: 8.24k, False: 731]
  ------------------
 3220|  8.24k|      BLOSC_TRACE_ERROR("Cannot validate frame offsets.");
  ------------------
  |  |   93|  8.24k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  8.24k|    do {                                            \
  |  |  |  |   98|  8.24k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  8.24k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8.24k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  8.24k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3221|  8.24k|      goto error;
 3222|  8.24k|    }
 3223|  8.97k|  }
 3224|    757|  if (nchunks > 0) {
  ------------------
  |  Branch (3224:7): [True: 731, False: 26]
  ------------------
 3225|    731|    uint8_t *chunk;
 3226|    731|    bool needs_free;
 3227|       |    // A lazy chunk is enough here: only the header is needed for the flags2 byte
 3228|    731|    rc = frame_get_lazychunk(frame, 0, &chunk, &needs_free);
 3229|    731|    if (rc < 0) {
  ------------------
  |  Branch (3229:9): [True: 202, False: 529]
  ------------------
 3230|    202|      BLOSC_TRACE_ERROR("Cannot inspect the first chunk in frame.");
  ------------------
  |  |   93|    202|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    202|    do {                                            \
  |  |  |  |   98|    202|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    202|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 202, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    202|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3231|    202|      goto error;
 3232|    202|    }
 3233|    529|    schunk->flags2 = (rc >= BLOSC_EXTENDED_HEADER_LENGTH) ? chunk[BLOSC2_CHUNK_BLOSC2_FLAGS2] : 0;
  ------------------
  |  Branch (3233:22): [True: 529, False: 0]
  ------------------
 3234|    529|    if (needs_free) {
  ------------------
  |  Branch (3234:9): [True: 364, False: 165]
  ------------------
 3235|    364|      free(chunk);
 3236|    364|    }
 3237|    529|  }
 3238|    555|  if (!copy) {
  ------------------
  |  Branch (3238:7): [True: 555, False: 0]
  ------------------
 3239|    555|    goto out;
 3240|    555|  }
 3241|       |
 3242|       |  // We are not attached to a frame anymore
 3243|      0|  schunk->frame = NULL;
 3244|      0|  frame_attached = false;
 3245|       |
 3246|      0|  if (nchunks == 0) {
  ------------------
  |  Branch (3246:7): [True: 0, False: 0]
  ------------------
 3247|      0|    frame->schunk = NULL;
 3248|      0|    goto out;
 3249|      0|  }
 3250|       |
 3251|       |  // Get the compressed offsets
 3252|      0|  int32_t coffsets_cbytes = 0;
 3253|      0|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 3254|      0|  if (coffsets == NULL) {
  ------------------
  |  Branch (3254:7): [True: 0, False: 0]
  ------------------
 3255|      0|    BLOSC_TRACE_ERROR("Cannot get the offsets for the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3256|      0|    goto error;
 3257|      0|  }
 3258|       |
 3259|       |  // Decompress offsets
 3260|      0|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 3261|      0|  blosc2_context *dctx = blosc2_create_dctx(off_dparams);
 3262|      0|  if (dctx == NULL) {
  ------------------
  |  Branch (3262:7): [True: 0, False: 0]
  ------------------
 3263|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3264|      0|    goto error;
 3265|      0|  }
 3266|      0|  int32_t offsets_nbytes;
 3267|      0|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (3267:7): [True: 0, False: 0]
  ------------------
 3268|      0|    blosc2_free_ctx(dctx);
 3269|      0|    BLOSC_TRACE_ERROR("Too many chunks for offsets representation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3270|      0|    goto error;
 3271|      0|  }
 3272|      0|  offsets = (int64_t *) malloc((size_t)offsets_nbytes);
 3273|      0|  if (offsets == NULL) {
  ------------------
  |  Branch (3273:7): [True: 0, False: 0]
  ------------------
 3274|      0|    blosc2_free_ctx(dctx);
 3275|      0|    BLOSC_TRACE_ERROR("Cannot allocate memory for offsets.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3276|      0|    goto error;
 3277|      0|  }
 3278|      0|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 3279|      0|                                             offsets, offsets_nbytes);
 3280|      0|  blosc2_free_ctx(dctx);
 3281|      0|  if (off_nbytes < 0) {
  ------------------
  |  Branch (3281:7): [True: 0, False: 0]
  ------------------
 3282|      0|    BLOSC_TRACE_ERROR("Cannot decompress the offsets 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3283|      0|    goto error;
 3284|      0|  }
 3285|       |
 3286|       |  // We want the contiguous schunk, so create the actual data chunks (and, while doing this,
 3287|       |  // get a guess at the blocksize used in this frame)
 3288|      0|  int64_t acc_nbytes = 0;
 3289|      0|  int64_t acc_cbytes = 0;
 3290|      0|  int32_t blocksize = 0;
 3291|      0|  int32_t chunk_nbytes;
 3292|      0|  int32_t chunk_cbytes;
 3293|      0|  int32_t chunk_blocksize;
 3294|      0|  size_t prev_alloc = BLOSC_EXTENDED_HEADER_LENGTH;
 3295|      0|  uint8_t* data_chunk = NULL;
 3296|      0|  bool needs_free = false;
 3297|      0|  const blosc2_io_cb *io_cb = blosc2_get_io_cb(udio->id);
 3298|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (3298:7): [True: 0, False: 0]
  ------------------
 3299|      0|    blosc2_schunk_free(schunk);
 3300|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3301|      0|    return NULL;
 3302|      0|  }
 3303|       |
 3304|      0|  void* fp = NULL;
 3305|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3305:7): [True: 0, False: 0]
  ------------------
 3306|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3306:9): [True: 0, False: 0]
  ------------------
 3307|      0|      data_chunk = malloc((size_t)prev_alloc);
 3308|      0|      needs_free = true;
 3309|      0|    }
 3310|      0|    else {
 3311|      0|      needs_free = false;
 3312|      0|    }
 3313|       |
 3314|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (3314:9): [True: 0, False: 0]
  ------------------
 3315|       |      // If not the chunks won't be in the frame
 3316|      0|      fp = frame_reader_acquire(frame, udio);
 3317|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3317:11): [True: 0, False: 0]
  ------------------
 3318|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3319|      0|        rc = BLOSC2_ERROR_FILE_OPEN;
 3320|      0|        goto end;
 3321|      0|      }
 3322|      0|    }
 3323|      0|  }
 3324|      0|  schunk->data = malloc(nchunks * sizeof(void*));
 3325|      0|  for (int64_t i = 0; i < nchunks; i++) {
  ------------------
  |  Branch (3325:23): [True: 0, False: 0]
  ------------------
 3326|      0|    if (frame->cframe != NULL) {
  ------------------
  |  Branch (3326:9): [True: 0, False: 0]
  ------------------
 3327|      0|      if (needs_free) {
  ------------------
  |  Branch (3327:11): [True: 0, False: 0]
  ------------------
 3328|      0|        free(data_chunk);
 3329|      0|      }
 3330|      0|      if (offsets[i] < 0) {
  ------------------
  |  Branch (3330:11): [True: 0, False: 0]
  ------------------
 3331|      0|        int64_t rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 3332|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (3332:13): [True: 0, False: 0]
  ------------------
 3333|      0|          break;
 3334|      0|        }
 3335|      0|      }
 3336|      0|      else {
 3337|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (3337:13): [True: 0, False: 0]
  ------------------
 3338|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3338:13): [True: 0, False: 0]
  ------------------
 3339|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3339:13): [True: 0, False: 0]
  ------------------
 3340|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3341|      0|          break;
 3342|      0|        }
 3343|      0|        data_chunk = frame->cframe + header_len + offsets[i];
 3344|      0|        needs_free = false;
 3345|      0|      }
 3346|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 3347|      0|      if (rc < 0) {
  ------------------
  |  Branch (3347:11): [True: 0, False: 0]
  ------------------
 3348|      0|        break;
 3349|      0|      }
 3350|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (3350:11): [True: 0, False: 0]
  ------------------
 3351|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3351:12): [True: 0, False: 0]
  ------------------
 3352|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3352:12): [True: 0, False: 0]
  ------------------
 3353|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (3353:12): [True: 0, False: 0]
  ------------------
 3354|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3355|      0|        break;
 3356|      0|      }
 3357|      0|    }
 3358|      0|    else {
 3359|      0|      int64_t rbytes;
 3360|      0|      if (offsets[i] < 0 || frame->sframe) {
  ------------------
  |  Branch (3360:11): [True: 0, False: 0]
  |  Branch (3360:29): [True: 0, False: 0]
  ------------------
 3361|      0|        if (needs_free) {
  ------------------
  |  Branch (3361:13): [True: 0, False: 0]
  ------------------
 3362|      0|          free(data_chunk);
 3363|      0|        }
 3364|      0|        rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 3365|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (3365:13): [True: 0, False: 0]
  ------------------
 3366|      0|          break;
 3367|      0|        }
 3368|      0|      }
 3369|      0|      else {
 3370|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (3370:13): [True: 0, False: 0]
  ------------------
 3371|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3371:13): [True: 0, False: 0]
  ------------------
 3372|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3372:13): [True: 0, False: 0]
  ------------------
 3373|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3374|      0|          break;
 3375|      0|        }
 3376|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 3377|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 3378|      0|      }
 3379|      0|      if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3379:11): [True: 0, False: 0]
  ------------------
 3380|      0|        rc = BLOSC2_ERROR_READ_BUFFER;
 3381|      0|        break;
 3382|      0|      }
 3383|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 3384|      0|      if (rc < 0) {
  ------------------
  |  Branch (3384:11): [True: 0, False: 0]
  ------------------
 3385|      0|        break;
 3386|      0|      }
 3387|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (3387:11): [True: 0, False: 0]
  ------------------
 3388|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3388:12): [True: 0, False: 0]
  ------------------
 3389|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3389:12): [True: 0, False: 0]
  ------------------
 3390|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (3390:12): [True: 0, False: 0]
  ------------------
 3391|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3392|      0|        break;
 3393|      0|      }
 3394|      0|      if (chunk_cbytes > (int32_t)prev_alloc) {
  ------------------
  |  Branch (3394:11): [True: 0, False: 0]
  ------------------
 3395|      0|        if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3395:13): [True: 0, False: 0]
  ------------------
 3396|      0|          data_chunk = realloc(data_chunk, chunk_cbytes);
 3397|      0|        if (data_chunk == NULL) {
  ------------------
  |  Branch (3397:13): [True: 0, False: 0]
  ------------------
 3398|      0|          BLOSC_TRACE_ERROR("Cannot realloc space for the data_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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3399|      0|          rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3400|      0|          break;
 3401|      0|        }
 3402|      0|        prev_alloc = chunk_cbytes;
 3403|      0|      }
 3404|      0|      if (!frame->sframe) {
  ------------------
  |  Branch (3404:11): [True: 0, False: 0]
  ------------------
 3405|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 3406|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, chunk_cbytes, io_pos, fp);
 3407|      0|        if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (3407:13): [True: 0, False: 0]
  ------------------
 3408|      0|          rc = BLOSC2_ERROR_READ_BUFFER;
 3409|      0|          break;
 3410|      0|        }
 3411|      0|      }
 3412|      0|    }
 3413|      0|    uint8_t* new_chunk = malloc(chunk_cbytes);
 3414|      0|    memcpy(new_chunk, data_chunk, chunk_cbytes);
 3415|      0|    schunk->data[i] = new_chunk;
 3416|      0|    rc = blosc2_cbuffer_sizes(data_chunk, &chunk_nbytes, NULL, &chunk_blocksize);
 3417|      0|    if (rc < 0) {
  ------------------
  |  Branch (3417:9): [True: 0, False: 0]
  ------------------
 3418|      0|      break;
 3419|      0|    }
 3420|      0|    acc_nbytes += chunk_nbytes;
 3421|      0|    acc_cbytes += chunk_cbytes;
 3422|      0|    if (i == 0) {
  ------------------
  |  Branch (3422:9): [True: 0, False: 0]
  ------------------
 3423|      0|      blocksize = chunk_blocksize;
 3424|      0|    }
 3425|      0|    else if (blocksize != chunk_blocksize) {
  ------------------
  |  Branch (3425:14): [True: 0, False: 0]
  ------------------
 3426|       |      // Blocksize varies
 3427|      0|      blocksize = 0;
 3428|      0|    }
 3429|      0|  }
 3430|       |
 3431|       |  // We are not attached to a schunk anymore
 3432|      0|  frame->schunk = NULL;
 3433|       |
 3434|      0|  end:
 3435|      0|  if (needs_free) {
  ------------------
  |  Branch (3435:7): [True: 0, False: 0]
  ------------------
 3436|      0|    free(data_chunk);
 3437|      0|  }
 3438|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3438:7): [True: 0, False: 0]
  ------------------
 3439|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (3439:9): [True: 0, False: 0]
  ------------------
 3440|      0|      frame_reader_release(frame, io_cb, fp);
 3441|      0|    }
 3442|      0|  }
 3443|      0|  free(offsets);
 3444|       |  // Avoid a double-free in the `error:` cleanup below, which is reached
 3445|       |  // when frame_get_metalayers / frame_get_vlmetalayers reject a malformed
 3446|       |  // metalayer index after we've already freed `offsets` here.
 3447|      0|  offsets = NULL;
 3448|       |
 3449|       |  // cframes and sframes have different ways to store chunks with special values:
 3450|       |  // 1) cframes represent special chunks as negative offsets
 3451|       |  // 2) sframes does not have the concept of offsets, but rather of data pointers (.data)
 3452|       |  //    so they always have a pointer to a special chunk
 3453|       |  // This is why cframes and sframes have different cbytes and hence, we cannot enforce acc_bytes == schunk->cbytes
 3454|       |  // In the future, maybe we could provide special meanings for .data[i] > 0x7FFFFFFF, but not there yet
 3455|       |  // if (rc < 0 || acc_nbytes != nbytes || acc_cbytes != cbytes) {
 3456|      0|  if (rc < 0 || acc_nbytes != nbytes) {
  ------------------
  |  Branch (3456:7): [True: 0, False: 0]
  |  Branch (3456:17): [True: 0, False: 0]
  ------------------
 3457|      0|    goto error;
 3458|      0|  }
 3459|       |  // Update counters
 3460|      0|  schunk->cbytes = acc_cbytes;
 3461|      0|  schunk->blocksize = blocksize;
 3462|       |
 3463|    555|  out:
 3464|    555|  rc = frame_get_metalayers(frame, schunk);
 3465|    555|  if (rc < 0) {
  ------------------
  |  Branch (3465:7): [True: 32, False: 523]
  ------------------
 3466|     32|    BLOSC_TRACE_ERROR("Cannot access the metalayers.");
  ------------------
  |  |   93|     32|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     32|    do {                                            \
  |  |  |  |   98|     32|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     32|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 32, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     32|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3467|     32|    goto error;
 3468|     32|  }
 3469|       |
 3470|    523|  rc = frame_get_vlmetalayers(frame, schunk);
 3471|    523|  if (rc < 0) {
  ------------------
  |  Branch (3471:7): [True: 38, False: 485]
  ------------------
 3472|     38|    BLOSC_TRACE_ERROR("Cannot access the vlmetalayers.");
  ------------------
  |  |   93|     38|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     38|    do {                                            \
  |  |  |  |   98|     38|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     38|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 38, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     38|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3473|     38|    goto error;
 3474|     38|  }
 3475|       |
 3476|    485|  return schunk;
 3477|       |
 3478|  8.53k|error:
 3479|  8.53k|  free(cparams);
 3480|  8.53k|  free(dparams);
 3481|  8.53k|  free(offsets);
 3482|  8.53k|  if (schunk != NULL) {
  ------------------
  |  Branch (3482:7): [True: 8.53k, False: 0]
  ------------------
 3483|  8.53k|    blosc2_schunk_free(schunk);
 3484|  8.53k|  }
 3485|  8.53k|  if (!frame_attached) {
  ------------------
  |  Branch (3485:7): [True: 0, False: 8.53k]
  ------------------
 3486|      0|    frame->schunk = NULL;
 3487|      0|    frame_free(frame);
 3488|      0|  }
 3489|       |  return NULL;
 3490|    523|}
get_coffset:
 3512|  16.3k|                int64_t nchunk, int64_t nchunks, int64_t *offset) {
 3513|  16.3k|  int32_t off_cbytes;
 3514|       |  // Get the offset to nchunk
 3515|  16.3k|  uint8_t *coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &off_cbytes);
 3516|  16.3k|  if (coffsets == NULL) {
  ------------------
  |  Branch (3516:7): [True: 0, False: 16.3k]
  ------------------
 3517|      0|    BLOSC_TRACE_ERROR("Cannot get the offset for chunk %" PRId64 " for the frame.", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3518|      0|    return BLOSC2_ERROR_DATA;
 3519|      0|  }
 3520|       |
 3521|       |  // Get the 64-bit offset
 3522|  16.3k|  int rc = blosc2_getitem(coffsets, off_cbytes, (int32_t)nchunk, 1, offset, (int32_t)sizeof(int64_t));
 3523|  16.3k|  if (rc < 0) {
  ------------------
  |  Branch (3523:7): [True: 16, False: 16.3k]
  ------------------
 3524|     16|    BLOSC_TRACE_ERROR("Problems retrieving a chunk offset.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3525|  16.3k|  } else if (!frame->sframe && *offset >= 0) {
  ------------------
  |  Branch (3525:14): [True: 16.3k, False: 0]
  |  Branch (3525:32): [True: 13.4k, False: 2.88k]
  ------------------
 3526|  13.4k|    if (cbytes < 0 || cbytes > INT64_MAX - header_len) {
  ------------------
  |  Branch (3526:9): [True: 0, False: 13.4k]
  |  Branch (3526:23): [True: 41, False: 13.4k]
  ------------------
 3527|     41|      BLOSC_TRACE_ERROR("Invalid compressed size in frame header.");
  ------------------
  |  |   93|     41|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     41|    do {                                            \
  |  |  |  |   98|     41|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     41|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 41, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     41|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3528|     41|      return BLOSC2_ERROR_INVALID_HEADER;
 3529|     41|    }
 3530|  13.4k|    if (*offset > INT64_MAX - header_len) {
  ------------------
  |  Branch (3530:9): [True: 0, False: 13.4k]
  ------------------
 3531|      0|      BLOSC_TRACE_ERROR("Offset for chunk %" PRId64 " overflows frame position.", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3532|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3533|      0|    }
 3534|  13.4k|    int64_t chunk_pos = header_len + *offset;
 3535|  13.4k|    int64_t data_limit = header_len + cbytes;
 3536|  13.4k|    if (chunk_pos < header_len ||
  ------------------
  |  Branch (3536:9): [True: 0, False: 13.4k]
  ------------------
 3537|  13.4k|        chunk_pos > data_limit - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3537:9): [True: 24, False: 13.3k]
  ------------------
 3538|  13.3k|        chunk_pos > frame->len - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3538:9): [True: 152, False: 13.2k]
  ------------------
 3539|    176|      BLOSC_TRACE_ERROR("Cannot read chunk %" PRId64 " outside of frame boundary.", nchunk);
  ------------------
  |  |   93|    176|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    176|    do {                                            \
  |  |  |  |   98|    176|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    176|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 176, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    176|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3540|    176|      return BLOSC2_ERROR_INVALID_HEADER;
 3541|    176|    }
 3542|  13.4k|  }
 3543|       |
 3544|  16.1k|  return rc;
 3545|  16.3k|}
frame_special_chunk:
 3550|  2.88k|                        uint8_t** chunk, int32_t cbytes, bool *needs_free) {
 3551|  2.88k|  int rc = 0;
 3552|  2.88k|  *chunk = malloc(cbytes);
 3553|  2.88k|  *needs_free = true;
 3554|       |
 3555|       |  // Detect the kind of special value
 3556|  2.88k|  uint64_t zeros_mask = (uint64_t) BLOSC2_SPECIAL_ZERO << (8 * 7);  // chunk of zeros
 3557|  2.88k|  uint64_t nans_mask = (uint64_t) BLOSC2_SPECIAL_NAN << (8 * 7);  // chunk of NaNs
 3558|  2.88k|  uint64_t uninit_mask = (uint64_t) BLOSC2_SPECIAL_UNINIT << (8 * 7);  // chunk of uninit values
 3559|       |
 3560|  2.88k|  blosc2_cparams cparams = BLOSC2_CPARAMS_DEFAULTS;
 3561|  2.88k|  cparams.typesize = typesize;
 3562|  2.88k|  cparams.blocksize = blocksize;
 3563|  2.88k|  if (special_value & zeros_mask) {
  ------------------
  |  Branch (3563:7): [True: 1.71k, False: 1.16k]
  ------------------
 3564|  1.71k|    rc = blosc2_chunk_zeros(cparams, nbytes, *chunk, cbytes);
 3565|  1.71k|    if (rc < 0) {
  ------------------
  |  Branch (3565:9): [True: 2, False: 1.71k]
  ------------------
 3566|      2|      BLOSC_TRACE_ERROR("Error creating a zero chunk");
  ------------------
  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3567|      2|    }
 3568|  1.71k|  }
 3569|  1.16k|  else if (special_value & uninit_mask) {
  ------------------
  |  Branch (3569:12): [True: 1.03k, False: 129]
  ------------------
 3570|  1.03k|    rc = blosc2_chunk_uninit(cparams, nbytes, *chunk, cbytes);
 3571|  1.03k|    if (rc < 0) {
  ------------------
  |  Branch (3571:9): [True: 5, False: 1.02k]
  ------------------
 3572|      5|      BLOSC_TRACE_ERROR("Error creating a non initialized chunk");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3573|      5|    }
 3574|  1.03k|  }
 3575|    129|  else if (special_value & nans_mask) {
  ------------------
  |  Branch (3575:12): [True: 123, False: 6]
  ------------------
 3576|    123|    rc = blosc2_chunk_nans(cparams, nbytes, *chunk, cbytes);
 3577|    123|    if (rc < 0) {
  ------------------
  |  Branch (3577:9): [True: 5, False: 118]
  ------------------
 3578|      5|      BLOSC_TRACE_ERROR("Error creating a nan chunk");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3579|      5|    }
 3580|    123|  }
 3581|      6|  else {
 3582|      6|    BLOSC_TRACE_ERROR("Special value not recognized: %" PRId64 "", special_value);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3583|      6|    rc = BLOSC2_ERROR_DATA;
 3584|      6|  }
 3585|       |
 3586|  2.88k|  if (rc < 0) {
  ------------------
  |  Branch (3586:7): [True: 18, False: 2.86k]
  ------------------
 3587|     18|    free(*chunk);
 3588|     18|    *needs_free = false;
 3589|     18|    *chunk = NULL;
 3590|     18|  }
 3591|       |
 3592|  2.88k|  return rc;
 3593|  2.88k|}
frame_get_chunk:
 3606|  15.6k|int frame_get_chunk(blosc2_frame_s *frame, int64_t nchunk, uint8_t **chunk, bool *needs_free) {
 3607|  15.6k|  int32_t header_len;
 3608|  15.6k|  int64_t frame_len;
 3609|  15.6k|  int64_t nbytes;
 3610|  15.6k|  int64_t cbytes;
 3611|  15.6k|  int32_t blocksize;
 3612|  15.6k|  int32_t chunksize;
 3613|  15.6k|  int64_t nchunks;
 3614|  15.6k|  int32_t typesize;
 3615|  15.6k|  int64_t offset;
 3616|  15.6k|  int32_t chunk_cbytes;
 3617|  15.6k|  int rc;
 3618|       |
 3619|  15.6k|  *chunk = NULL;
 3620|  15.6k|  *needs_free = false;
 3621|  15.6k|  rc = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 3622|  15.6k|                       &blocksize, &chunksize, &nchunks,
 3623|  15.6k|                       &typesize, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 3624|  15.6k|                       frame->schunk->storage->io);
 3625|  15.6k|  if (rc < 0) {
  ------------------
  |  Branch (3625:7): [True: 0, False: 15.6k]
  ------------------
 3626|      0|    BLOSC_TRACE_ERROR("Unable to get meta info from 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3627|      0|    return rc;
 3628|      0|  }
 3629|  15.6k|  rc = frame_refresh_if_stale(frame, frame_len);
 3630|  15.6k|  if (rc < 0) {
  ------------------
  |  Branch (3630:7): [True: 0, False: 15.6k]
  ------------------
 3631|      0|    BLOSC_TRACE_ERROR("Unable to refresh the frame state from disk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3632|      0|    return rc;
 3633|      0|  }
 3634|  15.6k|  if (rc > 0) {
  ------------------
  |  Branch (3634:7): [True: 0, False: 15.6k]
  ------------------
 3635|       |    // Keep the schunk-level counters in sync with the refreshed on-disk state.
 3636|       |    // Mutating ops (update/delete) read a chunk before adjusting the counters,
 3637|       |    // so this also gives them a fresh base to apply their deltas on.
 3638|      0|    frame->schunk->nbytes = nbytes;
 3639|      0|    frame->schunk->cbytes = cbytes;
 3640|      0|    frame->schunk->nchunks = nchunks;
 3641|      0|  }
 3642|       |
 3643|  15.6k|  if ((nchunks > 0) && (nchunk >= nchunks)) {
  ------------------
  |  Branch (3643:7): [True: 15.6k, False: 0]
  |  Branch (3643:24): [True: 0, False: 15.6k]
  ------------------
 3644|      0|    BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') exceeds the number of chunks "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3645|      0|                    "('%" PRId64 "') in frame.", nchunk, nchunks);
 3646|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3647|      0|  }
 3648|       |
 3649|       |  // Get the offset to nchunk
 3650|  15.6k|  rc = get_coffset(frame, header_len, cbytes, nchunk, nchunks, &offset);
 3651|  15.6k|  if (rc < 0) {
  ------------------
  |  Branch (3651:7): [True: 66, False: 15.5k]
  ------------------
 3652|     66|    BLOSC_TRACE_ERROR("Unable to get offset to chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|     66|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     66|    do {                                            \
  |  |  |  |   98|     66|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     66|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 66, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     66|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3653|     66|    return rc;
 3654|     66|  }
 3655|       |
 3656|  15.5k|  if (offset < 0) {
  ------------------
  |  Branch (3656:7): [True: 2.50k, False: 13.0k]
  ------------------
 3657|       |    // Special value
 3658|  2.50k|    if (chunksize <= 0) {
  ------------------
  |  Branch (3658:9): [True: 0, False: 2.50k]
  ------------------
 3659|      0|      BLOSC_TRACE_ERROR("Cannot synthesize special chunk with chunksize <= 0.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3660|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3661|      0|    }
 3662|  2.50k|    chunk_cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 3663|  2.50k|    int32_t chunksize_ = chunksize;
 3664|  2.50k|    if ((nchunk == nchunks - 1) && (nbytes % chunksize)) {
  ------------------
  |  Branch (3664:9): [True: 0, False: 2.50k]
  |  Branch (3664:36): [True: 0, False: 0]
  ------------------
 3665|       |      // Last chunk is incomplete.  Compute its actual size.
 3666|      0|      chunksize_ = (int32_t) (nbytes % chunksize);
 3667|      0|    }
 3668|  2.50k|    rc = frame_special_chunk(offset, chunksize_, typesize, blocksize, chunk, chunk_cbytes, needs_free);
 3669|  2.50k|    if (rc < 0) {
  ------------------
  |  Branch (3669:9): [True: 10, False: 2.49k]
  ------------------
 3670|     10|      return rc;
 3671|     10|    }
 3672|  2.49k|    goto end;
 3673|  2.50k|  }
 3674|       |
 3675|  13.0k|  if (frame->sframe) {
  ------------------
  |  Branch (3675:7): [True: 0, False: 13.0k]
  ------------------
 3676|       |    // Sparse on-disk
 3677|      0|    nchunk = offset;
 3678|      0|    return sframe_get_chunk(frame, nchunk, chunk, needs_free);
 3679|      0|  }
 3680|       |
 3681|  13.0k|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 3682|  13.0k|  if (io_cb == NULL) {
  ------------------
  |  Branch (3682:7): [True: 0, False: 13.0k]
  ------------------
 3683|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3684|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 3685|      0|  }
 3686|       |
 3687|  13.0k|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3687:7): [True: 0, False: 13.0k]
  ------------------
 3688|      0|    uint8_t* header_ptr;
 3689|      0|    uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 3690|      0|    void* fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 3691|      0|    if (fp == NULL) {
  ------------------
  |  Branch (3691:9): [True: 0, False: 0]
  ------------------
 3692|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3693|      0|      return BLOSC2_ERROR_FILE_OPEN;
 3694|      0|    }
 3695|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3695:9): [True: 0, False: 0]
  ------------------
 3696|      0|      header_ptr = header;
 3697|      0|    int64_t io_pos = frame->file_offset + header_len + offset;
 3698|      0|    int64_t rbytes = io_cb->read((void**)&header_ptr, 1, sizeof(header), io_pos, fp);
 3699|      0|    if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3699:9): [True: 0, False: 0]
  ------------------
 3700|      0|      BLOSC_TRACE_ERROR("Cannot read the cbytes for chunk in the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3701|      0|      frame_reader_release(frame, io_cb, fp);
 3702|      0|      return BLOSC2_ERROR_FILE_READ;
 3703|      0|    }
 3704|      0|    rc = blosc2_cbuffer_sizes(header_ptr, NULL, &chunk_cbytes, NULL);
 3705|      0|    if (rc < 0) {
  ------------------
  |  Branch (3705:9): [True: 0, False: 0]
  ------------------
 3706|      0|      BLOSC_TRACE_ERROR("Cannot read the cbytes for chunk in the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3707|      0|      frame_reader_release(frame, io_cb, fp);
 3708|      0|      return rc;
 3709|      0|    }
 3710|      0|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3710:9): [True: 0, False: 0]
  ------------------
 3711|      0|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3711:9): [True: 0, False: 0]
  ------------------
 3712|      0|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (3712:9): [True: 0, False: 0]
  ------------------
 3713|      0|      BLOSC_TRACE_ERROR("Invalid chunk size in frame for chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3714|      0|      frame_reader_release(frame, io_cb, fp);
 3715|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3716|      0|    }
 3717|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3717:9): [True: 0, False: 0]
  ------------------
 3718|      0|      *chunk = malloc(chunk_cbytes);
 3719|      0|      if (*chunk == NULL) {
  ------------------
  |  Branch (3719:11): [True: 0, False: 0]
  ------------------
 3720|      0|        BLOSC_TRACE_ERROR("Cannot allocate memory for 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3721|      0|        frame_reader_release(frame, io_cb, fp);
 3722|      0|        return BLOSC2_ERROR_MEMORY_ALLOC;
 3723|      0|      }
 3724|      0|      *needs_free = true;
 3725|      0|    }
 3726|      0|    else {
 3727|      0|      *needs_free = false;
 3728|      0|    }
 3729|       |
 3730|      0|    io_pos = frame->file_offset + header_len + offset;
 3731|      0|    rbytes = io_cb->read((void**)chunk, 1, chunk_cbytes, io_pos, fp);
 3732|      0|    frame_reader_release(frame, io_cb, fp);
 3733|      0|    if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (3733:9): [True: 0, False: 0]
  ------------------
 3734|      0|      BLOSC_TRACE_ERROR("Cannot read the chunk out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3735|      0|      if (*needs_free) {
  ------------------
  |  Branch (3735:11): [True: 0, False: 0]
  ------------------
 3736|      0|        free(*chunk);
 3737|      0|        *chunk = NULL;
 3738|      0|        *needs_free = false;
 3739|      0|      }
 3740|      0|      return BLOSC2_ERROR_FILE_READ;
 3741|      0|    }
 3742|       |
 3743|  13.0k|  } else {
 3744|       |    // The chunk is in memory and just one pointer away
 3745|  13.0k|    *chunk = frame->cframe + header_len + offset;
 3746|  13.0k|    rc = blosc2_cbuffer_sizes(*chunk, NULL, &chunk_cbytes, NULL);
 3747|  13.0k|    if (rc < 0) {
  ------------------
  |  Branch (3747:9): [True: 8, False: 13.0k]
  ------------------
 3748|      8|      return rc;
 3749|      8|    }
 3750|  13.0k|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3750:9): [True: 1, False: 13.0k]
  ------------------
 3751|  13.0k|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3751:9): [True: 0, False: 13.0k]
  ------------------
 3752|  13.0k|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (3752:9): [True: 19, False: 13.0k]
  ------------------
 3753|     20|      BLOSC_TRACE_ERROR("Invalid chunk size in frame for chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3754|     20|      return BLOSC2_ERROR_INVALID_HEADER;
 3755|     20|    }
 3756|  13.0k|  }
 3757|       |
 3758|  15.5k|  end:
 3759|  15.5k|  return (int32_t)chunk_cbytes;
 3760|  13.0k|}
frame_get_lazychunk:
 3773|    731|int frame_get_lazychunk(blosc2_frame_s *frame, int64_t nchunk, uint8_t **chunk, bool *needs_free) {
 3774|    731|  int32_t header_len;
 3775|    731|  int64_t frame_len;
 3776|    731|  int64_t nbytes;
 3777|    731|  int64_t cbytes;
 3778|    731|  int32_t blocksize;
 3779|    731|  int32_t chunksize;
 3780|    731|  int64_t nchunks;
 3781|    731|  int32_t typesize;
 3782|    731|  int32_t lazychunk_cbytes;
 3783|    731|  int64_t offset;
 3784|    731|  void* fp = NULL;
 3785|    731|  int32_t* block_csizes = NULL;
 3786|    731|  struct csize_idx *csize_idx = NULL;
 3787|       |
 3788|    731|  *chunk = NULL;
 3789|    731|  *needs_free = false;
 3790|    731|  int rc = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 3791|    731|                           &blocksize, &chunksize, &nchunks,
 3792|    731|                           &typesize, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 3793|    731|                           frame->schunk->storage->io);
 3794|    731|  if (rc < 0) {
  ------------------
  |  Branch (3794:7): [True: 0, False: 731]
  ------------------
 3795|      0|    BLOSC_TRACE_ERROR("Unable to get meta info from 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3796|      0|    return rc;
 3797|      0|  }
 3798|    731|  rc = frame_refresh_if_stale(frame, frame_len);
 3799|    731|  if (rc < 0) {
  ------------------
  |  Branch (3799:7): [True: 0, False: 731]
  ------------------
 3800|      0|    BLOSC_TRACE_ERROR("Unable to refresh the frame state from disk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3801|      0|    return rc;
 3802|      0|  }
 3803|    731|  if (rc > 0) {
  ------------------
  |  Branch (3803:7): [True: 0, False: 731]
  ------------------
 3804|       |    // Keep the schunk-level counters in sync with the refreshed on-disk state
 3805|       |    // (see frame_get_chunk).
 3806|      0|    frame->schunk->nbytes = nbytes;
 3807|      0|    frame->schunk->cbytes = cbytes;
 3808|      0|    frame->schunk->nchunks = nchunks;
 3809|      0|  }
 3810|       |
 3811|    731|  if (nchunk >= nchunks) {
  ------------------
  |  Branch (3811:7): [True: 0, False: 731]
  ------------------
 3812|      0|    BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') exceeds the number of chunks "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3813|      0|                      "('%" PRId64 "') in frame.", nchunk, nchunks);
 3814|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3815|      0|  }
 3816|       |
 3817|       |  // Get the offset to nchunk
 3818|    731|  rc = get_coffset(frame, header_len, cbytes, nchunk, nchunks, &offset);
 3819|    731|  if (rc < 0) {
  ------------------
  |  Branch (3819:7): [True: 167, False: 564]
  ------------------
 3820|    167|    BLOSC_TRACE_ERROR("Unable to get offset to chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    167|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    167|    do {                                            \
  |  |  |  |   98|    167|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    167|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 167, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    167|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3821|    167|    return rc;
 3822|    167|  }
 3823|       |
 3824|    564|  if (offset < 0) {
  ------------------
  |  Branch (3824:7): [True: 376, False: 188]
  ------------------
 3825|       |    // Special value
 3826|    376|    if (chunksize <= 0) {
  ------------------
  |  Branch (3826:9): [True: 4, False: 372]
  ------------------
 3827|      4|      BLOSC_TRACE_ERROR("Cannot synthesize special chunk with chunksize <= 0.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3828|      4|      return BLOSC2_ERROR_INVALID_HEADER;
 3829|      4|    }
 3830|    372|    lazychunk_cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 3831|    372|    int32_t chunksize_ = chunksize;
 3832|    372|    if ((nchunk == nchunks - 1) && (nbytes % chunksize)) {
  ------------------
  |  Branch (3832:9): [True: 12, False: 360]
  |  Branch (3832:36): [True: 12, False: 0]
  ------------------
 3833|       |      // Last chunk is incomplete.  Compute its actual size.
 3834|     12|      chunksize_ = (int32_t) (nbytes % chunksize);
 3835|     12|    }
 3836|    372|    rc = frame_special_chunk(offset, chunksize_, typesize, blocksize, chunk,
 3837|    372|                             (int32_t)lazychunk_cbytes, needs_free);
 3838|    372|    goto end;
 3839|    376|  }
 3840|       |
 3841|    188|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 3842|    188|  if (io_cb == NULL) {
  ------------------
  |  Branch (3842:7): [True: 0, False: 188]
  ------------------
 3843|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3844|      0|    rc = BLOSC2_ERROR_PLUGIN_IO;
 3845|      0|    goto end;
 3846|      0|  }
 3847|       |
 3848|    188|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3848:7): [True: 0, False: 188]
  ------------------
 3849|       |    // TODO: make this portable across different endianness
 3850|       |    // Get info for building a lazy chunk
 3851|      0|    int32_t chunk_nbytes;
 3852|      0|    int32_t chunk_cbytes;
 3853|      0|    int32_t chunk_blocksize;
 3854|      0|    uint8_t* header_ptr;
 3855|      0|    uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 3856|      0|    int64_t io_pos = 0;
 3857|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3857:9): [True: 0, False: 0]
  ------------------
 3858|       |      // The chunk is not in the frame
 3859|      0|      fp = sframe_open_chunk(frame->urlpath, offset, "rb",
 3860|      0|                             frame->schunk->storage->io);
 3861|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3861:11): [True: 0, False: 0]
  ------------------
 3862|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3863|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3864|      0|      }
 3865|      0|    }
 3866|      0|    else {
 3867|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 3868|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3868:11): [True: 0, False: 0]
  ------------------
 3869|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3870|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3871|      0|      }
 3872|      0|      io_pos = frame->file_offset + header_len + offset;
 3873|      0|    }
 3874|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3874:9): [True: 0, False: 0]
  ------------------
 3875|      0|      header_ptr = header;
 3876|      0|    int64_t rbytes = io_cb->read((void**)&header_ptr, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 3877|      0|    if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3877:9): [True: 0, False: 0]
  ------------------
 3878|      0|      BLOSC_TRACE_ERROR("Cannot read the header for chunk in the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3879|      0|      rc = BLOSC2_ERROR_FILE_READ;
 3880|      0|      goto end;
 3881|      0|    }
 3882|      0|    rc = blosc2_cbuffer_sizes(header_ptr, &chunk_nbytes, &chunk_cbytes, &chunk_blocksize);
 3883|      0|    if (rc < 0) {
  ------------------
  |  Branch (3883:9): [True: 0, False: 0]
  ------------------
 3884|      0|      goto end;
 3885|      0|    }
 3886|      0|    if (chunk_nbytes < 0 || chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH || chunk_blocksize <= 0) {
  ------------------
  |  Branch (3886:9): [True: 0, False: 0]
  |  Branch (3886:29): [True: 0, False: 0]
  |  Branch (3886:76): [True: 0, False: 0]
  ------------------
 3887|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3888|      0|      goto end;
 3889|      0|    }
 3890|      0|    bool vlblocks = (header_ptr[BLOSC2_CHUNK_BLOSC2_FLAGS2] & BLOSC2_VL_BLOCKS) != 0;
 3891|      0|    size_t nblocks;
 3892|      0|    size_t leftover_block = 0;
 3893|      0|    if (vlblocks) {
  ------------------
  |  Branch (3893:9): [True: 0, False: 0]
  ------------------
 3894|      0|      nblocks = (size_t)chunk_blocksize;
 3895|      0|    }
 3896|      0|    else {
 3897|      0|      nblocks = (size_t)chunk_nbytes / (size_t)chunk_blocksize;
 3898|      0|      leftover_block = (size_t)chunk_nbytes % (size_t)chunk_blocksize;
 3899|      0|      if (leftover_block) {
  ------------------
  |  Branch (3899:11): [True: 0, False: 0]
  ------------------
 3900|      0|        if (nblocks == SIZE_MAX) {
  ------------------
  |  Branch (3900:13): [True: 0, False: 0]
  ------------------
 3901|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3902|      0|          goto end;
 3903|      0|        }
 3904|      0|        nblocks += 1;
 3905|      0|      }
 3906|      0|    }
 3907|      0|    if (nblocks == 0 || nblocks > (size_t)INT_MAX) {
  ------------------
  |  Branch (3907:9): [True: 0, False: 0]
  |  Branch (3907:25): [True: 0, False: 0]
  ------------------
 3908|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3909|      0|      goto end;
 3910|      0|    }
 3911|       |    // Allocate space for the lazy chunk
 3912|      0|    int32_t special_type = (header_ptr[BLOSC2_CHUNK_BLOSC2_FLAGS] >> 4) & BLOSC2_SPECIAL_MASK;
 3913|      0|    int memcpyed = header_ptr[BLOSC2_CHUNK_FLAGS] & (uint8_t) BLOSC_MEMCPYED;
 3914|       |
 3915|      0|    int32_t trailer_offset;
 3916|      0|    size_t streams_offset = BLOSC_EXTENDED_HEADER_LENGTH;
 3917|      0|    size_t trailer_offset_sz = BLOSC_EXTENDED_HEADER_LENGTH;
 3918|      0|    size_t trailer_len_sz = 0;
 3919|      0|    size_t lazychunk_cbytes_sz = 0;
 3920|      0|    size_t bstarts_nbytes = 0;
 3921|      0|    if (special_type == 0) {
  ------------------
  |  Branch (3921:9): [True: 0, False: 0]
  ------------------
 3922|      0|      if (nblocks > SIZE_MAX / sizeof(int32_t)) {
  ------------------
  |  Branch (3922:11): [True: 0, False: 0]
  ------------------
 3923|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3924|      0|        goto end;
 3925|      0|      }
 3926|      0|      bstarts_nbytes = nblocks * sizeof(int32_t);
 3927|       |
 3928|      0|      if (!memcpyed) {
  ------------------
  |  Branch (3928:11): [True: 0, False: 0]
  ------------------
 3929|      0|        if ((size_t)chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3929:13): [True: 0, False: 0]
  ------------------
 3930|      0|            bstarts_nbytes > (size_t)chunk_cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3930:13): [True: 0, False: 0]
  ------------------
 3931|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3932|      0|          goto end;
 3933|      0|        }
 3934|      0|      }
 3935|       |
 3936|      0|      if (bstarts_nbytes > SIZE_MAX - trailer_offset_sz) {
  ------------------
  |  Branch (3936:11): [True: 0, False: 0]
  ------------------
 3937|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3938|      0|        goto end;
 3939|      0|      }
 3940|      0|      trailer_offset_sz += bstarts_nbytes;
 3941|       |      // Regular values have offsets for blocks
 3942|      0|      if (!memcpyed) {
  ------------------
  |  Branch (3942:11): [True: 0, False: 0]
  ------------------
 3943|      0|        if (bstarts_nbytes > SIZE_MAX - streams_offset) {
  ------------------
  |  Branch (3943:13): [True: 0, False: 0]
  ------------------
 3944|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3945|      0|          goto end;
 3946|      0|        }
 3947|      0|        streams_offset += bstarts_nbytes;
 3948|      0|      }
 3949|       |
 3950|      0|      if (bstarts_nbytes > SIZE_MAX - (sizeof(int32_t) + sizeof(int64_t))) {
  ------------------
  |  Branch (3950:11): [True: 0, False: 0]
  ------------------
 3951|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3952|      0|        goto end;
 3953|      0|      }
 3954|      0|      trailer_len_sz = sizeof(int32_t) + sizeof(int64_t) + bstarts_nbytes;
 3955|      0|      if (trailer_len_sz > SIZE_MAX - trailer_offset_sz) {
  ------------------
  |  Branch (3955:11): [True: 0, False: 0]
  ------------------
 3956|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3957|      0|        goto end;
 3958|      0|      }
 3959|      0|      lazychunk_cbytes_sz = trailer_offset_sz + trailer_len_sz;
 3960|      0|    }
 3961|      0|    else if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (3961:14): [True: 0, False: 0]
  ------------------
 3962|      0|      if (typesize <= 0) {
  ------------------
  |  Branch (3962:11): [True: 0, False: 0]
  ------------------
 3963|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3964|      0|        goto end;
 3965|      0|      }
 3966|      0|      if ((size_t)typesize > SIZE_MAX - trailer_offset_sz ||
  ------------------
  |  Branch (3966:11): [True: 0, False: 0]
  ------------------
 3967|      0|          (size_t)typesize > SIZE_MAX - streams_offset) {
  ------------------
  |  Branch (3967:11): [True: 0, False: 0]
  ------------------
 3968|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3969|      0|        goto end;
 3970|      0|      }
 3971|      0|      trailer_offset_sz += (size_t)typesize;
 3972|      0|      streams_offset += (size_t)typesize;
 3973|      0|      lazychunk_cbytes_sz = trailer_offset_sz;
 3974|      0|    }
 3975|      0|    else {
 3976|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3977|      0|      goto end;
 3978|      0|    }
 3979|       |
 3980|      0|    if (streams_offset > (size_t)chunk_cbytes ||
  ------------------
  |  Branch (3980:9): [True: 0, False: 0]
  ------------------
 3981|      0|        trailer_offset_sz > INT32_MAX ||
  ------------------
  |  Branch (3981:9): [True: 0, False: 0]
  ------------------
 3982|      0|        trailer_len_sz > INT32_MAX ||
  ------------------
  |  Branch (3982:9): [True: 0, False: 0]
  ------------------
 3983|      0|        lazychunk_cbytes_sz > INT32_MAX) {
  ------------------
  |  Branch (3983:9): [True: 0, False: 0]
  ------------------
 3984|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3985|      0|      goto end;
 3986|      0|    }
 3987|       |
 3988|      0|    trailer_offset = (int32_t)trailer_offset_sz;
 3989|      0|    lazychunk_cbytes = (int32_t)lazychunk_cbytes_sz;
 3990|       |
 3991|       |    // Read just the full header and bstarts section too (lazy partial length)
 3992|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3992:9): [True: 0, False: 0]
  ------------------
 3993|      0|      io_pos = 0;
 3994|      0|    }
 3995|      0|    else {
 3996|      0|      io_pos = frame->file_offset + header_len + offset;
 3997|      0|    }
 3998|       |
 3999|       |    // The case here is a bit special because more memory is allocated than read from the file
 4000|       |    // and the chunk is modified after reading. Due to the modification, we cannot directly use
 4001|       |    // the memory provided by the io
 4002|      0|    *chunk = malloc((size_t)lazychunk_cbytes);
 4003|      0|    if (*chunk == NULL) {
  ------------------
  |  Branch (4003:9): [True: 0, False: 0]
  ------------------
 4004|      0|      rc = BLOSC2_ERROR_MEMORY_ALLOC;
 4005|      0|      goto end;
 4006|      0|    }
 4007|      0|    *needs_free = true;
 4008|       |
 4009|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (4009:9): [True: 0, False: 0]
  ------------------
 4010|      0|      rbytes = io_cb->read((void**)chunk, 1, (int64_t)streams_offset, io_pos, fp);
 4011|      0|    }
 4012|      0|    else {
 4013|      0|      uint8_t* chunk_ptr;
 4014|      0|      rbytes = io_cb->read((void**)&chunk_ptr, 1, (int64_t)streams_offset, io_pos, fp);
 4015|      0|      memcpy(*chunk, chunk_ptr, streams_offset);
 4016|      0|    }
 4017|       |
 4018|      0|    if (rbytes != (int64_t)streams_offset) {
  ------------------
  |  Branch (4018:9): [True: 0, False: 0]
  ------------------
 4019|      0|      BLOSC_TRACE_ERROR("Cannot read the (lazy) chunk out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4020|      0|      rc = BLOSC2_ERROR_FILE_READ;
 4021|      0|      goto end;
 4022|      0|    }
 4023|      0|    if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (4023:9): [True: 0, False: 0]
  ------------------
 4024|       |      // Value runlen is not returning a lazy chunk.  We are done.
 4025|      0|      goto end;
 4026|      0|    }
 4027|       |
 4028|       |    // Mark chunk as lazy
 4029|      0|    uint8_t* blosc2_flags = *chunk + BLOSC2_CHUNK_BLOSC2_FLAGS;
 4030|      0|    *blosc2_flags |= 0x08U;
 4031|       |
 4032|       |    // Add the trailer (currently, nchunk + offset + block_csizes)
 4033|      0|    if (frame->sframe) {
  ------------------
  |  Branch (4033:9): [True: 0, False: 0]
  ------------------
 4034|      0|      *(int32_t*)(*chunk + trailer_offset) = (int32_t)offset;   // offset is nchunk for sframes
 4035|      0|      *(int64_t*)(*chunk + trailer_offset + sizeof(int32_t)) = offset;
 4036|      0|    }
 4037|      0|    else {
 4038|      0|      *(int32_t*)(*chunk + trailer_offset) = (int32_t)nchunk;
 4039|      0|      *(int64_t*)(*chunk + trailer_offset + sizeof(int32_t)) = header_len + offset;
 4040|      0|    }
 4041|       |
 4042|      0|    block_csizes = malloc(nblocks * sizeof(int32_t));
 4043|      0|    if (block_csizes == NULL) {
  ------------------
  |  Branch (4043:9): [True: 0, False: 0]
  ------------------
 4044|      0|      rc = BLOSC2_ERROR_MEMORY_ALLOC;
 4045|      0|      goto end;
 4046|      0|    }
 4047|       |
 4048|      0|    if (memcpyed) {
  ------------------
  |  Branch (4048:9): [True: 0, False: 0]
  ------------------
 4049|       |      // When memcpyed the blocksizes are trivial to compute
 4050|      0|      for (size_t i = 0; i + 1 < nblocks; i++) {
  ------------------
  |  Branch (4050:26): [True: 0, False: 0]
  ------------------
 4051|      0|        block_csizes[i] = (int)chunk_blocksize;
 4052|      0|      }
 4053|       |      // The last block could be incomplete, mainly due to the fact that the block size is not divisible
 4054|       |      // by the typesize
 4055|      0|      block_csizes[nblocks - 1] = (int32_t)leftover_block ? (int32_t)leftover_block : chunk_blocksize;
  ------------------
  |  Branch (4055:35): [True: 0, False: 0]
  ------------------
 4056|      0|    }
 4057|      0|    else {
 4058|       |      // In regular, compressed chunks, we need to sort the bstarts (they can be out
 4059|       |      // of order because of multi-threading), and get a reverse index too.
 4060|      0|      memcpy(block_csizes, *chunk + BLOSC_EXTENDED_HEADER_LENGTH, nblocks * sizeof(int32_t));
 4061|       |      // Helper structure to keep track of original indexes
 4062|      0|      csize_idx = malloc(nblocks * sizeof(struct csize_idx));
 4063|      0|      if (csize_idx == NULL) {
  ------------------
  |  Branch (4063:11): [True: 0, False: 0]
  ------------------
 4064|      0|        rc = BLOSC2_ERROR_MEMORY_ALLOC;
 4065|      0|        goto end;
 4066|      0|      }
 4067|      0|      for (size_t n = 0; n < nblocks; n++) {
  ------------------
  |  Branch (4067:26): [True: 0, False: 0]
  ------------------
 4068|      0|        csize_idx[n].val = block_csizes[n];
 4069|      0|        csize_idx[n].idx = (int)n;
 4070|      0|      }
 4071|      0|      qsort(csize_idx, nblocks, sizeof(struct csize_idx), &sort_offset);
 4072|       |      // Compute the actual csizes
 4073|      0|      int idx;
 4074|      0|      for (size_t n = 0; n + 1 < nblocks; n++) {
  ------------------
  |  Branch (4074:26): [True: 0, False: 0]
  ------------------
 4075|      0|        idx = csize_idx[n].idx;
 4076|      0|        block_csizes[idx] = csize_idx[n + 1].val - csize_idx[n].val;
 4077|      0|      }
 4078|      0|      idx = csize_idx[nblocks - 1].idx;
 4079|      0|      block_csizes[idx] = chunk_cbytes - csize_idx[nblocks - 1].val;
 4080|      0|      free(csize_idx);
 4081|      0|      csize_idx = NULL;
 4082|      0|    }
 4083|       |    // Copy the csizes at the end of the trailer
 4084|      0|    void *trailer_csizes = *chunk + lazychunk_cbytes - nblocks * sizeof(int32_t);
 4085|      0|    memcpy(trailer_csizes, block_csizes, nblocks * sizeof(int32_t));
 4086|      0|    free(block_csizes);
 4087|      0|    block_csizes = NULL;
 4088|    188|  } else {
 4089|       |    // The chunk is in memory and just one pointer away
 4090|    188|    int64_t chunk_header_offset = header_len + offset;
 4091|    188|    int64_t chunk_cbytes_offset = chunk_header_offset + BLOSC_MIN_HEADER_LENGTH;
 4092|       |
 4093|    188|    *chunk = frame->cframe + chunk_header_offset;
 4094|       |
 4095|    188|    if (chunk_header_offset < 0 ||
  ------------------
  |  Branch (4095:9): [True: 0, False: 188]
  ------------------
 4096|    188|        chunk_cbytes_offset < chunk_header_offset ||
  ------------------
  |  Branch (4096:9): [True: 0, False: 188]
  ------------------
 4097|    188|        chunk_cbytes_offset > frame->len) {
  ------------------
  |  Branch (4097:9): [True: 0, False: 188]
  ------------------
 4098|      0|      BLOSC_TRACE_ERROR("Cannot read the header for chunk in the (contiguous) 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4099|      0|      rc = BLOSC2_ERROR_READ_BUFFER;
 4100|    188|    } else {
 4101|    188|      rc = blosc2_cbuffer_sizes(*chunk, NULL, &lazychunk_cbytes, NULL);
 4102|    188|      if (rc < 0) {
  ------------------
  |  Branch (4102:11): [True: 0, False: 188]
  ------------------
 4103|      0|        BLOSC_TRACE_ERROR("Cannot read the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4104|      0|        rc = BLOSC2_ERROR_READ_BUFFER;
 4105|      0|      }
 4106|    188|      else if (lazychunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (4106:16): [True: 1, False: 187]
  ------------------
 4107|    187|               chunk_header_offset > INT64_MAX - lazychunk_cbytes ||
  ------------------
  |  Branch (4107:16): [True: 0, False: 187]
  ------------------
 4108|    187|               chunk_header_offset + lazychunk_cbytes > frame_len) {
  ------------------
  |  Branch (4108:16): [True: 22, False: 165]
  ------------------
 4109|     23|        BLOSC_TRACE_ERROR("Compressed bytes exceed beyond frame length.");
  ------------------
  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4110|     23|        rc = BLOSC2_ERROR_READ_BUFFER;
 4111|     23|      }
 4112|    188|    }
 4113|    188|  }
 4114|       |
 4115|    560|  end:
 4116|    560|  if (csize_idx != NULL) {
  ------------------
  |  Branch (4116:7): [True: 0, False: 560]
  ------------------
 4117|      0|    free(csize_idx);
 4118|      0|  }
 4119|    560|  if (block_csizes != NULL) {
  ------------------
  |  Branch (4119:7): [True: 0, False: 560]
  ------------------
 4120|      0|    free(block_csizes);
 4121|      0|  }
 4122|    560|  if (fp != NULL) {
  ------------------
  |  Branch (4122:7): [True: 0, False: 560]
  ------------------
 4123|      0|    frame_reader_release(frame, io_cb, fp);
 4124|      0|  }
 4125|    560|  if (rc < 0) {
  ------------------
  |  Branch (4125:7): [True: 31, False: 529]
  ------------------
 4126|     31|    if (*needs_free) {
  ------------------
  |  Branch (4126:9): [True: 0, False: 31]
  ------------------
 4127|      0|      free(*chunk);
 4128|      0|      *chunk = NULL;
 4129|      0|      *needs_free = false;
 4130|      0|    }
 4131|     31|    return rc;
 4132|     31|  }
 4133|       |
 4134|    529|  return (int)lazychunk_cbytes;
 4135|    560|}
frame_decompress_chunk:
 5664|  15.6k|int frame_decompress_chunk(blosc2_context *dctx, blosc2_frame_s* frame, int64_t nchunk, void *dest, int32_t nbytes) {
 5665|  15.6k|  uint8_t* src = NULL;
 5666|  15.6k|  bool needs_free = false;
 5667|  15.6k|  int32_t srcsize;
 5668|  15.6k|  int32_t chunk_nbytes;
 5669|  15.6k|  int32_t chunk_cbytes;
 5670|  15.6k|  int rc;
 5671|       |
 5672|  15.6k|  rc = frame_get_chunk(frame, nchunk, &src, &needs_free);
 5673|  15.6k|  if (rc < 0) {
  ------------------
  |  Branch (5673:7): [True: 104, False: 15.5k]
  ------------------
 5674|    104|    BLOSC_TRACE_ERROR("Cannot get the chunk in position %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    104|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    104|    do {                                            \
  |  |  |  |   98|    104|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    104|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 104, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    104|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5675|    104|    goto end;
 5676|    104|  }
 5677|  15.5k|  srcsize = rc;
 5678|  15.5k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (5678:7): [True: 0, False: 15.5k]
  ------------------
 5679|      0|    BLOSC_TRACE_ERROR("Not enough input to read the header of chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5680|      0|    rc = BLOSC2_ERROR_READ_BUFFER;
 5681|      0|    goto end;
 5682|      0|  }
 5683|       |
 5684|  15.5k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 5685|  15.5k|  if (rc < 0) {
  ------------------
  |  Branch (5685:7): [True: 5, False: 15.5k]
  ------------------
 5686|      5|    goto end;
 5687|      5|  }
 5688|       |  /* The header cbytes is used as srcsize below, so it must fit in what was read */
 5689|  15.5k|  if (chunk_cbytes > srcsize) {
  ------------------
  |  Branch (5689:7): [True: 0, False: 15.5k]
  ------------------
 5690|      0|    BLOSC_TRACE_ERROR("Invalid chunk size in frame for chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5691|      0|    rc = BLOSC2_ERROR_INVALID_HEADER;
 5692|      0|    goto end;
 5693|      0|  }
 5694|       |
 5695|       |  /* Create a buffer for destination */
 5696|  15.5k|  if (chunk_nbytes > nbytes) {
  ------------------
  |  Branch (5696:7): [True: 16, False: 15.4k]
  ------------------
 5697|     16|    BLOSC_TRACE_ERROR("Not enough space for decompressing in dest.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5698|     16|    rc = BLOSC2_ERROR_WRITE_BUFFER;
 5699|     16|    goto end;
 5700|     16|  }
 5701|       |  /* And decompress it */
 5702|  15.4k|  dctx->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
 5703|  15.4k|  int chunksize = rc = blosc2_decompress_ctx(dctx, src, chunk_cbytes, dest, nbytes);
 5704|  15.4k|  if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (5704:7): [True: 302, False: 15.1k]
  |  Branch (5704:24): [True: 26, False: 15.1k]
  ------------------
 5705|    328|    BLOSC_TRACE_ERROR("Error in decompressing chunk.");
  ------------------
  |  |   93|    328|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    328|    do {                                            \
  |  |  |  |   98|    328|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    328|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 328, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    328|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5706|    328|    if (chunksize >= 0)
  ------------------
  |  Branch (5706:9): [True: 26, False: 302]
  ------------------
 5707|     26|      rc = BLOSC2_ERROR_FAILURE;
 5708|    328|  }
 5709|  15.6k|  end:
 5710|  15.6k|  if (needs_free) {
  ------------------
  |  Branch (5710:7): [True: 2.49k, False: 13.1k]
  ------------------
 5711|  2.49k|    free(src);
 5712|  2.49k|  }
 5713|  15.6k|  return rc;
 5714|  15.4k|}
frame.c:reader_cache_claim:
  128|     13|static bool reader_cache_claim(void) {
  129|     13|  bool claimed = false;
  130|     13|  blosc2_pthread_mutex_lock(&reader_cache_mutex);
  ------------------
  |  |   92|     13|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  131|     13|  if (reader_cache_count < reader_cache_max()) {
  ------------------
  |  Branch (131:7): [True: 13, False: 0]
  ------------------
  132|     13|    reader_cache_count++;
  133|     13|    claimed = true;
  134|     13|  }
  135|     13|  blosc2_pthread_mutex_unlock(&reader_cache_mutex);
  ------------------
  |  |   93|     13|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  136|     13|  return claimed;
  137|     13|}
frame.c:reader_cache_max:
  100|     13|static int reader_cache_max(void) {
  101|     13|  static int cached_max = -1;
  102|     13|  if (cached_max >= 0) {
  ------------------
  |  Branch (102:7): [True: 12, False: 1]
  ------------------
  103|     12|    return cached_max;
  104|     12|  }
  105|      1|  char* envvar = getenv("BLOSC_MAX_CACHED_READERS");
  106|      1|  if (envvar != NULL && envvar[0] != '\0') {
  ------------------
  |  Branch (106:7): [True: 0, False: 1]
  |  Branch (106:25): [True: 0, False: 0]
  ------------------
  107|      0|    long value = strtol(envvar, NULL, 10);
  108|      0|    if (value >= 0 && value <= INT_MAX) {
  ------------------
  |  Branch (108:9): [True: 0, False: 0]
  |  Branch (108:23): [True: 0, False: 0]
  ------------------
  109|      0|      cached_max = (int)value;
  110|      0|      return cached_max;
  111|      0|    }
  112|      0|  }
  113|      1|  cached_max = FRAME_READER_CACHE_MAX;
  ------------------
  |  |   89|      1|#define FRAME_READER_CACHE_MAX 96
  ------------------
  114|      1|  struct rlimit rl;
  115|      1|  if (getrlimit(RLIMIT_NOFILE, &rl) == 0 && rl.rlim_cur != RLIM_INFINITY) {
  ------------------
  |  Branch (115:7): [True: 1, False: 0]
  |  Branch (115:45): [True: 1, False: 0]
  ------------------
  116|      1|    rlim_t share = rl.rlim_cur / FRAME_READER_CACHE_SHARE;
  ------------------
  |  |   90|      1|#define FRAME_READER_CACHE_SHARE 16
  ------------------
  117|      1|    if (share < (rlim_t)cached_max) {
  ------------------
  |  Branch (117:9): [True: 1, False: 0]
  ------------------
  118|      1|      cached_max = (int)share;
  119|      1|    }
  120|      1|  }
  121|       |  /* A budget below FRAME_READER_CACHE_SHARE lands on 0, i.e. no caching at all;
  122|       |     that is the right answer there -- a descriptor held for a frame's lifetime
  123|       |     is exactly what such a process cannot spare. */
  124|      1|  return cached_max;
  125|      1|}
frame.c:reader_cache_return:
  139|     13|static void reader_cache_return(void) {
  140|     13|  blosc2_pthread_mutex_lock(&reader_cache_mutex);
  ------------------
  |  |   92|     13|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  141|     13|  if (reader_cache_count > 0) {
  ------------------
  |  Branch (141:7): [True: 13, False: 0]
  ------------------
  142|     13|    reader_cache_count--;
  143|     13|  }
  144|     13|  blosc2_pthread_mutex_unlock(&reader_cache_mutex);
  ------------------
  |  |   93|     13|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  145|     13|}
frame.c:frame_writer_close_locked:
  320|  9.02k|static void frame_writer_close_locked(blosc2_frame_s* frame) {
  321|  9.02k|  if (frame->write_fp != NULL) {
  ------------------
  |  Branch (321:7): [True: 0, False: 9.02k]
  ------------------
  322|       |    /* Only the filesystem backend ever populates write_fp */
  323|      0|    blosc2_stdio_close(frame->write_fp);
  324|      0|    frame->write_fp = NULL;
  325|      0|#if !defined(_WIN32)
  326|      0|    reader_cache_return();
  327|      0|#endif
  328|      0|  }
  329|       |  frame->write_fp_stale = false;
  330|  9.02k|  frame->file_end = 0;
  331|  9.02k|}
frame.c:frame_reader_close_locked:
  291|  9.02k|static bool frame_reader_close_locked(blosc2_frame_s* frame, bool force) {
  292|  9.02k|  if (frame->read_fp == NULL) {
  ------------------
  |  Branch (292:7): [True: 9.02k, False: 0]
  ------------------
  293|  9.02k|    return true;
  294|  9.02k|  }
  295|      0|  if (frame->read_fp_refs > 0 && !force) {
  ------------------
  |  Branch (295:7): [True: 0, False: 0]
  |  Branch (295:34): [True: 0, False: 0]
  ------------------
  296|       |    /* A caller up the stack is reading through it (frame_to_schunk holds it
  297|       |       across its whole chunk loop, and that loop re-enters get_header_info).
  298|       |       Closing it here would hand that caller a dangling handle, and its own
  299|       |       release would then close it a second time.  Leave it: the operation in
  300|       |       flight finishes on the file it started on, and the next revalidate --
  301|       |       past that release -- drops it. */
  302|      0|    return false;
  303|      0|  }
  304|       |  /* read_fp only ever comes from the filesystem backend, so close it directly:
  305|       |     blosc2_get_io_cb() would return NULL after a blosc2_destroy(), and then the
  306|       |     descriptor would leak while its cache slot got handed back anyway. */
  307|      0|  blosc2_stdio_close(frame->read_fp);
  308|      0|  frame->read_fp = NULL;
  309|      0|  frame->read_fp_refs = 0;
  310|      0|#if !defined(_WIN32)
  311|      0|  reader_cache_return();
  312|      0|#endif
  313|       |  return true;
  314|      0|}
frame.c:frame_alloc:
  197|  9.02k|static blosc2_frame_s* frame_alloc(void) {
  198|  9.02k|  blosc2_frame_s* frame = calloc(1, sizeof(blosc2_frame_s));
  199|  9.02k|  if (frame != NULL) {
  ------------------
  |  Branch (199:7): [True: 9.02k, False: 0]
  ------------------
  200|  9.02k|    blosc2_pthread_mutex_init(&frame->read_fp_mutex, NULL);
  ------------------
  |  |   90|  9.02k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
  201|  9.02k|  }
  202|  9.02k|  return frame;
  203|  9.02k|}
frame.c:frame_refresh_if_stale:
 1278|  16.3k|static int frame_refresh_if_stale(blosc2_frame_s *frame, int64_t frame_len_on_disk) {
 1279|  16.3k|  if (frame->cframe != NULL || frame->schunk == NULL ||
  ------------------
  |  Branch (1279:7): [True: 16.3k, False: 0]
  |  Branch (1279:32): [True: 0, False: 0]
  ------------------
 1280|  16.3k|      (!frame->force_refresh && frame_len_on_disk == frame->len)) {
  ------------------
  |  Branch (1280:8): [True: 0, False: 0]
  |  Branch (1280:33): [True: 0, False: 0]
  ------------------
 1281|  16.3k|    return 0;
 1282|  16.3k|  }
 1283|       |  // Saved so the metalayer-reload retry loop below can roll back to a fully
 1284|       |  // consistent state on exhaustion, rather than leaving frame->len/trailer_len
 1285|       |  // committed to the new value with no metalayers to match it.
 1286|      0|  int64_t old_len = frame->len;
 1287|      0|  uint32_t old_trailer_len = frame->trailer_len;
 1288|       |
 1289|      0|  if (frame_len_on_disk < FRAME_HEADER_MINLEN + FRAME_TRAILER_MINLEN) {
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                if (frame_len_on_disk < FRAME_HEADER_MINLEN + FRAME_TRAILER_MINLEN) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1289:7): [True: 0, False: 0]
  ------------------
 1290|      0|    BLOSC_TRACE_ERROR("Invalid on-disk frame length (%" PRId64 ").", frame_len_on_disk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1291|      0|    return BLOSC2_ERROR_FILE_READ;
 1292|      0|  }
 1293|       |
 1294|       |  // Read and validate the trailer *before* mutating any frame state below,
 1295|       |  // so a transient torn read (a writer without locking has no coordination
 1296|       |  // preventing a reader from landing mid-rewrite here -- the documented
 1297|       |  // SWMR-without-locking tradeoff) can be handled opportunistically: keep
 1298|       |  // the old cached view and let the next access retry, the same way
 1299|       |  // frame_check_stale()'s header read already does a few lines up in the
 1300|       |  // caller. Once frame->len/coffsets are overwritten below, a failure
 1301|       |  // partway through would leave the frame in a self-inconsistent state
 1302|       |  // (new length, stale trailer/offsets), so those mutations only happen
 1303|       |  // after the trailer is confirmed good.
 1304|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 1305|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (1305:7): [True: 0, False: 0]
  ------------------
 1306|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1307|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 1308|      0|  }
 1309|      0|  void* fp;
 1310|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1310:7): [True: 0, False: 0]
  ------------------
 1311|      0|    fp = sframe_open_index(frame->urlpath, "rb", frame->schunk->storage->io);
 1312|      0|  }
 1313|      0|  else {
 1314|      0|    fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 1315|      0|  }
 1316|      0|  if (fp == NULL) {
  ------------------
  |  Branch (1316:7): [True: 0, False: 0]
  ------------------
 1317|      0|    BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1318|      0|    return BLOSC2_ERROR_FILE_OPEN;
 1319|      0|  }
 1320|      0|  uint8_t trailer[FRAME_TRAILER_MINLEN];
 1321|      0|  uint8_t* trailer_ptr = trailer;
 1322|      0|  int64_t io_pos = frame->file_offset + frame_len_on_disk - FRAME_TRAILER_MINLEN;
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 1323|      0|  int64_t rbytes = io_cb->read((void**)&trailer_ptr, 1, FRAME_TRAILER_MINLEN, io_pos, fp);
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 1324|      0|  frame_reader_release(frame, io_cb, fp);
 1325|      0|  if (rbytes != FRAME_TRAILER_MINLEN) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1325:7): [True: 0, False: 0]
  ------------------
 1326|      0|    BLOSC_TRACE_ERROR("Cannot read the trailer out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1327|      0|    return 0;  // opportunistic: transient, keep the cached view, retry later
 1328|      0|  }
 1329|      0|  int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
                int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   59|      0|#define FRAME_TRAILER_LEN_OFFSET (22)  // offset to trailer length (counting from the end)
  ------------------
 1330|      0|  if (trailer_ptr[trailer_offset - 1] != 0xce) {
  ------------------
  |  Branch (1330:7): [True: 0, False: 0]
  ------------------
 1331|       |    // Not a valid trailer; most likely we are reading a frame in the middle of
 1332|       |    // being rewritten by another handle without locking (locked handles
 1333|       |    // fully serialize, so this only happens under the no-locking contract).
 1334|      0|    BLOSC_TRACE_ERROR("Invalid trailer in 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1335|      0|    return 0;  // opportunistic, same reasoning as above
 1336|      0|  }
 1337|      0|  uint32_t trailer_len;
 1338|      0|  from_big(&trailer_len, trailer_ptr + trailer_offset, sizeof(trailer_len));
  ------------------
  |  |   38|      0|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1339|      0|  if (trailer_len < FRAME_TRAILER_MINLEN || trailer_len > INT32_MAX ||
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1339:7): [True: 0, False: 0]
  |  Branch (1339:45): [True: 0, False: 0]
  ------------------
 1340|      0|      (int64_t)trailer_len > frame_len_on_disk - FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1340:7): [True: 0, False: 0]
  ------------------
 1341|      0|    BLOSC_TRACE_ERROR("Invalid trailer length (%" PRIu32 ") in frame.", trailer_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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1342|      0|    return 0;  // opportunistic, same reasoning as above
 1343|      0|  }
 1344|       |
 1345|       |  // Trailer confirmed good: now safe to commit the new length. The lock
 1346|       |  // generation counter (see frame_lock) may have flagged a mutation that
 1347|       |  // left the frame length unchanged; only clear that flag here, once a
 1348|       |  // refresh has actually happened -- clearing it earlier and then bailing
 1349|       |  // out opportunistically above would permanently lose a same-length
 1350|       |  // mutation notification on a torn-read retry. The cached offsets index is
 1351|       |  // dropped further down, only once the metalayer/vlmetalayer reload below
 1352|       |  // has actually succeeded -- neither of those touches frame->coffsets, so
 1353|       |  // deferring this keeps the old view of it fully intact for the
 1354|       |  // opportunistic rollback path below, exactly as strong as the trailer
 1355|       |  // read's own bail-outs above.
 1356|      0|  frame->force_refresh = false;
 1357|      0|  frame->len = frame_len_on_disk;
 1358|      0|  frame->file_end = 0;  // another handle wrote the file; its size is unknown again
 1359|      0|  frame->trailer_len = trailer_len;
 1360|       |
 1361|       |  // The header metalayers and trailer vlmetalayers were cached at open time;
 1362|       |  // reload them so metadata changes made by another handle (e.g. a b2nd shape
 1363|       |  // update) become visible too.  The guard protects against re-entering from
 1364|       |  // the reload path itself (get_header_info does not refresh, but cheap
 1365|       |  // insurance against future changes there).
 1366|       |  //
 1367|       |  // frame_get_metalayers()/frame_get_vlmetalayers() each do their own fully
 1368|       |  // independent header/trailer re-read (separate from the trailer read
 1369|       |  // above), so without locking they can hit the same transient torn-read
 1370|       |  // window. Unlike that trailer read, there's no way to validate first and
 1371|       |  // commit after: schunk_free_metalayers()/schunk_free_vlmetalayers() must
 1372|       |  // run before a reload attempt (the parsers write straight into
 1373|       |  // schunk->metalayers[]/vlmetalayers[] as they go), so a single failed
 1374|       |  // attempt already discards the old cached set. Retry a bounded number of
 1375|       |  // times -- both free helpers are NULL-safe and re-run cleanly against a
 1376|       |  // partial prior attempt, and each attempt is a fresh independent read, so
 1377|       |  // this self-heals once the writer's rewrite stabilizes.
 1378|       |  //
 1379|       |  // This reasoning only holds without locking, though: frame_check_stale()
 1380|       |  // (the only caller) holds the shared frame lock across this entire call
 1381|       |  // when frame->locking is set, which fully excludes writers for its
 1382|       |  // duration -- so under locking a reload failure here cannot be a torn
 1383|       |  // read, it is a genuine problem (corruption or a real I/O error), and
 1384|       |  // retrying 50 times would just waste ~50ms holding that shared lock
 1385|       |  // before silently masking it. Retry once (i.e. don't retry) and propagate
 1386|       |  // the error under locking; keep the opportunistic bounded retry + silent
 1387|       |  // rollback for the no-locking case only.
 1388|       |  //
 1389|       |  // On exhaustion in the no-locking case, roll back frame->len/trailer_len
 1390|       |  // to what they were before this call and force a full retry on the next
 1391|       |  // poll (frame->force_refresh = true) -- otherwise frame_len_on_disk ==
 1392|       |  // frame->len would short-circuit every subsequent call at the top of this
 1393|       |  // function, permanently stranding this handle with an empty metalayer set.
 1394|      0|  if (!frame->refreshing) {
  ------------------
  |  Branch (1394:7): [True: 0, False: 0]
  ------------------
 1395|      0|    frame->refreshing = true;
 1396|      0|    int rc = -1;
 1397|      0|    const int max_attempts = frame->locking ? 1 : 50;
  ------------------
  |  Branch (1397:30): [True: 0, False: 0]
  ------------------
 1398|      0|    for (int attempt = 0; attempt < max_attempts; attempt++) {
  ------------------
  |  Branch (1398:27): [True: 0, False: 0]
  ------------------
 1399|      0|      schunk_free_metalayers(frame->schunk);
 1400|      0|      rc = frame_get_metalayers(frame, frame->schunk);
 1401|      0|      if (rc >= 0) {
  ------------------
  |  Branch (1401:11): [True: 0, False: 0]
  ------------------
 1402|      0|        schunk_free_vlmetalayers(frame->schunk);
 1403|      0|        rc = frame_get_vlmetalayers(frame, frame->schunk);
 1404|      0|      }
 1405|      0|      if (rc >= 0 || attempt + 1 == max_attempts) {
  ------------------
  |  Branch (1405:11): [True: 0, False: 0]
  |  Branch (1405:22): [True: 0, False: 0]
  ------------------
 1406|      0|        break;
 1407|      0|      }
 1408|       |#if defined(_WIN32)
 1409|       |      Sleep(1);
 1410|       |#else
 1411|      0|      usleep(1000);
 1412|      0|#endif
 1413|      0|    }
 1414|      0|    frame->refreshing = false;
 1415|      0|    if (rc < 0) {
  ------------------
  |  Branch (1415:9): [True: 0, False: 0]
  ------------------
 1416|      0|      if (frame->locking) {
  ------------------
  |  Branch (1416:11): [True: 0, False: 0]
  ------------------
 1417|      0|        BLOSC_TRACE_ERROR("Cannot reload the metalayers from the refreshed 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1418|      0|                          "(locked handle: this is not a transient race).");
 1419|      0|        return rc;
 1420|      0|      }
 1421|      0|      BLOSC_TRACE_ERROR("Cannot reload the metalayers from the refreshed 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1422|      0|                        "after retries; rolling back to the previous cached view.");
 1423|      0|      frame->len = old_len;
 1424|      0|      frame->trailer_len = old_trailer_len;
 1425|      0|      frame->force_refresh = true;
 1426|      0|      return 0;
 1427|      0|    }
 1428|      0|  }
 1429|      0|  frame->schunk->change_tick++;
 1430|       |
 1431|       |  // Cached offsets index invalidated only now, after a fully successful
 1432|       |  // refresh: recomputed lazily from the fresh trailer on demand.
 1433|      0|  if (frame->coffsets != NULL) {
  ------------------
  |  Branch (1433:7): [True: 0, False: 0]
  ------------------
 1434|      0|    if (frame->coffsets_needs_free) {
  ------------------
  |  Branch (1434:9): [True: 0, False: 0]
  ------------------
 1435|      0|      free(frame->coffsets);
 1436|      0|    }
 1437|      0|    frame->coffsets = NULL;
 1438|      0|  }
 1439|       |
 1440|      0|  return 1;
 1441|      0|}
frame.c:get_coffsets_nbytes:
 1488|  4.65k|                               int32_t *coffsets_nbytes, const blosc2_io *io) {
 1489|  4.65k|  int32_t chunk_cbytes;
 1490|  4.65k|  int rc;
 1491|  4.65k|  int64_t off_pos = header_len;
 1492|  4.65k|  if (!frame->sframe) {
  ------------------
  |  Branch (1492:7): [True: 4.65k, False: 0]
  ------------------
 1493|  4.65k|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (1493:9): [True: 30, False: 4.62k]
  ------------------
 1494|     30|      off_pos += cbytes;
 1495|     30|    }
 1496|  4.65k|  }
 1497|       |
 1498|  4.65k|  if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (1498:7): [True: 0, False: 4.65k]
  |  Branch (1498:22): [True: 0, False: 4.65k]
  ------------------
 1499|  4.65k|      off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (1499:7): [True: 3, False: 4.65k]
  ------------------
 1500|      3|    BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1501|      3|    return BLOSC2_ERROR_INVALID_HEADER;
 1502|      3|  }
 1503|       |
 1504|  4.65k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (1504:7): [True: 4.65k, False: 0]
  ------------------
 1505|  4.65k|    uint8_t *off_start = frame->cframe + off_pos;
 1506|  4.65k|    rc = blosc2_cbuffer_sizes(off_start, coffsets_nbytes, &chunk_cbytes, NULL);
 1507|  4.65k|    if (rc < 0) {
  ------------------
  |  Branch (1507:9): [True: 1, False: 4.65k]
  ------------------
 1508|      1|      return rc;
 1509|      1|    }
 1510|  4.65k|    if (chunk_cbytes < 0 || off_pos + chunk_cbytes > frame->len) {
  ------------------
  |  Branch (1510:9): [True: 0, False: 4.65k]
  |  Branch (1510:29): [True: 7, False: 4.64k]
  ------------------
 1511|      7|      BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1512|      7|      return BLOSC2_ERROR_INVALID_HEADER;
 1513|      7|    }
 1514|  4.64k|    return 0;
 1515|  4.65k|  }
 1516|       |
 1517|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
 1518|      0|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + FRAME_TRAILER_MINLEN > frame->len) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1518:7): [True: 0, False: 0]
  |  Branch (1518:56): [True: 0, False: 0]
  ------------------
 1519|      0|    BLOSC_TRACE_ERROR("Cannot read the trailer out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1520|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1521|      0|  }
 1522|       |
 1523|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
 1524|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (1524:7): [True: 0, False: 0]
  ------------------
 1525|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1526|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 1527|      0|  }
 1528|       |
 1529|      0|  uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 1530|      0|  uint8_t *header_ptr = header;
 1531|      0|  void *fp = NULL;
 1532|      0|  int64_t io_pos = 0;
 1533|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1533:7): [True: 0, False: 0]
  ------------------
 1534|      0|    fp = sframe_open_index(frame->urlpath, "rb", io);
 1535|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1535:9): [True: 0, False: 0]
  ------------------
 1536|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1537|      0|      return BLOSC2_ERROR_FILE_OPEN;
 1538|      0|    }
 1539|      0|    io_pos = off_pos;
 1540|      0|  }
 1541|      0|  else {
 1542|      0|    fp = frame_reader_acquire(frame, io);
 1543|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1543:9): [True: 0, False: 0]
  ------------------
 1544|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1545|      0|      return BLOSC2_ERROR_FILE_OPEN;
 1546|      0|    }
 1547|      0|    io_pos = frame->file_offset + off_pos;
 1548|      0|  }
 1549|      0|  int64_t rbytes = io_cb->read((void**)&header_ptr, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 1550|      0|  frame_reader_release(frame, io_cb, fp);
 1551|      0|  if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (1551:7): [True: 0, False: 0]
  ------------------
 1552|      0|    BLOSC_TRACE_ERROR("Cannot read the offsets header out of the 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1553|      0|    return BLOSC2_ERROR_FILE_READ;
 1554|      0|  }
 1555|       |
 1556|      0|  rc = blosc2_cbuffer_sizes(header_ptr, coffsets_nbytes, &chunk_cbytes, NULL);
 1557|      0|  if (rc < 0) {
  ------------------
  |  Branch (1557:7): [True: 0, False: 0]
  ------------------
 1558|      0|    return rc;
 1559|      0|  }
 1560|       |
 1561|      0|  if (chunk_cbytes < 0 || off_pos + chunk_cbytes > trailer_offset) {
  ------------------
  |  Branch (1561:7): [True: 0, False: 0]
  |  Branch (1561:27): [True: 0, False: 0]
  ------------------
 1562|      0|    BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1563|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1564|      0|  }
 1565|       |
 1566|      0|  return 0;
 1567|      0|}
frame.c:get_meta_from_header:
 2617|    555|                                int32_t header_len) {
 2618|    555|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|    555|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 2619|    555|  int64_t header_pos = FRAME_IDX_SIZE;
  ------------------
  |  |   51|    555|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   50|    555|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|    555|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|    555|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   43|    555|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   42|    555|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   41|    555|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|    555|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|    555|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|    555|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|    555|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|    555|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|    555|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|    555|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|    555|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|    555|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2620|       |
 2621|       |  // Get the size for the index of metalayers
 2622|    555|  uint16_t idx_size;
 2623|    555|  header_pos += sizeof(idx_size);
 2624|    555|  if (header_len < header_pos) {
  ------------------
  |  Branch (2624:7): [True: 0, False: 555]
  ------------------
 2625|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2626|      0|  }
 2627|    555|  from_big(&idx_size, header + FRAME_IDX_SIZE, sizeof(idx_size));
  ------------------
  |  |   38|    555|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2628|       |
 2629|       |  // Get the actual index of metalayers
 2630|    555|  uint8_t* metalayers_idx = header + FRAME_IDX_SIZE + 2;
  ------------------
  |  |   51|    555|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   50|    555|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|    555|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|    555|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   43|    555|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   42|    555|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   41|    555|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|    555|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|    555|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|    555|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|    555|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|    555|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|    555|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|    555|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|    555|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|    555|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2631|    555|  header_pos += 1;
 2632|    555|  if (header_len < header_pos) {
  ------------------
  |  Branch (2632:7): [True: 0, False: 555]
  ------------------
 2633|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2634|      0|  }
 2635|    555|  if (metalayers_idx[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (2635:7): [True: 8, False: 547]
  ------------------
 2636|      8|    return BLOSC2_ERROR_DATA;
 2637|      8|  }
 2638|    547|  uint8_t* idxp = metalayers_idx + 1;
 2639|    547|  uint16_t nmetalayers;
 2640|    547|  header_pos += sizeof(nmetalayers);
 2641|    547|  if (header_len < header_pos) {
  ------------------
  |  Branch (2641:7): [True: 0, False: 547]
  ------------------
 2642|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2643|      0|  }
 2644|    547|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   38|    547|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2645|    547|  idxp += 2;
 2646|    547|  if (nmetalayers > BLOSC2_MAX_METALAYERS) {
  ------------------
  |  | 1789|    547|#define BLOSC2_MAX_METALAYERS 16
  ------------------
  |  Branch (2646:7): [True: 4, False: 543]
  ------------------
 2647|      4|    return BLOSC2_ERROR_DATA;
 2648|      4|  }
 2649|    543|  schunk->nmetalayers = nmetalayers;
 2650|       |
 2651|       |  // Populate the metalayers and its serialized values
 2652|    543|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2652:28): [True: 20, False: 523]
  ------------------
 2653|     20|    header_pos += 1;
 2654|     20|    if (header_len < header_pos) {
  ------------------
  |  Branch (2654:9): [True: 0, False: 20]
  ------------------
 2655|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2656|      0|    }
 2657|     20|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (2657:9): [True: 2, False: 18]
  ------------------
 2658|      2|      return BLOSC2_ERROR_DATA;
 2659|      2|    }
 2660|     18|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 2661|     18|    if (metalayer == NULL) {
  ------------------
  |  Branch (2661:9): [True: 0, False: 18]
  ------------------
 2662|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2663|      0|    }
 2664|     18|    schunk->metalayers[nmetalayer] = metalayer;
 2665|       |
 2666|       |    // Populate the metalayer string
 2667|     18|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 2668|     18|    idxp += 1;
 2669|     18|    header_pos += nslen;
 2670|     18|    if (header_len < header_pos) {
  ------------------
  |  Branch (2670:9): [True: 0, False: 18]
  ------------------
 2671|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2672|      0|    }
 2673|     18|    char* ns = malloc((size_t)nslen + 1);
 2674|     18|    if (ns == NULL) {
  ------------------
  |  Branch (2674:9): [True: 0, False: 18]
  ------------------
 2675|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2676|      0|    }
 2677|     18|    memcpy(ns, idxp, nslen);
 2678|     18|    ns[nslen] = '\0';
 2679|     18|    idxp += nslen;
 2680|     18|    metalayer->name = ns;
 2681|       |
 2682|       |    // Populate the serialized value for this metalayer
 2683|       |    // Get the offset
 2684|     18|    header_pos += 1;
 2685|     18|    if (header_len < header_pos) {
  ------------------
  |  Branch (2685:9): [True: 0, False: 18]
  ------------------
 2686|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2687|      0|    }
 2688|     18|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (2688:9): [True: 3, False: 15]
  ------------------
 2689|      3|      return BLOSC2_ERROR_DATA;
 2690|      3|    }
 2691|     15|    idxp += 1;
 2692|     15|    int32_t offset;
 2693|     15|    header_pos += sizeof(offset);
 2694|     15|    if (header_len < header_pos) {
  ------------------
  |  Branch (2694:9): [True: 0, False: 15]
  ------------------
 2695|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2696|      0|    }
 2697|     15|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   38|     15|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2698|     15|    idxp += 4;
 2699|     15|    if (offset < 0 || offset >= header_len) {
  ------------------
  |  Branch (2699:9): [True: 0, False: 15]
  |  Branch (2699:23): [True: 9, False: 6]
  ------------------
 2700|       |      // Offset is less than zero or exceeds header length
 2701|      9|      return BLOSC2_ERROR_DATA;
 2702|      9|    }
 2703|       |    // Go to offset and see if we have the correct marker
 2704|      6|    uint8_t* content_marker = header + offset;
 2705|      6|    if ((int64_t)header_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (2705:9): [True: 1, False: 5]
  ------------------
 2706|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2707|      1|    }
 2708|      5|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (2708:9): [True: 1, False: 4]
  ------------------
 2709|      1|      return BLOSC2_ERROR_DATA;
 2710|      1|    }
 2711|       |
 2712|       |    // Read the size of the content
 2713|      4|    int32_t content_len;
 2714|      4|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   38|      4|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2715|      4|    if (content_len < 0) {
  ------------------
  |  Branch (2715:9): [True: 0, False: 4]
  ------------------
 2716|      0|      return BLOSC2_ERROR_DATA;
 2717|      0|    }
 2718|      4|    metalayer->content_len = content_len;
 2719|       |
 2720|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 2721|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 2722|       |    // bounds check, which would let memcpy below read past the header buffer.
 2723|      4|    if ((int64_t)header_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (2723:9): [True: 4, False: 0]
  ------------------
 2724|      4|      return BLOSC2_ERROR_READ_BUFFER;
 2725|      4|    }
 2726|      0|    char* content = malloc((size_t)content_len);
 2727|       |    // malloc(0) is allowed to return NULL, and blosc2_meta_add accepts
 2728|       |    // content_len == 0, so only treat NULL as an allocation failure when
 2729|       |    // a non-zero allocation was requested.
 2730|      0|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (2730:9): [True: 0, False: 0]
  |  Branch (2730:28): [True: 0, False: 0]
  ------------------
 2731|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2732|      0|    }
 2733|      0|    if (content_len > 0) {
  ------------------
  |  Branch (2733:9): [True: 0, False: 0]
  ------------------
 2734|      0|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 2735|      0|    }
 2736|      0|    metalayer->content = (uint8_t*)content;
 2737|      0|  }
 2738|       |
 2739|    523|  return 1;
 2740|    543|}
frame.c:get_vlmeta_from_trailer:
 2820|    522|                                   int32_t trailer_len) {
 2821|       |
 2822|    522|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|    522|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 2823|    522|  int64_t trailer_pos = FRAME_TRAILER_VLMETALAYERS + 2;
  ------------------
  |  |   60|    522|#define FRAME_TRAILER_VLMETALAYERS (2)
  ------------------
 2824|    522|  uint8_t* idxp = trailer + trailer_pos;
 2825|       |
 2826|       |  // Get the size for the index of metalayers
 2827|    522|  trailer_pos += 2;
 2828|    522|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2828:7): [True: 0, False: 522]
  ------------------
 2829|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2830|      0|  }
 2831|    522|  uint16_t idx_size;
 2832|    522|  from_big(&idx_size, idxp, sizeof(idx_size));
  ------------------
  |  |   38|    522|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2833|    522|  idxp += 2;
 2834|       |
 2835|    522|  trailer_pos += 1;
 2836|       |  // Get the actual index of metalayers
 2837|    522|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2837:7): [True: 0, False: 522]
  ------------------
 2838|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2839|      0|  }
 2840|    522|  if (idxp[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (2840:7): [True: 7, False: 515]
  ------------------
 2841|      7|    return BLOSC2_ERROR_DATA;
 2842|      7|  }
 2843|    515|  idxp += 1;
 2844|       |
 2845|       |  // The on-wire encoding is unsigned (uint16 follows the msgpack `0xde`
 2846|       |  // map16 marker), but `schunk->nvlmetalayers` is int16_t. Decoding into a
 2847|       |  // signed local would let raw bytes like 0xff 0xff slip past the
 2848|       |  // `> BLOSC2_MAX_VLMETALAYERS` ceiling as a negative count, after which
 2849|       |  // a later `blosc2_vlmeta_add` would write through `vlmetalayers[-1]`
 2850|       |  // and corrupt adjacent schunk fields. Decode unsigned, then narrow.
 2851|    515|  uint16_t nmetalayers;
 2852|    515|  trailer_pos += sizeof(nmetalayers);
 2853|    515|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2853:7): [True: 0, False: 515]
  ------------------
 2854|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2855|      0|  }
 2856|    515|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   38|    515|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2857|    515|  idxp += 2;
 2858|    515|  if (nmetalayers > BLOSC2_MAX_VLMETALAYERS) {
  ------------------
  |  | 1795|    515|#define BLOSC2_MAX_VLMETALAYERS (8 * 1024)
  ------------------
  |  Branch (2858:7): [True: 0, False: 515]
  ------------------
 2859|      0|    return BLOSC2_ERROR_DATA;
 2860|      0|  }
 2861|    515|  schunk->nvlmetalayers = (int16_t)nmetalayers;
 2862|       |
 2863|       |  // Populate the metalayers and its serialized values
 2864|    882|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2864:28): [True: 397, False: 485]
  ------------------
 2865|    397|    trailer_pos += 1;
 2866|    397|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2866:9): [True: 0, False: 397]
  ------------------
 2867|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2868|      0|    }
 2869|    397|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (2869:9): [True: 1, False: 396]
  ------------------
 2870|      1|      return BLOSC2_ERROR_DATA;
 2871|      1|    }
 2872|    396|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 2873|    396|    if (metalayer == NULL) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 396]
  ------------------
 2874|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2875|      0|    }
 2876|    396|    schunk->vlmetalayers[nmetalayer] = metalayer;
 2877|       |
 2878|       |    // Populate the metalayer string
 2879|    396|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 2880|    396|    idxp += 1;
 2881|    396|    trailer_pos += nslen;
 2882|    396|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2882:9): [True: 0, False: 396]
  ------------------
 2883|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2884|      0|    }
 2885|    396|    char* ns = malloc((size_t)nslen + 1);
 2886|    396|    if (ns == NULL) {
  ------------------
  |  Branch (2886:9): [True: 0, False: 396]
  ------------------
 2887|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2888|      0|    }
 2889|    396|    memcpy(ns, idxp, nslen);
 2890|    396|    ns[nslen] = '\0';
 2891|    396|    idxp += nslen;
 2892|    396|    metalayer->name = ns;
 2893|       |
 2894|       |    // Populate the serialized value for this metalayer
 2895|       |    // Get the offset
 2896|    396|    trailer_pos += 1;
 2897|    396|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2897:9): [True: 0, False: 396]
  ------------------
 2898|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2899|      0|    }
 2900|    396|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (2900:9): [True: 2, False: 394]
  ------------------
 2901|      2|      return BLOSC2_ERROR_DATA;
 2902|      2|    }
 2903|    394|    idxp += 1;
 2904|    394|    int32_t offset;
 2905|    394|    trailer_pos += sizeof(offset);
 2906|    394|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2906:9): [True: 0, False: 394]
  ------------------
 2907|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2908|      0|    }
 2909|    394|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   38|    394|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2910|    394|    idxp += 4;
 2911|    394|    if (offset < 0 || offset >= trailer_len) {
  ------------------
  |  Branch (2911:9): [True: 6, False: 388]
  |  Branch (2911:23): [True: 9, False: 379]
  ------------------
 2912|       |      // Offset is less than zero or exceeds trailer length
 2913|     15|      return BLOSC2_ERROR_DATA;
 2914|     15|    }
 2915|       |    // Go to offset and see if we have the correct marker
 2916|    379|    uint8_t* content_marker = trailer + offset;
 2917|    379|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (2917:9): [True: 1, False: 378]
  ------------------
 2918|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2919|      1|    }
 2920|    378|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (2920:9): [True: 3, False: 375]
  ------------------
 2921|      3|      return BLOSC2_ERROR_DATA;
 2922|      3|    }
 2923|       |
 2924|       |    // Read the size of the content
 2925|    375|    int32_t content_len;
 2926|    375|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   38|    375|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2927|    375|    if (content_len < 0) {
  ------------------
  |  Branch (2927:9): [True: 7, False: 368]
  ------------------
 2928|      7|      return BLOSC2_ERROR_DATA;
 2929|      7|    }
 2930|    368|    metalayer->content_len = content_len;
 2931|       |
 2932|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 2933|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 2934|       |    // bounds check, which would let memcpy below read past the trailer buffer.
 2935|    368|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (2935:9): [True: 1, False: 367]
  ------------------
 2936|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2937|      1|    }
 2938|    367|    char* content = malloc((size_t)content_len);
 2939|       |    // Same zero-length carve-out as in get_meta_from_header: malloc(0) may
 2940|       |    // return NULL on some platforms, and the public API allows
 2941|       |    // content_len == 0, so don't reject a valid empty vlmetalayer.
 2942|    367|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (2942:9): [True: 365, False: 2]
  |  Branch (2942:28): [True: 0, False: 365]
  ------------------
 2943|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2944|      0|    }
 2945|    367|    if (content_len > 0) {
  ------------------
  |  Branch (2945:9): [True: 365, False: 2]
  ------------------
 2946|    365|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 2947|    365|    }
 2948|    367|    metalayer->content = (uint8_t*)content;
 2949|    367|  }
 2950|    485|  return 1;
 2951|    515|}
frame.c:validate_offsets_chunk:
 3109|  8.97k|                                  int64_t nchunks) {
 3110|  8.97k|  int32_t coffsets_cbytes = 0;
 3111|  8.97k|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 3112|  8.97k|  if (coffsets == NULL) {
  ------------------
  |  Branch (3112:7): [True: 18, False: 8.95k]
  ------------------
 3113|     18|    BLOSC_TRACE_ERROR("Cannot get compressed offsets from frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3114|     18|    return BLOSC2_ERROR_DATA;
 3115|     18|  }
 3116|       |
 3117|  8.95k|  int32_t offsets_nbytes;
 3118|  8.95k|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (3118:7): [True: 0, False: 8.95k]
  ------------------
 3119|      0|    BLOSC_TRACE_ERROR("Too many chunks for offsets representation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3120|      0|    return BLOSC2_ERROR_FAILURE;
 3121|      0|  }
 3122|       |
 3123|  8.95k|  int64_t* offsets = (int64_t*)malloc((size_t)offsets_nbytes);
 3124|  8.95k|  if (offsets == NULL) {
  ------------------
  |  Branch (3124:7): [True: 0, False: 8.95k]
  ------------------
 3125|      0|    BLOSC_TRACE_ERROR("Cannot allocate memory for offsets validation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3126|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 3127|      0|  }
 3128|       |
 3129|  8.95k|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 3130|  8.95k|  blosc2_context* dctx = blosc2_create_dctx(off_dparams);
 3131|  8.95k|  if (dctx == NULL) {
  ------------------
  |  Branch (3131:7): [True: 0, False: 8.95k]
  ------------------
 3132|      0|    free(offsets);
 3133|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3134|      0|    return BLOSC2_ERROR_FAILURE;
 3135|      0|  }
 3136|       |
 3137|  8.95k|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 3138|  8.95k|                                             offsets, offsets_nbytes);
 3139|  8.95k|  blosc2_free_ctx(dctx);
 3140|  8.95k|  if (off_nbytes != offsets_nbytes) {
  ------------------
  |  Branch (3140:7): [True: 8.21k, False: 740]
  ------------------
 3141|  8.21k|    free(offsets);
 3142|  8.21k|    BLOSC_TRACE_ERROR("Cannot decompress offsets chunk.");
  ------------------
  |  |   93|  8.21k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  8.21k|    do {                                            \
  |  |  |  |   98|  8.21k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  8.21k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8.21k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  8.21k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3143|  8.21k|    return BLOSC2_ERROR_DATA;
 3144|  8.21k|  }
 3145|       |
 3146|   581M|  for (int64_t i = 0; i < nchunks; ++i) {
  ------------------
  |  Branch (3146:23): [True: 581M, False: 731]
  ------------------
 3147|   581M|    int64_t offset = offsets[i];
 3148|   581M|    if (offset < 0) {
  ------------------
  |  Branch (3148:9): [True: 3.19M, False: 578M]
  ------------------
 3149|  3.19M|      continue;
 3150|  3.19M|    }
 3151|   578M|    if (offset > INT64_MAX - header_len || offset > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3151:9): [True: 0, False: 578M]
  |  Branch (3151:44): [True: 9, False: 578M]
  ------------------
 3152|      9|      free(offsets);
 3153|      9|      BLOSC_TRACE_ERROR("Offset for chunk %" PRId64 " is out of bounds.", i);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3154|      9|      return BLOSC2_ERROR_INVALID_HEADER;
 3155|      9|    }
 3156|       |    /* Offsets do not need to be monotonic.  Frame mutations like insert can append
 3157|       |     * chunk payloads at the end of the cframe while updating the logical chunk order
 3158|       |     * only in the offsets table, so a valid frame may legitimately contain
 3159|       |     * non-monotonic non-negative offsets.
 3160|       |     */
 3161|   578M|  }
 3162|       |
 3163|    731|  free(offsets);
 3164|    731|  return 0;
 3165|    740|}

blosc2_schunk_get_cparams:
   71|  9.00k|int blosc2_schunk_get_cparams(blosc2_schunk *schunk, blosc2_cparams **cparams) {
   72|  9.00k|  *cparams = calloc(1, sizeof(blosc2_cparams));
   73|  9.00k|  (*cparams)->schunk = schunk;
   74|  63.0k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (74:19): [True: 54.0k, False: 9.00k]
  ------------------
   75|  54.0k|    (*cparams)->filters[i] = schunk->filters[i];
   76|  54.0k|    (*cparams)->filters_meta[i] = schunk->filters_meta[i];
   77|  54.0k|  }
   78|  9.00k|  (*cparams)->compcode = schunk->compcode;
   79|  9.00k|  (*cparams)->compcode_meta = schunk->compcode_meta;
   80|  9.00k|  (*cparams)->clevel = schunk->clevel;
   81|  9.00k|  (*cparams)->typesize = schunk->typesize;
   82|  9.00k|  (*cparams)->blocksize = schunk->blocksize;
   83|  9.00k|  (*cparams)->splitmode = schunk->splitmode;
   84|  9.00k|  (*cparams)->use_dict = schunk->use_dict;
   85|  9.00k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (85:7): [True: 9.00k, False: 0]
  ------------------
   86|  9.00k|    (*cparams)->nthreads = blosc2_get_nthreads();
   87|  9.00k|  }
   88|      0|  else {
   89|      0|    (*cparams)->nthreads = (int16_t)schunk->cctx->nthreads;
   90|      0|  }
   91|  9.00k|  return 0;
   92|  9.00k|}
blosc2_schunk_get_dparams:
   96|  9.00k|int blosc2_schunk_get_dparams(blosc2_schunk *schunk, blosc2_dparams **dparams) {
   97|  9.00k|  *dparams = calloc(1, sizeof(blosc2_dparams));
   98|  9.00k|  (*dparams)->schunk = schunk;
   99|  9.00k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (99:7): [True: 9.00k, False: 0]
  ------------------
  100|  9.00k|    (*dparams)->nthreads = blosc2_get_nthreads();
  101|  9.00k|  }
  102|      0|  else {
  103|      0|    (*dparams)->nthreads = schunk->dctx->nthreads;
  104|      0|  }
  105|  9.00k|  return 0;
  106|  9.00k|}
schunk_free_metalayers:
  666|  9.02k|void schunk_free_metalayers(blosc2_schunk *schunk) {
  667|  9.08k|  for (int i = 0; i < schunk->nmetalayers; i++) {
  ------------------
  |  Branch (667:19): [True: 62, False: 9.02k]
  ------------------
  668|     62|    if (schunk->metalayers[i] != NULL) {
  ------------------
  |  Branch (668:9): [True: 18, False: 44]
  ------------------
  669|     18|      free(schunk->metalayers[i]->name);
  670|     18|      free(schunk->metalayers[i]->content);
  671|     18|      free(schunk->metalayers[i]);
  672|       |      schunk->metalayers[i] = NULL;
  673|     18|    }
  674|     62|  }
  675|  9.02k|  schunk->nmetalayers = 0;
  676|  9.02k|}
schunk_free_vlmetalayers:
  679|  9.02k|void schunk_free_vlmetalayers(blosc2_schunk *schunk) {
  680|  22.1k|  for (int i = 0; i < schunk->nvlmetalayers; i++) {
  ------------------
  |  Branch (680:19): [True: 13.1k, False: 9.02k]
  ------------------
  681|  13.1k|    if (schunk->vlmetalayers[i] != NULL) {
  ------------------
  |  Branch (681:9): [True: 396, False: 12.7k]
  ------------------
  682|    396|      free(schunk->vlmetalayers[i]->name);
  683|    396|      free(schunk->vlmetalayers[i]->content);
  684|    396|      free(schunk->vlmetalayers[i]);
  685|       |      schunk->vlmetalayers[i] = NULL;
  686|    396|    }
  687|  13.1k|  }
  688|  9.02k|  schunk->nvlmetalayers = 0;
  689|  9.02k|}
blosc2_schunk_free:
  692|  9.02k|int blosc2_schunk_free(blosc2_schunk *schunk) {
  693|  9.02k|  int err = 0;
  694|       |
  695|       |  // If it is a view, the data belongs to original array and should not be freed
  696|  9.02k|  if (schunk->data != NULL && !schunk->view) {
  ------------------
  |  Branch (696:7): [True: 0, False: 9.02k]
  |  Branch (696:31): [True: 0, False: 0]
  ------------------
  697|      0|    for (int i = 0; i < schunk->nchunks; i++) {
  ------------------
  |  Branch (697:21): [True: 0, False: 0]
  ------------------
  698|      0|      free(schunk->data[i]);
  699|      0|    }
  700|      0|    free(schunk->data);
  701|      0|  }
  702|  9.02k|  if (schunk->cctx != NULL)
  ------------------
  |  Branch (702:7): [True: 9.00k, False: 19]
  ------------------
  703|  9.00k|    blosc2_free_ctx(schunk->cctx);
  704|  9.02k|  if (schunk->dctx != NULL)
  ------------------
  |  Branch (704:7): [True: 9.00k, False: 19]
  ------------------
  705|  9.00k|    blosc2_free_ctx(schunk->dctx);
  706|  9.02k|  if (schunk->blockshape != NULL)
  ------------------
  |  Branch (706:7): [True: 0, False: 9.02k]
  ------------------
  707|      0|    free(schunk->blockshape);
  708|       |
  709|  9.02k|  schunk_free_metalayers(schunk);
  710|       |
  711|  9.02k|  if (schunk->storage != NULL) {
  ------------------
  |  Branch (711:7): [True: 9.00k, False: 19]
  ------------------
  712|  9.00k|    blosc2_io_cb *io_cb = blosc2_get_io_cb(schunk->storage->io->id);
  713|  9.00k|    if (io_cb != NULL) {
  ------------------
  |  Branch (713:9): [True: 9.00k, False: 0]
  ------------------
  714|  9.00k|      int rc = io_cb->destroy(schunk->storage->io->params);
  715|  9.00k|      if (rc < 0) {
  ------------------
  |  Branch (715:11): [True: 0, False: 9.00k]
  ------------------
  716|      0|        BLOSC_TRACE_ERROR("Could not free the I/O resources.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|      0|        err = 1;
  718|      0|      }
  719|  9.00k|    }
  720|       |
  721|  9.00k|    if (schunk->storage->urlpath != NULL) {
  ------------------
  |  Branch (721:9): [True: 0, False: 9.00k]
  ------------------
  722|      0|      free(schunk->storage->urlpath);
  723|      0|    }
  724|  9.00k|    free(schunk->storage->cparams);
  725|  9.00k|    free(schunk->storage->dparams);
  726|  9.00k|    free(schunk->storage->io);
  727|  9.00k|    free(schunk->storage);
  728|  9.00k|  }
  729|       |
  730|       |  // If it is a view, the frame belongs to original array and should not be freed
  731|  9.02k|  if (schunk->frame != NULL && !schunk->view) {
  ------------------
  |  Branch (731:7): [True: 9.02k, False: 0]
  |  Branch (731:32): [True: 9.02k, False: 0]
  ------------------
  732|  9.02k|    frame_free((blosc2_frame_s *) schunk->frame);
  733|  9.02k|  }
  734|       |
  735|  9.02k|  schunk_free_vlmetalayers(schunk);
  736|       |
  737|  9.02k|  free(schunk);
  738|       |
  739|  9.02k|  return err;
  740|  9.02k|}
blosc2_schunk_from_buffer:
  744|  9.07k|blosc2_schunk* blosc2_schunk_from_buffer(uint8_t *cframe, int64_t len, bool copy) {
  745|       |  // Check that the buffer actually comes from a cframe
  746|  9.07k|  if (cframe == NULL || len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  9.07k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  9.07k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  9.07k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  9.07k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  9.07k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  9.07k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  9.07k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  9.07k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  9.07k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  9.07k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  9.07k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  9.07k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  9.07k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  9.07k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (746:7): [True: 0, False: 9.07k]
  |  Branch (746:25): [True: 0, False: 9.07k]
  ------------------
  747|      0|    return NULL;
  748|      0|  }
  749|  9.07k|  char *magic_number = (char *)cframe + FRAME_HEADER_MAGIC;
  ------------------
  |  |   29|  9.07k|#define FRAME_HEADER_MAGIC 2
  ------------------
  750|  9.07k|  if (memcmp(magic_number, "b2frame", sizeof("b2frame")) != 0) {
  ------------------
  |  Branch (750:7): [True: 51, False: 9.02k]
  ------------------
  751|     51|    return NULL;
  752|     51|  }
  753|  9.02k|  blosc2_frame_s* frame = frame_from_cframe(cframe, len, false);
  754|  9.02k|  if (frame == NULL) {
  ------------------
  |  Branch (754:7): [True: 5, False: 9.02k]
  ------------------
  755|      5|    return NULL;
  756|      5|  }
  757|  9.02k|  blosc2_schunk* schunk = frame_to_schunk(frame, copy, &BLOSC2_IO_DEFAULTS);
  758|  9.02k|  if (schunk && copy) {
  ------------------
  |  Branch (758:7): [True: 485, False: 8.53k]
  |  Branch (758:17): [True: 0, False: 485]
  ------------------
  759|       |    // Super-chunk has its own copy of frame
  760|      0|    frame_free(frame);
  761|      0|  }
  762|  9.02k|  return schunk;
  763|  9.02k|}
blosc2_schunk_decompress_chunk:
 1544|  15.6k|                                   void *dest, int32_t nbytes) {
 1545|  15.6k|  int rc = validate_nchunk(schunk, nchunk, false, "blosc2_schunk_decompress_chunk");
 1546|  15.6k|  if (rc < 0) {
  ------------------
  |  Branch (1546:7): [True: 0, False: 15.6k]
  ------------------
 1547|      0|    return rc;
 1548|      0|  }
 1549|       |
 1550|  15.6k|  int32_t chunk_nbytes;
 1551|  15.6k|  int32_t chunk_cbytes;
 1552|  15.6k|  int chunksize;
 1553|  15.6k|  blosc2_frame_s* frame = (blosc2_frame_s*)schunk->frame;
 1554|       |
 1555|  15.6k|  schunk->current_nchunk = nchunk;
 1556|  15.6k|  if (frame == NULL) {
  ------------------
  |  Branch (1556:7): [True: 0, False: 15.6k]
  ------------------
 1557|      0|    uint8_t* src = schunk->data[nchunk];
 1558|      0|    if (src == 0) {
  ------------------
  |  Branch (1558:9): [True: 0, False: 0]
  ------------------
 1559|      0|      return 0;
 1560|      0|    }
 1561|       |
 1562|      0|    rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1563|      0|    if (rc < 0) {
  ------------------
  |  Branch (1563:9): [True: 0, False: 0]
  ------------------
 1564|      0|      return rc;
 1565|      0|    }
 1566|       |
 1567|      0|    if (nbytes < chunk_nbytes) {
  ------------------
  |  Branch (1567:9): [True: 0, False: 0]
  ------------------
 1568|      0|      BLOSC_TRACE_ERROR("Buffer size is too small for the decompressed 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1569|      0|                        "('%d' bytes, but '%d' are needed).", nbytes, chunk_nbytes);
 1570|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1571|      0|    }
 1572|       |
 1573|      0|    chunksize = blosc2_decompress_ctx(schunk->dctx, src, chunk_cbytes, dest, nbytes);
 1574|      0|    if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (1574:9): [True: 0, False: 0]
  |  Branch (1574:26): [True: 0, False: 0]
  ------------------
 1575|      0|      BLOSC_TRACE_ERROR("Error in decompressing 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1576|      0|      if (chunksize < 0)
  ------------------
  |  Branch (1576:11): [True: 0, False: 0]
  ------------------
 1577|      0|        return chunksize;
 1578|      0|      return BLOSC2_ERROR_FAILURE;
 1579|      0|    }
 1580|  15.6k|  } else {
 1581|  15.6k|    rc = frame_lock(frame, false);
 1582|  15.6k|    if (rc < 0) {
  ------------------
  |  Branch (1582:9): [True: 0, False: 15.6k]
  ------------------
 1583|      0|      return rc;
 1584|      0|    }
 1585|  15.6k|    chunksize = frame_decompress_chunk(schunk->dctx, frame, nchunk, dest, nbytes);
 1586|  15.6k|    frame_unlock(frame);
 1587|  15.6k|    if (chunksize < 0) {
  ------------------
  |  Branch (1587:9): [True: 453, False: 15.1k]
  ------------------
 1588|    453|      return chunksize;
 1589|    453|    }
 1590|  15.6k|  }
 1591|  15.1k|  return chunksize;
 1592|  15.6k|}
schunk.c:validate_nchunk:
   45|  15.6k|static int validate_nchunk(blosc2_schunk *schunk, int64_t nchunk, bool allow_end, const char *func_name) {
   46|  15.6k|  if (nchunk < 0) {
  ------------------
  |  Branch (46:7): [True: 0, False: 15.6k]
  ------------------
   47|      0|    BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') is negative in %s.", nchunk, func_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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|      0|    return BLOSC2_ERROR_INVALID_PARAM;
   49|      0|  }
   50|       |
   51|  15.6k|  if (allow_end) {
  ------------------
  |  Branch (51:7): [True: 0, False: 15.6k]
  ------------------
   52|      0|    if (nchunk > schunk->nchunks) {
  ------------------
  |  Branch (52:9): [True: 0, False: 0]
  ------------------
   53|      0|      BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') is out of range [0, %" PRId64 "] in %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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|      0|                        nchunk, schunk->nchunks, func_name);
   55|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   56|      0|    }
   57|      0|  }
   58|  15.6k|  else {
   59|  15.6k|    if (nchunk >= schunk->nchunks) {
  ------------------
  |  Branch (59:9): [True: 0, False: 15.6k]
  ------------------
   60|      0|      BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') exceeds the number of chunks "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   61|      0|                        "('%" PRId64 "') in %s.", nchunk, schunk->nchunks, func_name);
   62|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   63|      0|    }
   64|  15.6k|  }
   65|       |
   66|  15.6k|  return BLOSC2_ERROR_SUCCESS;
   67|  15.6k|}

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

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

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

blosc2_unshuffle:
  436|  39.3k|                 const void* src, void* dest) {
  437|       |  /* Initialize the shuffle implementation if necessary. */
  438|  39.3k|  init_shuffle_implementation();
  439|       |
  440|  39.3k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (440:7): [True: 0, False: 39.3k]
  |  Branch (440:23): [True: 0, False: 39.3k]
  |  Branch (440:41): [True: 0, False: 39.3k]
  ------------------
  441|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  442|      0|  }
  443|       |
  444|       |  /* The implementation is initialized.
  445|       |     Dispatch to it's unshuffle routine. */
  446|  39.3k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  447|       |
  448|  39.3k|  return blocksize;
  449|  39.3k|}
bitunshuffle:
  484|  32.7k|                     const uint8_t format_version) {
  485|       |  /* Initialize the shuffle implementation if necessary. */
  486|  32.7k|  init_shuffle_implementation();
  487|  32.7k|  size_t size = blocksize / typesize;
  488|       |
  489|  32.7k|  if (format_version == 2) {
  ------------------
  |  Branch (489:7): [True: 3.75k, False: 28.9k]
  ------------------
  490|       |    /* Starting from version 3, bitshuffle() works differently */
  491|  3.75k|    if ((size % 8) == 0) {
  ------------------
  |  Branch (491:9): [True: 1.24k, False: 2.50k]
  ------------------
  492|       |      /* The number of elems is a multiple of 8 which is supported by
  493|       |         bitshuffle. */
  494|  1.24k|      int ret = (int) (host_implementation.bitunshuffle)
  495|  1.24k|          ((const void *) src, (void *) dest, blocksize / typesize, typesize);
  496|  1.24k|      if (ret < 0) {
  ------------------
  |  Branch (496:11): [True: 0, False: 1.24k]
  ------------------
  497|       |        // Some error in bitshuffle (should not happen)
  498|      0|        BLOSC_TRACE_ERROR("the impossible happened: the bitunshuffle filter failed!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|      0|        return ret;
  500|      0|      }
  501|       |      /* Copy the leftovers (the bytes that do not make up a whole element), as
  502|       |         Blosc1 does when it writes them after the shuffled part. */
  503|  1.24k|      size_t offset = size * typesize;
  504|  1.24k|      memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  505|  1.24k|    }
  506|  2.50k|    else {
  507|  2.50k|      memcpy(dest, src, blocksize);
  508|  2.50k|    }
  509|  3.75k|  }
  510|  28.9k|  else {
  511|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  512|  28.9k|    size -= size % 8;
  513|  28.9k|    int ret = (int) (host_implementation.bitunshuffle)(src, dest, size, typesize);
  514|  28.9k|    if (ret < 0) {
  ------------------
  |  Branch (514:9): [True: 0, False: 28.9k]
  ------------------
  515|      0|      BLOSC_TRACE_ERROR("the impossible happened: the bitunshuffle filter failed!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  516|      0|      return ret;
  517|      0|    }
  518|       |
  519|       |    /* Copy the leftovers */
  520|  28.9k|    size_t offset = size * typesize;
  521|  28.9k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  522|  28.9k|  }
  523|       |
  524|  32.7k|  return blocksize;
  525|  32.7k|}
shuffle.c:init_shuffle_implementation:
  391|  72.1k|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|  72.1k|#if defined(__GNUC__) || defined(__clang__)
  401|  72.1k|  if (__builtin_expect(!implementation_initialized, 0)) {
  ------------------
  |  Branch (401:7): [True: 1, False: 72.1k]
  ------------------
  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|  72.1k|}
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|}

blosc_stune_next_blocksize:
   47|  2.86k|int blosc_stune_next_blocksize(blosc2_context *context) {
   48|  2.86k|  int32_t clevel = context->clevel;
   49|  2.86k|  int32_t typesize = context->typesize;
   50|  2.86k|  int32_t nbytes = context->sourcesize;
   51|  2.86k|  int32_t user_blocksize = context->blocksize;
   52|  2.86k|  int32_t blocksize = nbytes;
   53|       |
   54|       |  // Protection against very small buffers
   55|  2.86k|  if (nbytes < typesize) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.86k]
  ------------------
   56|      0|    context->blocksize = 1;
   57|      0|    return BLOSC2_ERROR_SUCCESS;
   58|      0|  }
   59|       |
   60|  2.86k|  int splitmode = split_block(context, typesize, blocksize);
   61|  2.86k|  if (user_blocksize) {
  ------------------
  |  Branch (61:7): [True: 1.84k, False: 1.02k]
  ------------------
   62|  1.84k|    blocksize = user_blocksize;
   63|  1.84k|    goto last;
   64|  1.84k|  }
   65|       |
   66|  1.02k|  if (nbytes >= L1) {
  ------------------
  |  |   19|  1.02k|#define L1 (32 * 1024)
  ------------------
  |  Branch (66:7): [True: 1.02k, False: 0]
  ------------------
   67|  1.02k|    blocksize = L1;
  ------------------
  |  |   19|  1.02k|#define L1 (32 * 1024)
  ------------------
   68|       |
   69|       |    /* For HCR codecs, increase the block sizes by a factor of 2 because they
   70|       |        are meant for compressing large blocks (i.e. they show a big overhead
   71|       |        when compressing small ones). */
   72|  1.02k|    if (is_HCR(context)) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.02k]
  ------------------
   73|      0|      blocksize *= 2;
   74|      0|    }
   75|       |
   76|       |    // Choose a different blocksize depending on the compression level
   77|  1.02k|    switch (clevel) {
   78|      0|      case 0:
  ------------------
  |  Branch (78:7): [True: 0, False: 1.02k]
  ------------------
   79|       |        // Case of plain copy
   80|      0|        blocksize /= 4;
   81|      0|        break;
   82|      0|      case 1:
  ------------------
  |  Branch (82:7): [True: 0, False: 1.02k]
  ------------------
   83|      0|        blocksize /= 2;
   84|      0|        break;
   85|      0|      case 2:
  ------------------
  |  Branch (85:7): [True: 0, False: 1.02k]
  ------------------
   86|      0|        blocksize *= 1;
   87|      0|        break;
   88|      0|      case 3:
  ------------------
  |  Branch (88:7): [True: 0, False: 1.02k]
  ------------------
   89|      0|        blocksize *= 2;
   90|      0|        break;
   91|      0|      case 4:
  ------------------
  |  Branch (91:7): [True: 0, False: 1.02k]
  ------------------
   92|  1.02k|      case 5:
  ------------------
  |  Branch (92:7): [True: 1.02k, False: 0]
  ------------------
   93|  1.02k|        blocksize *= 4;
   94|  1.02k|        break;
   95|      0|      case 6:
  ------------------
  |  Branch (95:7): [True: 0, False: 1.02k]
  ------------------
   96|      0|      case 7:
  ------------------
  |  Branch (96:7): [True: 0, False: 1.02k]
  ------------------
   97|      0|      case 8:
  ------------------
  |  Branch (97:7): [True: 0, False: 1.02k]
  ------------------
   98|      0|        blocksize *= 8;
   99|      0|        break;
  100|      0|      case 9:
  ------------------
  |  Branch (100:7): [True: 0, False: 1.02k]
  ------------------
  101|       |        // Do not exceed 256 KB for non HCR codecs
  102|      0|        blocksize *= 8;
  103|      0|        if (is_HCR(context)) {
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|          blocksize *= 2;
  105|      0|        }
  106|      0|        break;
  107|      0|      default:
  ------------------
  |  Branch (107:7): [True: 0, False: 1.02k]
  ------------------
  108|      0|        break;
  109|  1.02k|    }
  110|  1.02k|  }
  111|       |
  112|       |  /* Now the blocksize for splittable codecs */
  113|  1.02k|  if (clevel > 0 && splitmode) {
  ------------------
  |  Branch (113:7): [True: 1.02k, False: 0]
  |  Branch (113:21): [True: 585, False: 435]
  ------------------
  114|       |    // For performance reasons, do not exceed 256 KB (it must fit in L2 cache)
  115|    585|    switch (clevel) {
  116|      0|      case 1:
  ------------------
  |  Branch (116:7): [True: 0, False: 585]
  ------------------
  117|      0|      case 2:
  ------------------
  |  Branch (117:7): [True: 0, False: 585]
  ------------------
  118|      0|      case 3:
  ------------------
  |  Branch (118:7): [True: 0, False: 585]
  ------------------
  119|      0|        blocksize = 32 * 1024;
  120|      0|        break;
  121|      0|      case 4:
  ------------------
  |  Branch (121:7): [True: 0, False: 585]
  ------------------
  122|    585|      case 5:
  ------------------
  |  Branch (122:7): [True: 585, False: 0]
  ------------------
  123|    585|      case 6:
  ------------------
  |  Branch (123:7): [True: 0, False: 585]
  ------------------
  124|    585|        blocksize = 64 * 1024;
  125|    585|        break;
  126|      0|      case 7:
  ------------------
  |  Branch (126:7): [True: 0, False: 585]
  ------------------
  127|      0|        blocksize = 128 * 1024;
  128|      0|        break;
  129|      0|      case 8:
  ------------------
  |  Branch (129:7): [True: 0, False: 585]
  ------------------
  130|      0|        blocksize = 256 * 1024;
  131|      0|        break;
  132|      0|      case 9:
  ------------------
  |  Branch (132:7): [True: 0, False: 585]
  ------------------
  133|      0|      default:
  ------------------
  |  Branch (133:7): [True: 0, False: 585]
  ------------------
  134|      0|        blocksize = 512 * 1024;
  135|      0|        break;
  136|    585|    }
  137|       |    // Multiply by typesize to get proper split sizes
  138|    585|    blocksize *= typesize;
  139|       |    // But do not exceed 4 MB per thread (having this capacity in L3 is normal in modern CPUs)
  140|    585|    if (blocksize > 4 * 1024 * 1024) {
  ------------------
  |  Branch (140:9): [True: 0, False: 585]
  ------------------
  141|      0|      blocksize = 4 * 1024 * 1024;
  142|      0|    }
  143|    585|    if (blocksize < 32 * 1024) {
  ------------------
  |  Branch (143:9): [True: 0, False: 585]
  ------------------
  144|       |      /* Do not use a too small blocksize (< 32 KB) when typesize is small */
  145|      0|      blocksize = 32 * 1024;
  146|      0|    }
  147|    585|  }
  148|       |
  149|  2.86k|  last:
  150|       |  /* Check that blocksize is not too large */
  151|  2.86k|  if (blocksize > nbytes) {
  ------------------
  |  Branch (151:7): [True: 1.59k, False: 1.27k]
  ------------------
  152|  1.59k|    blocksize = nbytes;
  153|  1.59k|  }
  154|       |
  155|       |  // blocksize *must absolutely* be a multiple of the typesize
  156|  2.86k|  if (blocksize > typesize) {
  ------------------
  |  Branch (156:7): [True: 2.50k, False: 359]
  ------------------
  157|  2.50k|    blocksize = blocksize / typesize * typesize;
  158|  2.50k|  }
  159|       |
  160|  2.86k|  context->blocksize = blocksize;
  161|  2.86k|  BLOSC_INFO("compcode: %d, clevel: %d, blocksize: %d, splitmode: %d, typesize: %d",
  ------------------
  |  |  121|  2.86k|    do {                                            \
  |  |  122|  2.86k|        const char *__e = getenv("BLOSC_INFO");     \
  |  |  123|  2.86k|        if (!__e) { break; }                        \
  |  |  ------------------
  |  |  |  Branch (123:13): [True: 2.86k, False: 0]
  |  |  ------------------
  |  |  124|  2.86k|        fprintf(stderr, "[INFO] - " msg "\n", ##__VA_ARGS__); \
  |  |  125|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (125:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  162|  2.86k|             context->compcode, context->clevel, blocksize, splitmode, typesize);
  163|       |
  164|  2.86k|  return BLOSC2_ERROR_SUCCESS;
  165|  1.02k|}
split_block:
  190|  2.86k|int split_block(blosc2_context *context, int32_t typesize, int32_t blocksize) {
  191|  2.86k|  if (context->blosc1_format &&
  ------------------
  |  Branch (191:7): [True: 0, False: 2.86k]
  ------------------
  192|      0|      (typesize > MAX_STREAMS || (blocksize / typesize) < BLOSC1_MIN_SPLIT_ELEMENTS)) {
  ------------------
  |  |   24|      0|#define MAX_STREAMS 16 /* Cannot be larger than 128 */
  ------------------
                    (typesize > MAX_STREAMS || (blocksize / typesize) < BLOSC1_MIN_SPLIT_ELEMENTS)) {
  ------------------
  |  |  188|      0|#define BLOSC1_MIN_SPLIT_ELEMENTS 128
  ------------------
  |  Branch (192:8): [True: 0, False: 0]
  |  Branch (192:34): [True: 0, False: 0]
  ------------------
  193|       |    // A C-Blosc 1.x reader would not split this block whatever the flag says
  194|      0|    return 0;
  195|      0|  }
  196|  2.86k|  switch (context->splitmode) {
  197|      0|    case BLOSC_ALWAYS_SPLIT:
  ------------------
  |  Branch (197:5): [True: 0, False: 2.86k]
  ------------------
  198|      0|      return 1;
  199|      0|    case BLOSC_NEVER_SPLIT:
  ------------------
  |  Branch (199:5): [True: 0, False: 2.86k]
  ------------------
  200|      0|      return 0;
  201|  2.86k|    case BLOSC_FORWARD_COMPAT_SPLIT:
  ------------------
  |  Branch (201:5): [True: 2.86k, False: 0]
  ------------------
  202|  2.86k|    case BLOSC_AUTO_SPLIT:
  ------------------
  |  Branch (202:5): [True: 0, False: 2.86k]
  ------------------
  203|       |      // These cases will be handled later
  204|  2.86k|      break;
  205|      0|    default:
  ------------------
  |  Branch (205:5): [True: 0, False: 2.86k]
  ------------------
  206|      0|      BLOSC_TRACE_WARNING("Unrecognized split mode.  Default to BLOSC_FORWARD_COMPAT_SPLIT");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  2.86k|  }
  208|       |
  209|  2.86k|  int compcode = context->compcode;
  210|  2.86k|  if (compcode == BLOSC_CODEC_OPENZL) {
  ------------------
  |  Branch (210:7): [True: 0, False: 2.86k]
  ------------------
  211|       |    // Never split blocks for OpenZL, as it has its own block mechanisms
  212|      0|    return 0;
  213|      0|  }
  214|  2.86k|  return (
  215|       |          // Fast codecs like blosclz, lz4 seems to prefer to split
  216|  2.86k|          ((compcode == BLOSC_BLOSCLZ) || (compcode == BLOSC_LZ4)
  ------------------
  |  Branch (216:12): [True: 2.86k, False: 0]
  |  Branch (216:43): [True: 0, False: 0]
  ------------------
  217|       |            // and low levels of zstd too
  218|      0|            || ((compcode == BLOSC_ZSTD) && (context->clevel <= 5))
  ------------------
  |  Branch (218:17): [True: 0, False: 0]
  |  Branch (218:45): [True: 0, False: 0]
  ------------------
  219|  2.86k|            ) &&
  220|       |          // ...but split seems to harm cratio too much when not using shuffle
  221|  2.86k|          (context->filter_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (221:11): [True: 2.86k, False: 0]
  ------------------
  222|  2.86k|          (typesize <= MAX_STREAMS) &&
  ------------------
  |  |   24|  2.86k|#define MAX_STREAMS 16 /* Cannot be larger than 128 */
  ------------------
  |  Branch (222:11): [True: 2.36k, False: 499]
  ------------------
  223|  2.36k|          (blocksize / typesize) >= BLOSC_MIN_BUFFERSIZE);
  ------------------
  |  Branch (223:11): [True: 2.36k, False: 1]
  ------------------
  224|  2.86k|}
stune.c:is_HCR:
   21|  1.02k|static bool is_HCR(blosc2_context * context) {
   22|  1.02k|  switch (context->compcode) {
   23|  1.02k|    case BLOSC_BLOSCLZ :
  ------------------
  |  Branch (23:5): [True: 1.02k, False: 0]
  ------------------
   24|  1.02k|      return false;
   25|      0|    case BLOSC_LZ4 :
  ------------------
  |  Branch (25:5): [True: 0, False: 1.02k]
  ------------------
   26|       |      // return (context->filter_flags & BLOSC_DOBITSHUFFLE) ? true : false;
   27|       |      // Do not treat LZ4 differently than BloscLZ here
   28|      0|      return false;
   29|      0|    case BLOSC_LZ4HC :
  ------------------
  |  Branch (29:5): [True: 0, False: 1.02k]
  ------------------
   30|      0|    case BLOSC_ZLIB :
  ------------------
  |  Branch (30:5): [True: 0, False: 1.02k]
  ------------------
   31|      0|    case BLOSC_ZSTD :
  ------------------
  |  Branch (31:5): [True: 0, False: 1.02k]
  ------------------
   32|      0|      return true;
   33|      0|    default :
  ------------------
  |  Branch (33:5): [True: 0, False: 1.02k]
  ------------------
   34|       |      return false;
   35|  1.02k|  }
   36|  1.02k|}

blosc2.c:print_error:
  525|      5|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|      5|  return (char *) blosc2_error_string(rc);
  528|      5|}
ndcell.c:blosc2_meta_get:
 2494|      1|                                  int32_t *content_len) {
 2495|      1|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2495:7): [True: 0, False: 1]
  |  Branch (2495:25): [True: 0, False: 1]
  |  Branch (2495:41): [True: 0, False: 1]
  |  Branch (2495:60): [True: 0, False: 1]
  ------------------
 2496|      0|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2498|      0|  }
 2499|       |
 2500|      1|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2501|      1|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2501:7): [True: 1, False: 0]
  ------------------
 2502|      1|    BLOSC_TRACE_WARNING("Metalayer \"%s\" not found.", name);
  ------------------
  |  |   94|      1|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|      1|    return nmetalayer;
 2504|      1|  }
 2505|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2506|      0|  if (len < 0) {
  ------------------
  |  Branch (2506:7): [True: 0, False: 0]
  ------------------
 2507|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2508|      0|    return BLOSC2_ERROR_DATA;
 2509|      0|  }
 2510|      0|  *content_len = len;
 2511|      0|  if (len == 0) {
  ------------------
  |  Branch (2511:7): [True: 0, False: 0]
  ------------------
 2512|      0|    *content = NULL;
 2513|      0|    return nmetalayer;
 2514|      0|  }
 2515|      0|  *content = (uint8_t*)malloc((size_t)len);
 2516|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2516:7): [True: 0, False: 0]
  ------------------
 2517|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2518|      0|    *content_len = 0;
 2519|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2520|      0|  }
 2521|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2521:7): [True: 0, False: 0]
  |  Branch (2521:18): [True: 0, False: 0]
  ------------------
 2522|      0|    free(*content);
 2523|      0|    *content = NULL;
 2524|      0|    *content_len = 0;
 2525|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|      0|    return BLOSC2_ERROR_DATA;
 2527|      0|  }
 2528|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2529|      0|  return nmetalayer;
 2530|      0|}
ndcell.c:blosc2_meta_exists:
 2425|      1|static inline int blosc2_meta_exists(blosc2_schunk *schunk, const char *name) {
 2426|      1|  if (strlen(name) > BLOSC2_METALAYER_NAME_MAXLEN) {
  ------------------
  |  | 1790|      1|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  ------------------
  |  Branch (2426:7): [True: 0, False: 1]
  ------------------
 2427|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2427|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1790|      0|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2428|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2429|      0|  }
 2430|       |
 2431|      1|  if (schunk == NULL) {
  ------------------
  |  Branch (2431:7): [True: 0, False: 1]
  ------------------
 2432|      0|    BLOSC_TRACE_ERROR("Schunk must not be 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2434|      0|  }
 2435|       |
 2436|      1|  for (int nmetalayer = 0; nmetalayer < schunk->nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2436:28): [True: 0, False: 1]
  ------------------
 2437|      0|    if (strcmp(name, schunk->metalayers[nmetalayer]->name) == 0) {
  ------------------
  |  Branch (2437:9): [True: 0, False: 0]
  ------------------
 2438|      0|      return nmetalayer;
 2439|      0|    }
 2440|      0|  }
 2441|      1|  return BLOSC2_ERROR_NOT_FOUND;
 2442|      1|}
ndmean.c:blosc2_meta_get:
 2494|      1|                                  int32_t *content_len) {
 2495|      1|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2495:7): [True: 0, False: 1]
  |  Branch (2495:25): [True: 0, False: 1]
  |  Branch (2495:41): [True: 0, False: 1]
  |  Branch (2495:60): [True: 0, False: 1]
  ------------------
 2496|      0|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2498|      0|  }
 2499|       |
 2500|      1|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2501|      1|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2501:7): [True: 1, False: 0]
  ------------------
 2502|      1|    BLOSC_TRACE_WARNING("Metalayer \"%s\" not found.", name);
  ------------------
  |  |   94|      1|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|      1|    return nmetalayer;
 2504|      1|  }
 2505|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2506|      0|  if (len < 0) {
  ------------------
  |  Branch (2506:7): [True: 0, False: 0]
  ------------------
 2507|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2508|      0|    return BLOSC2_ERROR_DATA;
 2509|      0|  }
 2510|      0|  *content_len = len;
 2511|      0|  if (len == 0) {
  ------------------
  |  Branch (2511:7): [True: 0, False: 0]
  ------------------
 2512|      0|    *content = NULL;
 2513|      0|    return nmetalayer;
 2514|      0|  }
 2515|      0|  *content = (uint8_t*)malloc((size_t)len);
 2516|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2516:7): [True: 0, False: 0]
  ------------------
 2517|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2518|      0|    *content_len = 0;
 2519|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2520|      0|  }
 2521|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2521:7): [True: 0, False: 0]
  |  Branch (2521:18): [True: 0, False: 0]
  ------------------
 2522|      0|    free(*content);
 2523|      0|    *content = NULL;
 2524|      0|    *content_len = 0;
 2525|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|      0|    return BLOSC2_ERROR_DATA;
 2527|      0|  }
 2528|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2529|      0|  return nmetalayer;
 2530|      0|}
ndmean.c:blosc2_meta_exists:
 2425|      1|static inline int blosc2_meta_exists(blosc2_schunk *schunk, const char *name) {
 2426|      1|  if (strlen(name) > BLOSC2_METALAYER_NAME_MAXLEN) {
  ------------------
  |  | 1790|      1|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  ------------------
  |  Branch (2426:7): [True: 0, False: 1]
  ------------------
 2427|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2427|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1790|      0|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2428|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2429|      0|  }
 2430|       |
 2431|      1|  if (schunk == NULL) {
  ------------------
  |  Branch (2431:7): [True: 0, False: 1]
  ------------------
 2432|      0|    BLOSC_TRACE_ERROR("Schunk must not be 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2434|      0|  }
 2435|       |
 2436|      1|  for (int nmetalayer = 0; nmetalayer < schunk->nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2436:28): [True: 0, False: 1]
  ------------------
 2437|      0|    if (strcmp(name, schunk->metalayers[nmetalayer]->name) == 0) {
  ------------------
  |  Branch (2437:9): [True: 0, False: 0]
  ------------------
 2438|      0|      return nmetalayer;
 2439|      0|    }
 2440|      0|  }
 2441|      1|  return BLOSC2_ERROR_NOT_FOUND;
 2442|      1|}

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

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

ndlz4_decompress:
  526|    235|                     uint8_t meta, blosc2_dparams *dparams) {
  527|    235|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    235|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  528|    235|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    235|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  529|    235|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    235|    do {                                            \
  |  |  105|    235|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 235]
  |  |  ------------------
  |  |  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|    235|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 235]
  |  |  ------------------
  ------------------
  530|    235|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    235|    do {                                            \
  |  |  105|    235|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 235]
  |  |  ------------------
  |  |  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|    235|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 235]
  |  |  ------------------
  ------------------
  531|       |
  532|    235|  uint8_t *ip = (uint8_t *) input;
  533|    235|  uint8_t *op = (uint8_t *) output;
  534|    235|  uint8_t ndim;
  535|    235|  int32_t blockshape[2];
  536|    235|  int32_t eshape[2];
  537|    235|  uint8_t *buffercpy;
  538|    235|  uint8_t local_buffer[16];
  539|    235|  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|    235|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    235|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 2, False: 233]
  |  |  ------------------
  ------------------
  546|      2|    return 0;
  547|      2|  }
  548|    233|  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|    233|#define NDLZ4_CHECK_RANGE(pos, len)                                              \
  560|    233|  do {                                                                           \
  561|    233|    int64_t _pos = (int64_t) (pos);                                              \
  562|    233|    int64_t _len = (int64_t) (len);                                              \
  563|    233|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  564|    233|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  565|    233|      return BLOSC2_ERROR_FAILURE;                                               \
  566|    233|    }                                                                            \
  567|    233|  } while (0)
  568|       |
  569|       |  /* we start with literal copy */
  570|    233|  ndim = *ip;
  571|    233|  ip++;
  572|    233|  if (ndim != 2) {
  ------------------
  |  Branch (572:7): [True: 0, False: 233]
  ------------------
  573|      0|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      0|    return BLOSC2_ERROR_FAILURE;
  575|      0|  }
  576|    233|  memcpy(&blockshape[0], ip, 4);
  577|    233|  ip += 4;
  578|    233|  memcpy(&blockshape[1], ip, 4);
  579|    233|  ip += 4;
  580|       |
  581|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  582|    233|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (582:7): [True: 0, False: 233]
  |  Branch (582:25): [True: 1, False: 232]
  |  Branch (582:46): [True: 12, False: 220]
  ------------------
  583|     13|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     13|    return BLOSC2_ERROR_FAILURE;
  585|     13|  }
  586|       |
  587|    220|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  588|    220|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  589|       |
  590|    220|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    220|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 43, False: 177]
  |  |  ------------------
  ------------------
  591|     43|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     43|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     43|    do {                                            \
  |  |  |  |   98|     43|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     43|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 43, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     43|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     43|    return 0;
  593|     43|  }
  594|    177|  memset(op, 0, blockshape[0] * blockshape[1]);
  595|       |
  596|    177|  uint32_t i_stop[2];
  597|    531|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (597:19): [True: 354, False: 177]
  ------------------
  598|    354|    i_stop[i] = eshape[i] / 4;
  599|    354|  }
  600|       |
  601|       |  /* main loop */
  602|    177|  uint32_t ii[2];
  603|    177|  uint32_t padding[2] = {0};
  604|    177|  uint32_t ind = 0;
  605|    177|  uint8_t cell_aux[16];
  606|  2.68G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (606:19): [True: 2.68G, False: 14]
  ------------------
  607|  2.68G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (607:21): [True: 2.36k, False: 2.68G]
  ------------------
  608|  2.36k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  2.36k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 2.36k]
  |  |  ------------------
  ------------------
  609|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      0|        return BLOSC2_ERROR_FAILURE;
  611|      0|      }
  612|  2.36k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (612:11): [True: 387, False: 1.97k]
  ------------------
  613|    387|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (613:22): [True: 38, False: 349]
  ------------------
  614|  1.97k|      } else {
  615|  1.97k|        padding[0] = 4;
  616|  1.97k|      }
  617|  2.36k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (617:11): [True: 1.83k, False: 523]
  ------------------
  618|  1.83k|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (618:22): [True: 55, False: 1.78k]
  ------------------
  619|  1.83k|      } else {
  620|    523|        padding[1] = 4;
  621|    523|      }
  622|  2.36k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  623|  2.36k|      NDLZ4_CHECK_RANGE(cur, 1);
  ------------------
  |  |  560|  2.36k|  do {                                                                           \
  |  |  561|  2.36k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  2.36k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  2.36k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 2.36k]
  |  |  |  Branch (563:21): [True: 0, False: 2.36k]
  |  |  |  Branch (563:33): [True: 2, False: 2.36k]
  |  |  ------------------
  |  |  564|      2|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      2|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      2|    }                                                                            \
  |  |  567|  2.36k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
  624|  2.36k|      token = *ip++;
  625|  2.36k|      if (token == 0) {    // no match
  ------------------
  |  Branch (625:11): [True: 1.02k, False: 1.33k]
  ------------------
  626|  1.02k|        NDLZ4_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|  1.02k|  do {                                                                           \
  |  |  561|  1.02k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  1.02k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  1.02k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 1.02k]
  |  |  |  Branch (563:21): [True: 0, False: 1.02k]
  |  |  |  Branch (563:33): [True: 2, False: 1.02k]
  |  |  ------------------
  |  |  564|      2|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      2|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      2|    }                                                                            \
  |  |  567|  1.02k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 1.02k]
  |  |  ------------------
  ------------------
  627|  1.02k|        buffercpy = ip;
  628|  1.02k|        ip += padding[0] * padding[1];
  629|  1.33k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (629:18): [True: 165, False: 1.17k]
  ------------------
  630|    165|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    165|  do {                                                                           \
  |  |  561|    165|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    165|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    165|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 165]
  |  |  |  Branch (563:21): [True: 0, False: 165]
  |  |  |  Branch (563:33): [True: 1, False: 164]
  |  |  ------------------
  |  |  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|    165|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 164]
  |  |  ------------------
  ------------------
  631|    164|        uint16_t offset;
  632|    164|        memcpy(&offset, ip, sizeof(offset));
  633|    164|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;   // back-reference start offset
  634|    164|        NDLZ4_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    164|  do {                                                                           \
  |  |  561|    164|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    164|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    164|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 14, False: 150]
  |  |  |  Branch (563:21): [True: 0, False: 150]
  |  |  |  Branch (563:33): [True: 2, False: 148]
  |  |  ------------------
  |  |  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|    164|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 148]
  |  |  ------------------
  ------------------
  635|    148|        buffercpy = (uint8_t *) input + bpos;
  636|    148|        ip += 2;
  637|  1.17k|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (637:18): [True: 288, False: 884]
  ------------------
  638|    288|        NDLZ4_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  560|    288|  do {                                                                           \
  |  |  561|    288|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    288|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    288|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 288]
  |  |  |  Branch (563:21): [True: 0, False: 288]
  |  |  |  Branch (563:33): [True: 1, False: 287]
  |  |  ------------------
  |  |  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|    288|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 287]
  |  |  ------------------
  ------------------
  639|    287|        buffercpy = cell_aux;
  640|    287|        memset(buffercpy, *ip, 16);
  641|    287|        ip++;
  642|    884|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (642:18): [True: 277, False: 607]
  ------------------
  643|    277|        buffercpy = local_buffer;
  644|    277|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    277|  do {                                                                           \
  |  |  561|    277|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    277|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    277|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 277]
  |  |  |  Branch (563:21): [True: 0, False: 277]
  |  |  |  Branch (563:33): [True: 2, False: 275]
  |  |  ------------------
  |  |  564|      2|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      2|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      2|    }                                                                            \
  |  |  567|    277|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 275]
  |  |  ------------------
  ------------------
  645|    275|        uint16_t offset;
  646|    275|        memcpy(&offset, ip, sizeof(offset));
  647|    275|        offset += 3;
  648|    275|        ip += 2;
  649|    275|        int i, j, k;
  650|    275|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (650:13): [True: 21, False: 254]
  ------------------
  651|     21|          i = 1;
  652|     21|          j = 2;
  653|     21|          k = 3;
  654|    254|        } else {
  655|    254|          i = 0;
  656|    254|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (656:15): [True: 37, False: 217]
  ------------------
  657|     37|            j = 1;
  658|     37|            k = 2;
  659|    217|          } else {
  660|    217|            k = 3;
  661|    217|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (661:17): [True: 46, False: 171]
  ------------------
  662|     46|              j = 1;
  663|    171|            } else {
  664|    171|              j = 2;
  665|    171|            }
  666|    217|          }
  667|    254|        }
  668|    275|        int64_t bpos = (cur + 3) - (int64_t) offset;   // == (ip - offset) as an offset
  669|    275|        NDLZ4_CHECK_RANGE(bpos, 12);
  ------------------
  |  |  560|    275|  do {                                                                           \
  |  |  561|    275|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    275|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    275|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 31, False: 244]
  |  |  |  Branch (563:21): [True: 0, False: 244]
  |  |  |  Branch (563:33): [True: 3, False: 241]
  |  |  ------------------
  |  |  564|     34|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     34|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     34|    do {                                            \
  |  |  |  |  |  |   98|     34|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     34|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 34, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     34|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     34|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     34|    }                                                                            \
  |  |  567|    275|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 241]
  |  |  ------------------
  ------------------
  670|    241|        const uint8_t *ref = (const uint8_t *) input + bpos;
  671|    241|        memcpy(&buffercpy[i * 4], ref, 4);
  672|    241|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  673|    241|        memcpy(&buffercpy[k * 4], ref + 8, 4);
  674|    581|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (674:25): [True: 581, False: 0]
  ------------------
  675|    581|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (675:15): [True: 356, False: 225]
  |  Branch (675:27): [True: 278, False: 78]
  |  Branch (675:39): [True: 241, False: 37]
  ------------------
  676|    241|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    241|  do {                                                                           \
  |  |  561|    241|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    241|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    241|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 241]
  |  |  |  Branch (563:21): [True: 0, False: 241]
  |  |  |  Branch (563:33): [True: 1, False: 240]
  |  |  ------------------
  |  |  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|    241|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 240]
  |  |  ------------------
  ------------------
  677|    240|            memcpy(&buffercpy[l * 4], ip, 4);
  678|    240|            ip += 4;
  679|    240|            break;
  680|    241|          }
  681|    581|        }
  682|       |
  683|    607|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (683:18): [True: 382, False: 225]
  |  Branch (683:36): [True: 375, False: 7]
  ------------------
  684|    375|        buffercpy = local_buffer;
  685|    375|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    375|  do {                                                                           \
  |  |  561|    375|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    375|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    375|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 375]
  |  |  |  Branch (563:21): [True: 0, False: 375]
  |  |  |  Branch (563:33): [True: 1, False: 374]
  |  |  ------------------
  |  |  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|    375|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 374]
  |  |  ------------------
  ------------------
  686|    374|        uint16_t offset;
  687|    374|        memcpy(&offset, ip, sizeof(offset));
  688|    374|        offset += 3;
  689|    374|        ip += 2;
  690|    374|        int i, j;
  691|    374|        if (token == 128) {
  ------------------
  |  Branch (691:13): [True: 100, False: 274]
  ------------------
  692|    100|          i = 2;
  693|    100|          j = 3;
  694|    274|        } else {
  695|    274|          i = (token - 128) >> 5U;
  696|    274|          j = ((token - 128) >> 3U) - (i << 2U);
  697|    274|        }
  698|    374|        int64_t bpos = (cur + 3) - (int64_t) offset;
  699|    374|        NDLZ4_CHECK_RANGE(bpos, 8);
  ------------------
  |  |  560|    374|  do {                                                                           \
  |  |  561|    374|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    374|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    374|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 22, False: 352]
  |  |  |  Branch (563:21): [True: 0, False: 352]
  |  |  |  Branch (563:33): [True: 1, False: 351]
  |  |  ------------------
  |  |  564|     23|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     23|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     23|    }                                                                            \
  |  |  567|    374|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 351]
  |  |  ------------------
  ------------------
  700|    351|        const uint8_t *ref = (const uint8_t *) input + bpos;
  701|    351|        memcpy(&buffercpy[i * 4], ref, 4);
  702|    351|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  703|  1.74k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (703:25): [True: 1.39k, False: 344]
  ------------------
  704|  1.39k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (704:15): [True: 1.04k, False: 349]
  |  Branch (704:27): [True: 814, False: 234]
  ------------------
  705|    814|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    814|  do {                                                                           \
  |  |  561|    814|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    814|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    814|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 814]
  |  |  |  Branch (563:21): [True: 0, False: 814]
  |  |  |  Branch (563:33): [True: 7, False: 807]
  |  |  ------------------
  |  |  564|      7|      BLOSC_TRACE_ERROR("ndlz4: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      7|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      7|    }                                                                            \
  |  |  567|    814|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 807]
  |  |  ------------------
  ------------------
  706|    807|            memcpy(&buffercpy[k * 4], ip, 4);
  707|    807|            ip += 4;
  708|    807|          }
  709|  1.39k|        }
  710|    351|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (710:18): [True: 220, False: 12]
  |  Branch (710:35): [True: 205, False: 15]
  ------------------
  711|    205|        buffercpy = local_buffer;
  712|    205|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    205|  do {                                                                           \
  |  |  561|    205|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    205|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    205|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 205]
  |  |  |  Branch (563:21): [True: 0, False: 205]
  |  |  |  Branch (563:33): [True: 1, False: 204]
  |  |  ------------------
  |  |  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|    205|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 204]
  |  |  ------------------
  ------------------
  713|    204|        uint16_t offset_1;
  714|    204|        memcpy(&offset_1, ip, sizeof(offset_1));
  715|    204|        offset_1 += 5;
  716|    204|        ip += 2;
  717|    204|        NDLZ4_CHECK_RANGE(cur + 3, 2);
  ------------------
  |  |  560|    204|  do {                                                                           \
  |  |  561|    204|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    204|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    204|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 204]
  |  |  |  Branch (563:21): [True: 0, False: 204]
  |  |  |  Branch (563:33): [True: 2, False: 202]
  |  |  ------------------
  |  |  564|      2|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      2|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      2|    }                                                                            \
  |  |  567|    204|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 202]
  |  |  ------------------
  ------------------
  718|    202|        uint16_t offset_2;
  719|    202|        memcpy(&offset_2, ip, sizeof(offset_2));
  720|    202|        offset_2 += 5;
  721|    202|        ip += 2;
  722|    202|        int i, j, k, l, m;
  723|    202|        i = 0;
  724|    202|        j = ((token - 32) >> 3U);
  725|    202|        l = -1;
  726|    808|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (726:21): [True: 606, False: 202]
  ------------------
  727|    606|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (727:15): [True: 606, False: 0]
  |  Branch (727:27): [True: 404, False: 202]
  ------------------
  728|    404|            if (l == -1) {
  ------------------
  |  Branch (728:17): [True: 202, False: 202]
  ------------------
  729|    202|              l = k;
  730|    202|            } else {
  731|    202|              m = k;
  732|    202|            }
  733|    404|          }
  734|    606|        }
  735|    202|        int64_t bpos1 = (cur + 5) - (int64_t) offset_1;
  736|    202|        NDLZ4_CHECK_RANGE(bpos1, 8);
  ------------------
  |  |  560|    202|  do {                                                                           \
  |  |  561|    202|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    202|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    202|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 22, False: 180]
  |  |  |  Branch (563:21): [True: 0, False: 180]
  |  |  |  Branch (563:33): [True: 1, False: 179]
  |  |  ------------------
  |  |  564|     23|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     23|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     23|    }                                                                            \
  |  |  567|    202|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 179]
  |  |  ------------------
  ------------------
  737|    179|        const uint8_t *ref1 = (const uint8_t *) input + bpos1;
  738|    179|        memcpy(&buffercpy[i * 4], ref1, 4);
  739|    179|        memcpy(&buffercpy[j * 4], ref1 + 4, 4);
  740|    179|        int64_t bpos2 = (cur + 5) - (int64_t) offset_2;
  741|    179|        NDLZ4_CHECK_RANGE(bpos2, 8);
  ------------------
  |  |  560|    179|  do {                                                                           \
  |  |  561|    179|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    179|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    179|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 19, False: 160]
  |  |  |  Branch (563:21): [True: 0, False: 160]
  |  |  |  Branch (563:33): [True: 1, False: 159]
  |  |  ------------------
  |  |  564|     20|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     20|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     20|    }                                                                            \
  |  |  567|    179|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 159]
  |  |  ------------------
  ------------------
  742|    159|        const uint8_t *ref2 = (const uint8_t *) input + bpos2;
  743|    159|        memcpy(&buffercpy[l * 4], ref2, 4);
  744|    159|        memcpy(&buffercpy[m * 4], ref2 + 4, 4);
  745|       |
  746|    159|      } else {
  747|     27|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     27|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     27|    do {                                            \
  |  |  |  |   98|     27|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     27|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 27, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     27|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|     27|        return BLOSC2_ERROR_FAILURE;
  749|     27|      }
  750|       |      // fill op with buffercpy
  751|  2.19k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  752|  10.9k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (752:28): [True: 8.79k, False: 2.19k]
  ------------------
  753|  8.79k|        if (i < padding[0]) {
  ------------------
  |  Branch (753:13): [True: 8.01k, False: 784]
  ------------------
  754|  8.01k|          ind = orig + i * blockshape[1];
  755|  8.01k|          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|  8.01k|          buffercpy += padding[1];
  762|  8.01k|        }
  763|  8.79k|      }
  764|  2.19k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (764:11): [True: 0, False: 2.19k]
  ------------------
  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|  2.19k|    }
  769|  2.68G|  }
  770|     14|  ind += padding[1];
  771|       |
  772|     14|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (772:7): [True: 0, False: 14]
  ------------------
  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|     14|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (776:7): [True: 0, False: 14]
  ------------------
  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|     14|  return (int) ind;
  782|     14|#undef NDLZ4_CHECK_RANGE
  783|     14|}

ndlz8_decompress:
  444|    236|                     uint8_t meta, blosc2_dparams *dparams) {
  445|    236|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    236|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  446|    236|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    236|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  447|    236|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    236|    do {                                            \
  |  |  105|    236|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 236]
  |  |  ------------------
  |  |  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|    236|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 236]
  |  |  ------------------
  ------------------
  448|    236|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    236|    do {                                            \
  |  |  105|    236|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 236]
  |  |  ------------------
  |  |  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|    236|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 236]
  |  |  ------------------
  ------------------
  449|       |
  450|    236|  const int cell_shape = 8;
  451|    236|  const int cell_size = 64;
  452|    236|  uint8_t *ip = (uint8_t *) input;
  453|    236|  uint8_t *op = (uint8_t *) output;
  454|    236|  uint8_t ndim;
  455|    236|  int32_t blockshape[2];
  456|    236|  int32_t eshape[2];
  457|    236|  uint8_t *buffercpy;
  458|    236|  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|    236|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    236|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 236]
  |  |  ------------------
  ------------------
  465|      0|    return 0;
  466|      0|  }
  467|    236|  uint8_t *ip_limit = ip + input_len;
  468|       |
  469|       |  /* we start with literal copy */
  470|    236|  ndim = *ip;
  471|    236|  ip++;
  472|    236|  if (ndim != 2) {
  ------------------
  |  Branch (472:7): [True: 1, False: 235]
  ------------------
  473|      1|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  474|      1|    return BLOSC2_ERROR_FAILURE;
  475|      1|  }
  476|    235|  memcpy(&blockshape[0], ip, 4);
  477|    235|  ip += 4;
  478|    235|  memcpy(&blockshape[1], ip, 4);
  479|    235|  ip += 4;
  480|       |
  481|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  482|    235|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 235]
  |  Branch (482:25): [True: 25, False: 210]
  |  Branch (482:46): [True: 16, False: 194]
  ------------------
  483|     41|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     41|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     41|    do {                                            \
  |  |  |  |   98|     41|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     41|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 41, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     41|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|     41|    return BLOSC2_ERROR_FAILURE;
  485|     41|  }
  486|       |
  487|    194|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  488|    194|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  489|       |
  490|    194|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    194|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 49, False: 145]
  |  |  ------------------
  ------------------
  491|     49|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     49|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     49|    do {                                            \
  |  |  |  |   98|     49|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     49|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 49, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     49|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|     49|    return 0;
  493|     49|  }
  494|    145|  memset(op, 0, blockshape[0] * blockshape[1]);
  495|       |
  496|    145|  int32_t i_stop[2];
  497|    435|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (497:19): [True: 290, False: 145]
  ------------------
  498|    290|    i_stop[i] = eshape[i] / cell_shape;
  499|    290|  }
  500|       |
  501|       |  /* main loop */
  502|    145|  int32_t ii[2];
  503|    145|  int32_t padding[2] = {0};
  504|    145|  int32_t ind = 0;
  505|    145|  uint8_t *local_buffer = malloc(cell_size);
  506|    145|  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|    145|#define NDLZ8_CHECK_RANGE(pos, len)                                              \
  518|    145|  do {                                                                           \
  519|    145|    int64_t _pos = (int64_t) (pos);                                              \
  520|    145|    int64_t _len = (int64_t) (len);                                              \
  521|    145|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  522|    145|      free(local_buffer);                                                        \
  523|    145|      free(cell_aux);                                                            \
  524|    145|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  525|    145|      return BLOSC2_ERROR_FAILURE;                                               \
  526|    145|    }                                                                            \
  527|    145|  } while (0)
  528|       |
  529|  82.4M|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (529:19): [True: 82.4M, False: 12]
  ------------------
  530|  82.4M|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (530:21): [True: 1.04k, False: 82.4M]
  ------------------
  531|  1.04k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  1.04k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 1.04k]
  |  |  ------------------
  ------------------
  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|  1.04k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (537:11): [True: 797, False: 252]
  ------------------
  538|    797|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (538:22): [True: 13, False: 784]
  ------------------
  539|    797|      } else {
  540|    252|        padding[0] = cell_shape;
  541|    252|      }
  542|  1.04k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (542:11): [True: 170, False: 879]
  ------------------
  543|    170|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (543:22): [True: 54, False: 116]
  ------------------
  544|    879|      } else {
  545|    879|        padding[1] = cell_shape;
  546|    879|      }
  547|  1.04k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  548|  1.04k|      NDLZ8_CHECK_RANGE(cur, 1);
  ------------------
  |  |  518|  1.04k|  do {                                                                           \
  |  |  519|  1.04k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|  1.04k|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|  1.04k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 1.04k]
  |  |  |  Branch (521:21): [True: 0, False: 1.04k]
  |  |  |  Branch (521:33): [True: 3, False: 1.04k]
  |  |  ------------------
  |  |  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|  1.04k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  549|  1.04k|      token = *ip++;
  550|  1.04k|      uint8_t match_type = (token >> 3U);
  551|  1.04k|      if (token == 0) {    // no match
  ------------------
  |  Branch (551:11): [True: 241, False: 805]
  ------------------
  552|    241|        NDLZ8_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    241|  do {                                                                           \
  |  |  519|    241|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    241|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    241|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 241]
  |  |  |  Branch (521:21): [True: 0, False: 241]
  |  |  |  Branch (521:33): [True: 10, False: 231]
  |  |  ------------------
  |  |  522|     10|      free(local_buffer);                                                        \
  |  |  523|     10|      free(cell_aux);                                                            \
  |  |  524|     10|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     10|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     10|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     10|    }                                                                            \
  |  |  527|    241|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 231]
  |  |  ------------------
  ------------------
  553|    231|        buffercpy = ip;
  554|    231|        ip += padding[0] * padding[1];
  555|    805|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (555:18): [True: 40, False: 765]
  ------------------
  556|     40|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     40|  do {                                                                           \
  |  |  519|     40|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     40|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     40|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 40]
  |  |  |  Branch (521:21): [True: 0, False: 40]
  |  |  |  Branch (521:33): [True: 1, False: 39]
  |  |  ------------------
  |  |  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|     40|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 39]
  |  |  ------------------
  ------------------
  557|     39|        uint16_t offset;
  558|     39|        memcpy(&offset, ip, sizeof(offset));
  559|     39|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;
  560|     39|        NDLZ8_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|     39|  do {                                                                           \
  |  |  519|     39|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     39|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     39|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 24, False: 15]
  |  |  |  Branch (521:21): [True: 0, False: 15]
  |  |  |  Branch (521:33): [True: 3, False: 12]
  |  |  ------------------
  |  |  522|     27|      free(local_buffer);                                                        \
  |  |  523|     27|      free(cell_aux);                                                            \
  |  |  524|     27|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     27|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     27|    do {                                            \
  |  |  |  |  |  |   98|     27|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     27|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 27, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     27|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     27|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     27|    }                                                                            \
  |  |  527|     39|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 12]
  |  |  ------------------
  ------------------
  561|     12|        buffercpy = (uint8_t *) input + bpos;
  562|     12|        ip += 2;
  563|    765|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (563:18): [True: 558, False: 207]
  ------------------
  564|    558|        NDLZ8_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  518|    558|  do {                                                                           \
  |  |  519|    558|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    558|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    558|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 558]
  |  |  |  Branch (521:21): [True: 0, False: 558]
  |  |  |  Branch (521:33): [True: 2, False: 556]
  |  |  ------------------
  |  |  522|      2|      free(local_buffer);                                                        \
  |  |  523|      2|      free(cell_aux);                                                            \
  |  |  524|      2|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      2|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      2|    }                                                                            \
  |  |  527|    558|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 556]
  |  |  ------------------
  ------------------
  565|    556|        buffercpy = cell_aux;
  566|    556|        memset(buffercpy, *ip, cell_size);
  567|    556|        ip++;
  568|    556|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (568:18): [True: 79, False: 128]
  ------------------
  569|     79|        buffercpy = local_buffer;
  570|     79|        int row = (int) (token & 7);
  571|     79|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (571:13): [True: 2, False: 77]
  ------------------
  572|      2|          free(local_buffer);
  573|      2|          free(cell_aux);
  574|      2|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      2|          return BLOSC2_ERROR_FAILURE;
  576|      2|        }
  577|     77|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     77|  do {                                                                           \
  |  |  519|     77|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     77|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     77|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 77]
  |  |  |  Branch (521:21): [True: 0, False: 77]
  |  |  |  Branch (521:33): [True: 1, False: 76]
  |  |  ------------------
  |  |  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|     77|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 76]
  |  |  ------------------
  ------------------
  578|     76|        uint16_t offset;
  579|     76|        memcpy(&offset, ip, sizeof(offset));
  580|     76|        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|     76|        int64_t bpos = cur - (int64_t) offset;
  584|     76|        NDLZ8_CHECK_RANGE(bpos, 3 * cell_shape);
  ------------------
  |  |  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: 5, False: 71]
  |  |  |  Branch (521:21): [True: 0, False: 71]
  |  |  |  Branch (521:33): [True: 2, False: 69]
  |  |  ------------------
  |  |  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|     76|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 69]
  |  |  ------------------
  ------------------
  585|     69|        const uint8_t *ref = (const uint8_t *) input + bpos;
  586|    276|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (586:25): [True: 207, False: 69]
  ------------------
  587|    207|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  588|    207|        }
  589|    584|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (589:25): [True: 524, False: 60]
  ------------------
  590|    524|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (590:15): [True: 188, False: 336]
  |  Branch (590:28): [True: 144, False: 192]
  ------------------
  591|    332|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    332|  do {                                                                           \
  |  |  519|    332|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    332|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    332|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 332]
  |  |  |  Branch (521:21): [True: 0, False: 332]
  |  |  |  Branch (521:33): [True: 9, False: 323]
  |  |  ------------------
  |  |  522|      9|      free(local_buffer);                                                        \
  |  |  523|      9|      free(cell_aux);                                                            \
  |  |  524|      9|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      9|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      9|    do {                                            \
  |  |  |  |  |  |   98|      9|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      9|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 9, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      9|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      9|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      9|    }                                                                            \
  |  |  527|    332|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 323]
  |  |  ------------------
  ------------------
  592|    323|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  593|    323|            ip += cell_shape;
  594|    323|          }
  595|    524|        }
  596|    128|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (596:18): [True: 75, False: 53]
  ------------------
  597|     75|        buffercpy = local_buffer;
  598|     75|        int row = (int) (token & 7);
  599|     75|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (599:13): [True: 2, False: 73]
  ------------------
  600|      2|          free(local_buffer);
  601|      2|          free(cell_aux);
  602|      2|          BLOSC_TRACE_ERROR("Pair match row out of bounds");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|      2|          return BLOSC2_ERROR_FAILURE;
  604|      2|        }
  605|     73|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     73|  do {                                                                           \
  |  |  519|     73|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     73|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     73|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 73]
  |  |  |  Branch (521:21): [True: 0, False: 73]
  |  |  |  Branch (521:33): [True: 1, False: 72]
  |  |  ------------------
  |  |  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|     73|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 72]
  |  |  ------------------
  ------------------
  606|     72|        uint16_t offset;
  607|     72|        memcpy(&offset, ip, sizeof(offset));
  608|     72|        ip += 2;
  609|       |        // back-reference base == cur - offset (see triple-match note above).
  610|     72|        int64_t bpos = cur - (int64_t) offset;
  611|     72|        NDLZ8_CHECK_RANGE(bpos, 2 * cell_shape);
  ------------------
  |  |  518|     72|  do {                                                                           \
  |  |  519|     72|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     72|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     72|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 5, False: 67]
  |  |  |  Branch (521:21): [True: 0, False: 67]
  |  |  |  Branch (521:33): [True: 1, False: 66]
  |  |  ------------------
  |  |  522|      6|      free(local_buffer);                                                        \
  |  |  523|      6|      free(cell_aux);                                                            \
  |  |  524|      6|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      6|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      6|    }                                                                            \
  |  |  527|     72|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 66]
  |  |  ------------------
  ------------------
  612|     66|        const uint8_t *ref = (const uint8_t *) input + bpos;
  613|    198|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (613:25): [True: 132, False: 66]
  ------------------
  614|    132|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  615|    132|        }
  616|    557|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (616:25): [True: 500, False: 57]
  ------------------
  617|    500|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (617:15): [True: 187, False: 313]
  |  Branch (617:28): [True: 189, False: 124]
  ------------------
  618|    376|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    376|  do {                                                                           \
  |  |  519|    376|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    376|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    376|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 376]
  |  |  |  Branch (521:21): [True: 0, False: 376]
  |  |  |  Branch (521:33): [True: 9, False: 367]
  |  |  ------------------
  |  |  522|      9|      free(local_buffer);                                                        \
  |  |  523|      9|      free(cell_aux);                                                            \
  |  |  524|      9|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      9|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      9|    do {                                            \
  |  |  |  |  |  |   98|      9|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      9|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 9, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      9|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      9|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      9|    }                                                                            \
  |  |  527|    376|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 367]
  |  |  ------------------
  ------------------
  619|    367|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  620|    367|            ip += cell_shape;
  621|    367|          }
  622|    500|        }
  623|     66|      } else {
  624|     53|        free(local_buffer);
  625|     53|        free(cell_aux);
  626|     53|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|     53|        return BLOSC2_ERROR_FAILURE;
  628|     53|      }
  629|       |
  630|    916|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  631|  8.24k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (631:27): [True: 7.32k, False: 916]
  ------------------
  632|  7.32k|        if (i < padding[0]) {
  ------------------
  |  Branch (632:13): [True: 3.90k, False: 3.42k]
  ------------------
  633|  3.90k|          ind = orig + i * blockshape[1];
  634|  3.90k|          memcpy(&op[ind], buffercpy, padding[1]);
  635|       |          // Only advance over rows we actually consume.  For a literal cell
  636|       |          // (token == 0) buffercpy points into the input and only holds
  637|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  638|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  639|       |          // for the block's last cell.  The skipped rows are never read.
  640|  3.90k|          buffercpy += padding[1];
  641|  3.90k|        }
  642|  7.32k|      }
  643|    916|      if (ind > output_len) {
  ------------------
  |  Branch (643:11): [True: 0, False: 916]
  ------------------
  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|    916|    }
  650|  82.4M|  }
  651|     12|  ind += padding[1];
  652|       |
  653|     12|  free(cell_aux);
  654|     12|  free(local_buffer);
  655|       |
  656|     12|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (656:7): [True: 0, False: 12]
  ------------------
  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|     12|  if (ind > output_len) {
  ------------------
  |  Branch (660:7): [True: 0, False: 12]
  ------------------
  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|     12|  return (int) ind;
  666|     12|#undef NDLZ8_CHECK_RANGE
  667|     12|}

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

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

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

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

ndcell_backward:
  205|      1|                   uint8_t id) {
  206|      1|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      1|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  207|      1|  blosc2_schunk *schunk = dparams->schunk;
  208|      1|  int8_t ndim;
  209|      1|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  210|      1|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  211|      1|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  212|      1|  uint8_t *smeta;
  213|      1|  int32_t smeta_len;
  214|      1|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (214:7): [True: 1, False: 0]
  ------------------
  215|      1|    free(shape);
  216|      1|    free(chunkshape);
  217|      1|    free(blockshape);
  218|      1|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|      1|    return BLOSC2_ERROR_FAILURE;
  220|      1|  }
  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|      1|                   uint8_t id) {
  244|      1|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      1|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  245|      1|  blosc2_schunk *schunk = dparams->schunk;
  246|      1|  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|      1|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  252|      1|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  253|      1|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  254|      1|  uint8_t *smeta;
  255|      1|  int32_t smeta_len;
  256|      1|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (256:7): [True: 1, False: 0]
  ------------------
  257|      1|    free(shape);
  258|      1|    free(chunkshape);
  259|      1|    free(blockshape);
  260|      1|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|      1|    return BLOSC2_ERROR_FAILURE;
  262|      1|  }
  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|  9.07k|void register_tuners(void) {
   14|       |
   15|  9.07k|  blosc2_tuner btune;
   16|  9.07k|  btune.id = BLOSC_BTUNE;
   17|  9.07k|  btune.name = "btune";
   18|  9.07k|  btune.init = NULL;
   19|  9.07k|  btune.next_cparams = NULL;
   20|  9.07k|  btune.next_blocksize = NULL;
   21|  9.07k|  btune.update = NULL;
   22|  9.07k|  btune.free = NULL;
   23|       |
   24|  9.07k|  register_tuner_private(&btune);
   25|  9.07k|}

LLVMFuzzerTestOneInput:
   11|  9.07k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   12|  9.07k|  int32_t i = 0, dsize = 0;
   13|  9.07k|  int32_t nchunk = 0;
   14|       |
   15|  9.07k|  blosc2_init();
   16|  9.07k|  blosc2_set_nthreads(1);
   17|       |
   18|       |  /* Create a super-chunk backed by an in-memory frame */
   19|  9.07k|  blosc2_schunk* schunk = blosc2_schunk_from_buffer((uint8_t *) data, (int64_t)size, false);
   20|  9.07k|  if (schunk == NULL) {
  ------------------
  |  Branch (20:7): [True: 8.59k, False: 485]
  ------------------
   21|  8.59k|    blosc2_destroy();
   22|  8.59k|    return 0;
   23|  8.59k|  }
   24|       |  /* Don't allow address sanitizer to allocate more than INT32_MAX */
   25|    485|  if (schunk->nbytes >= INT32_MAX) {
  ------------------
  |  Branch (25:7): [True: 1, False: 484]
  ------------------
   26|      1|    blosc2_schunk_free(schunk);
   27|      1|    blosc2_destroy();
   28|      1|    return 0;
   29|      1|  }
   30|       |  /* Decompress data */
   31|    484|  uint8_t *uncompressed_data = (uint8_t *)malloc((size_t)schunk->nbytes+1);
   32|    484|  if (uncompressed_data != NULL) {
  ------------------
  |  Branch (32:7): [True: 483, False: 1]
  ------------------
   33|  15.6k|    for (i = 0, nchunk = 0; nchunk < schunk->nchunks-1; nchunk++) {
  ------------------
  |  Branch (33:29): [True: 15.6k, False: 30]
  ------------------
   34|  15.6k|      dsize = blosc2_schunk_decompress_chunk(schunk, nchunk, uncompressed_data + i, schunk->chunksize);
   35|  15.6k|      if (dsize < 0) {
  ------------------
  |  Branch (35:11): [True: 453, False: 15.1k]
  ------------------
   36|    453|        printf("Decompression error.  Error code: %d\n", dsize);
   37|    453|        break;
   38|    453|      }
   39|  15.1k|      i += dsize;
   40|  15.1k|    }
   41|       |
   42|    483|    free(uncompressed_data);
   43|    483|  }
   44|       |
   45|    484|  blosc2_schunk_free(schunk);
   46|    484|  blosc2_destroy();
   47|    484|  return 0;
   48|    485|}

