LZ4_decompress_safe:
 2452|    390|{
 2453|    390|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2454|    390|                                  decode_full_block, noDict,
 2455|       |                                  (BYTE*)dest, NULL, 0);
 2456|    390|}
LZ4_decompress_safe_forceExtDict:
 2526|    358|{
 2527|    358|    DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict");
  ------------------
  |  |  289|    358|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2528|    358|    return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
 2529|    358|                                  decode_full_block, usingExtDict,
 2530|    358|                                  (BYTE*)dest, (const BYTE*)dictStart, dictSize);
 2531|    358|}
LZ4_decompress_safe_usingDict:
 2720|    358|{
 2721|    358|    if (dictSize==0)
  ------------------
  |  Branch (2721:9): [True: 0, False: 358]
  ------------------
 2722|      0|        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
 2723|    358|    if (dictStart+dictSize == dest) {
  ------------------
  |  Branch (2723:9): [True: 0, False: 358]
  ------------------
 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|    358|    assert(dictSize >= 0);
  ------------------
  |  |  273|    358|#    define assert(condition) ((void)0)
  ------------------
 2731|    358|    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
 2732|    358|}
lz4.c:LZ4_wildCopy8:
  466|  8.40k|{
  467|  8.40k|    BYTE* d = (BYTE*)dstPtr;
  468|  8.40k|    const BYTE* s = (const BYTE*)srcPtr;
  469|  8.40k|    BYTE* const e = (BYTE*)dstEnd;
  470|       |
  471|   964k|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  349|   964k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (471:50): [True: 955k, False: 8.40k]
  ------------------
  472|  8.40k|}
lz4.c:LZ4_isLittleEndian:
  364|  75.2k|{
  365|  75.2k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  366|  75.2k|    return one.c[0];
  367|  75.2k|}
lz4.c:LZ4_read16:
  393|  75.2k|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  398|  7.45k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2035|    748|{
 2036|    748|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2036:9): [True: 0, False: 748]
  |  Branch (2036:26): [True: 0, False: 748]
  ------------------
 2037|       |
 2038|    748|    {   const BYTE* ip = (const BYTE*) src;
 2039|    748|        const BYTE* const iend = ip + srcSize;
 2040|       |
 2041|    748|        BYTE* op = (BYTE*) dst;
 2042|    748|        BYTE* const oend = op + outputSize;
 2043|    748|        BYTE* cpy;
 2044|       |
 2045|    748|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2045:37): [True: 390, False: 358]
  ------------------
 2046|       |
 2047|    748|        const int checkOffset = (dictSize < (int)(64 KB));
  ------------------
  |  |  251|    748|#define KB *(1 <<10)
  ------------------
 2048|       |
 2049|       |
 2050|       |        /* Set up the "end" pointers for the shortcut. */
 2051|    748|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2052|    748|        const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/;
 2053|       |
 2054|    748|        const BYTE* match;
 2055|    748|        size_t offset;
 2056|    748|        unsigned token;
 2057|    748|        size_t length;
 2058|       |
 2059|       |
 2060|    748|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  289|    748|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2061|       |
 2062|       |        /* Special cases */
 2063|    748|        assert(lowPrefix <= op);
  ------------------
  |  |  273|    748|#    define assert(condition) ((void)0)
  ------------------
 2064|    748|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|    748|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    748|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 748]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    748|        if (unlikely(srcSize==0)) { return -1; }
  ------------------
  |  |  180|    748|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    748|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 748]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    748|#if LZ4_FAST_DEC_LOOP
 2076|    748|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|    748|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2076:13): [True: 12, False: 736]
  ------------------
 2077|     12|            DEBUGLOG(6, "move to safe decode loop");
  ------------------
  |  |  289|     12|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2078|     12|            goto safe_decode;
 2079|     12|        }
 2080|       |
 2081|       |        /* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE */
 2082|    736|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  289|    736|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2083|  74.8k|        while (1) {
  ------------------
  |  Branch (2083:16): [True: 74.8k, Folded]
  ------------------
 2084|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2085|  74.8k|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|  74.8k|#    define assert(condition) ((void)0)
  ------------------
 2086|  74.8k|            assert(ip < iend);
  ------------------
  |  |  273|  74.8k|#    define assert(condition) ((void)0)
  ------------------
 2087|  74.8k|            token = *ip++;
 2088|  74.8k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|  74.8k|#define ML_BITS  4
  ------------------
 2089|  74.8k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|  74.8k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2090|       |
 2091|       |            /* decode literal length */
 2092|  74.8k|            if (length == RUN_MASK) {
  ------------------
  |  |  263|  74.8k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  74.8k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  74.8k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2092:17): [True: 2.37k, False: 72.4k]
  ------------------
 2093|  2.37k|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|  2.37k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  2.37k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  2.37k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2094|  2.37k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2094:21): [True: 10, False: 2.36k]
  ------------------
 2095|     10|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  289|     10|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2096|     10|                    goto _output_error;
 2097|     10|                }
 2098|  2.36k|                length += addl;
 2099|  2.36k|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  2.36k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.36k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 2.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2100|  2.36k|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  2.36k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.36k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 2.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2101|       |
 2102|       |                /* copy literals */
 2103|  2.36k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  2.36k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2104|  2.36k|                if ((op+length>oend-32) || (ip+length>iend-32)) { goto safe_literal_copy; }
  ------------------
  |  Branch (2104:21): [True: 17, False: 2.34k]
  |  Branch (2104:44): [True: 326, False: 2.01k]
  ------------------
 2105|  2.01k|                LZ4_wildCopy32(op, ip, op+length);
 2106|  2.01k|                ip += length; op += length;
 2107|  72.4k|            } else if (ip <= iend-(16 + 1/*max lit + offset + nextToken*/)) {
  ------------------
  |  Branch (2107:24): [True: 72.4k, False: 45]
  ------------------
 2108|       |                /* We don't need to check oend, since we check it once for each loop below */
 2109|  72.4k|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)length);
  ------------------
  |  |  289|  72.4k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2110|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2111|  72.4k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|  72.4k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2112|  72.4k|                ip += length; op += length;
 2113|  72.4k|            } else {
 2114|     45|                goto safe_literal_copy;
 2115|     45|            }
 2116|       |
 2117|       |            /* get offset */
 2118|  74.4k|            offset = LZ4_readLE16(ip); ip+=2;
 2119|  74.4k|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  289|  74.4k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2120|  74.4k|            match = op - offset;
 2121|  74.4k|            assert(match <= op);  /* overflow check */
  ------------------
  |  |  273|  74.4k|#    define assert(condition) ((void)0)
  ------------------
 2122|       |
 2123|       |            /* get matchlength */
 2124|  74.4k|            length = token & ML_MASK;
  ------------------
  |  |  261|  74.4k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  74.4k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2125|  74.4k|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)length, (unsigned)length+MINMATCH);
  ------------------
  |  |  289|  74.4k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2126|       |
 2127|  74.4k|            if (length == ML_MASK) {
  ------------------
  |  |  261|  74.4k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  74.4k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2127:17): [True: 44.7k, False: 29.7k]
  ------------------
 2128|  44.7k|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|  44.7k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2129|  44.7k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2129:21): [True: 5, False: 44.7k]
  ------------------
 2130|      5|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  289|      5|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2131|      5|                    goto _output_error;
 2132|      5|                }
 2133|  44.7k|                length += addl;
 2134|  44.7k|                length += MINMATCH;
  ------------------
  |  |  242|  44.7k|#define MINMATCH 4
  ------------------
 2135|  44.7k|                DEBUGLOG(7, "  long match length == %u", (unsigned)length);
  ------------------
  |  |  289|  44.7k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2136|  44.7k|                if (unlikely((uptrval)(op)+length<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  44.7k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  44.7k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 44.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2137|  44.7k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  44.7k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2137:21): [True: 172, False: 44.5k]
  ------------------
 2138|    172|                    goto safe_match_copy;
 2139|    172|                }
 2140|  44.7k|            } else {
 2141|  29.7k|                length += MINMATCH;
  ------------------
  |  |  242|  29.7k|#define MINMATCH 4
  ------------------
 2142|  29.7k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  29.7k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2142:21): [True: 21, False: 29.7k]
  ------------------
 2143|     21|                    DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)length);
  ------------------
  |  |  289|     21|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2144|     21|                    goto safe_match_copy;
 2145|     21|                }
 2146|       |
 2147|       |                /* Fastpath check: skip LZ4_wildCopy32 when true */
 2148|  29.7k|                if ((dict == withPrefix64k) || (match >= lowPrefix)) {
  ------------------
  |  Branch (2148:21): [True: 0, False: 29.7k]
  |  Branch (2148:48): [True: 28.7k, False: 952]
  ------------------
 2149|  28.7k|                    if (offset >= 8) {
  ------------------
  |  Branch (2149:25): [True: 19.2k, False: 9.54k]
  ------------------
 2150|  19.2k|                        assert(match >= lowPrefix);
  ------------------
  |  |  273|  19.2k|#    define assert(condition) ((void)0)
  ------------------
 2151|  19.2k|                        assert(match <= op);
  ------------------
  |  |  273|  19.2k|#    define assert(condition) ((void)0)
  ------------------
 2152|  19.2k|                        assert(op + 18 <= oend);
  ------------------
  |  |  273|  19.2k|#    define assert(condition) ((void)0)
  ------------------
 2153|       |
 2154|  19.2k|                        LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  19.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2155|  19.2k|                        LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  349|  19.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2156|  19.2k|                        LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  349|  19.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2157|  19.2k|                        op += length;
 2158|  19.2k|                        continue;
 2159|  19.2k|            }   }   }
 2160|       |
 2161|  55.0k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|  55.0k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  55.0k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2161:18): [True: 55.0k, False: 0]
  |  Branch (2161:33): [True: 140, False: 54.8k]
  ------------------
 2162|    140|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  289|    140|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2163|    140|                goto _output_error;
 2164|    140|            }
 2165|       |            /* match starting within external dictionary */
 2166|  54.8k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2166:17): [True: 23.4k, False: 31.4k]
  |  Branch (2166:41): [True: 1.35k, False: 22.1k]
  ------------------
 2167|  1.35k|                assert(dictEnd != NULL);
  ------------------
  |  |  273|  1.35k|#    define assert(condition) ((void)0)
  ------------------
 2168|  1.35k|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|  1.35k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.35k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|  1.35k|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2177:21): [True: 1.24k, False: 109]
  ------------------
 2178|       |                    /* match fits entirely within external dictionary : just copy */
 2179|  1.24k|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|  1.24k|#    define LZ4_memmove __builtin_memmove
  ------------------
 2180|  1.24k|                    op += length;
 2181|  1.24k|                } else {
 2182|       |                    /* match stretches into both external dictionary and current block */
 2183|    109|                    size_t const copySize = (size_t)(lowPrefix - match);
 2184|    109|                    size_t const restSize = length - copySize;
 2185|    109|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|    109|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2186|    109|                    op += copySize;
 2187|    109|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2187:25): [True: 54, False: 55]
  ------------------
 2188|     54|                        BYTE* const endOfMatch = op + restSize;
 2189|     54|                        const BYTE* copyFrom = lowPrefix;
 2190|   682k|                        while (op < endOfMatch) { *op++ = *copyFrom++; }
  ------------------
  |  Branch (2190:32): [True: 682k, False: 54]
  ------------------
 2191|     55|                    } else {
 2192|     55|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|     55|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2193|     55|                        op += restSize;
 2194|     55|                }   }
 2195|  1.35k|                continue;
 2196|  1.35k|            }
 2197|       |
 2198|       |            /* copy match within block */
 2199|  53.5k|            cpy = op + length;
 2200|       |
 2201|  53.5k|            assert((op <= oend) && (oend-op >= 32));
  ------------------
  |  |  273|  53.5k|#    define assert(condition) ((void)0)
  ------------------
 2202|  53.5k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|  53.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  53.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 35.2k, False: 18.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|  35.2k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2204|  35.2k|            } else {
 2205|  18.2k|                LZ4_wildCopy32(op, match, cpy);
 2206|  18.2k|            }
 2207|       |
 2208|  53.5k|            op = cpy;   /* wildcopy correction */
 2209|  53.5k|        }
 2210|     12|    safe_decode:
 2211|     12|#endif
 2212|       |
 2213|       |        /* Main Loop : decode remaining sequences where output < FASTLOOP_SAFE_DISTANCE */
 2214|     12|        DEBUGLOG(6, "using safe decode loop");
  ------------------
  |  |  289|     12|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2215|    906|        while (1) {
  ------------------
  |  Branch (2215:16): [True: 906, Folded]
  ------------------
 2216|    906|            assert(ip < iend);
  ------------------
  |  |  273|    906|#    define assert(condition) ((void)0)
  ------------------
 2217|    906|            token = *ip++;
 2218|    906|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|    906|#define ML_BITS  4
  ------------------
 2219|    906|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|    906|#  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|    906|            if ( (length != RUN_MASK)
  ------------------
  |  |  263|    906|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    906|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    906|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2230:18): [True: 769, False: 137]
  ------------------
 2231|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2232|    769|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|    769|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|    769|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 335, False: 434]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|       |                /* Copy the literals */
 2234|    335|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|    335|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2235|    335|                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|    335|                length = token & ML_MASK; /* match length */
  ------------------
  |  |  261|    335|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    335|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2240|    335|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)length, (unsigned)length + 4);
  ------------------
  |  |  289|    335|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2241|    335|                offset = LZ4_readLE16(ip); ip += 2;
 2242|    335|                match = op - offset;
 2243|    335|                assert(match <= op); /* check overflow */
  ------------------
  |  |  273|    335|#    define assert(condition) ((void)0)
  ------------------
 2244|       |
 2245|       |                /* Do not deal with overlapping matches. */
 2246|    335|                if ( (length != ML_MASK)
  ------------------
  |  |  261|    335|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    335|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2246:22): [True: 266, False: 69]
  ------------------
 2247|    266|                  && (offset >= 8)
  ------------------
  |  Branch (2247:22): [True: 133, False: 133]
  ------------------
 2248|    133|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2248:23): [True: 0, False: 133]
  |  Branch (2248:46): [True: 91, False: 42]
  ------------------
 2249|       |                    /* Copy the match. */
 2250|     91|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  349|     91|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2251|     91|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  349|     91|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2252|     91|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  349|     91|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2253|     91|                    op += length + MINMATCH;
  ------------------
  |  |  242|     91|#define MINMATCH 4
  ------------------
 2254|       |                    /* Both stages worked, load the next token. */
 2255|     91|                    continue;
 2256|     91|                }
 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|    244|                goto _copy_match;
 2261|    335|            }
 2262|       |
 2263|       |            /* decode literal length */
 2264|    571|            if (length == RUN_MASK) {
  ------------------
  |  |  263|    571|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    571|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    571|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2264:17): [True: 137, False: 434]
  ------------------
 2265|    137|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|    137|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    137|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    137|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2266|    137|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2266:21): [True: 28, False: 109]
  ------------------
 2267|    109|                length += addl;
 2268|    109|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    109|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    109|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2269|    109|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    109|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    109|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2270|    109|            }
 2271|       |
 2272|    543|#if LZ4_FAST_DEC_LOOP
 2273|    931|        safe_literal_copy:
 2274|    931|#endif
 2275|       |            /* copy literals */
 2276|    931|            cpy = op+length;
 2277|       |
 2278|    931|            LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|    931|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2279|    931|            if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  246|    931|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                          if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|    739|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2279:17): [True: 192, False: 739]
  |  Branch (2279:39): [True: 231, False: 508]
  ------------------
 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|    423|                if (partialDecoding) {
  ------------------
  |  Branch (2285:21): [True: 0, False: 423]
  ------------------
 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|    423|                } 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|    423|                    if ((ip+length != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2312:25): [True: 308, False: 115]
  |  Branch (2312:48): [True: 2, False: 113]
  ------------------
 2313|    310|                        DEBUGLOG(5, "should have been last run of literals")
  ------------------
  |  |  289|    310|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2314|    310|                        DEBUGLOG(5, "ip(%p) + length(%i) = %p != iend (%p)", ip, (int)length, ip+length, iend);
  ------------------
  |  |  289|    310|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2315|    310|                        DEBUGLOG(5, "or cpy(%p) > (oend-MFLIMIT)(%p)", cpy, oend-MFLIMIT);
  ------------------
  |  |  289|    310|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2316|    310|                        DEBUGLOG(5, "after writing %u bytes / %i bytes available", (unsigned)(op-(BYTE*)dst), outputSize);
  ------------------
  |  |  289|    310|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2317|    310|                        goto _output_error;
 2318|    310|                    }
 2319|    423|                }
 2320|    113|                LZ4_memmove(op, ip, length);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  357|    113|#    define LZ4_memmove __builtin_memmove
  ------------------
 2321|    113|                ip += length;
 2322|    113|                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|    113|                if (!partialDecoding || (cpy == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2328:21): [True: 113, False: 0]
  |  Branch (2328:41): [True: 0, False: 0]
  |  Branch (2328:58): [True: 0, False: 0]
  ------------------
 2329|    113|                    break;
 2330|    113|                }
 2331|    508|            } else {
 2332|    508|                LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2333|    508|                ip += length; op = cpy;
 2334|    508|            }
 2335|       |
 2336|       |            /* get offset */
 2337|    508|            offset = LZ4_readLE16(ip); ip+=2;
 2338|    508|            match = op - offset;
 2339|       |
 2340|       |            /* get matchlength */
 2341|    508|            length = token & ML_MASK;
  ------------------
  |  |  261|    508|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    508|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2342|    508|            DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|    508|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2343|       |
 2344|    752|    _copy_match:
 2345|    752|            if (length == ML_MASK) {
  ------------------
  |  |  261|    752|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    752|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2345:17): [True: 369, False: 383]
  ------------------
 2346|    369|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|    369|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2347|    369|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2347:21): [True: 4, False: 365]
  ------------------
 2348|    365|                length += addl;
 2349|    365|                if (unlikely((uptrval)(op)+length<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|    365|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    365|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 365]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2350|    365|            }
 2351|    748|            length += MINMATCH;
  ------------------
  |  |  242|    748|#define MINMATCH 4
  ------------------
 2352|       |
 2353|    748|#if LZ4_FAST_DEC_LOOP
 2354|    941|        safe_match_copy:
 2355|    941|#endif
 2356|    941|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|    941|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    941|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2356:17): [True: 941, False: 0]
  |  Branch (2356:34): [True: 114, False: 827]
  ------------------
 2357|       |            /* match starting within external dictionary */
 2358|    827|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2358:17): [True: 420, False: 407]
  |  Branch (2358:41): [True: 61, False: 359]
  ------------------
 2359|     61|                assert(dictEnd != NULL);
  ------------------
  |  |  273|     61|#    define assert(condition) ((void)0)
  ------------------
 2360|     61|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|     61|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|     61|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 4, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2361|      4|                    if (partialDecoding) length = MIN(length, (size_t)(oend-op));
  ------------------
  |  | 1845|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (1845:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2361:25): [True: 0, False: 4]
  ------------------
 2362|      4|                    else goto _output_error;   /* doesn't respect parsing restriction */
 2363|      4|                }
 2364|       |
 2365|     57|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2365:21): [True: 15, False: 42]
  ------------------
 2366|       |                    /* match fits entirely within external dictionary : just copy */
 2367|     15|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|     15|#    define LZ4_memmove __builtin_memmove
  ------------------
 2368|     15|                    op += length;
 2369|     42|                } else {
 2370|       |                    /* match stretches into both external dictionary and current block */
 2371|     42|                    size_t const copySize = (size_t)(lowPrefix - match);
 2372|     42|                    size_t const restSize = length - copySize;
 2373|     42|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|     42|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2374|     42|                    op += copySize;
 2375|     42|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2375:25): [True: 36, False: 6]
  ------------------
 2376|     36|                        BYTE* const endOfMatch = op + restSize;
 2377|     36|                        const BYTE* copyFrom = lowPrefix;
 2378|   122k|                        while (op < endOfMatch) *op++ = *copyFrom++;
  ------------------
  |  Branch (2378:32): [True: 122k, False: 36]
  ------------------
 2379|     36|                    } 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|     57|                continue;
 2384|     61|            }
 2385|    766|            assert(match >= lowPrefix);
  ------------------
  |  |  273|    766|#    define assert(condition) ((void)0)
  ------------------
 2386|       |
 2387|       |            /* copy match within block */
 2388|    766|            cpy = op + length;
 2389|       |
 2390|       |            /* partialDecoding : may end anywhere within the block */
 2391|    766|            assert(op<=oend);
  ------------------
  |  |  273|    766|#    define assert(condition) ((void)0)
  ------------------
 2392|    766|            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: 766]
  |  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|    766|            if (unlikely(offset<8)) {
  ------------------
  |  |  180|    766|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    766|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 459, False: 307]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2407|    459|                LZ4_write32(op, 0);   /* silence msan warning when offset==0 */
 2408|    459|                op[0] = match[0];
 2409|    459|                op[1] = match[1];
 2410|    459|                op[2] = match[2];
 2411|    459|                op[3] = match[3];
 2412|    459|                match += inc32table[offset];
 2413|    459|                LZ4_memcpy(op+4, match, 4);
  ------------------
  |  |  349|    459|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2414|    459|                match -= dec64table[offset];
 2415|    459|            } else {
 2416|    307|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    307|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2417|    307|                match += 8;
 2418|    307|            }
 2419|    766|            op += 8;
 2420|       |
 2421|    766|            if (unlikely(cpy > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|    766|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    766|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 175, False: 591]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2422|    175|                BYTE* const oCopyLimit = oend - (WILDCOPYLENGTH-1);
  ------------------
  |  |  244|    175|#define WILDCOPYLENGTH 8
  ------------------
 2423|    175|                if (cpy > oend-LASTLITERALS) { goto _output_error; } /* Error : last LASTLITERALS bytes must be literals (uncompressed) */
  ------------------
  |  |  245|    175|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2423:21): [True: 20, False: 155]
  ------------------
 2424|    155|                if (op < oCopyLimit) {
  ------------------
  |  Branch (2424:21): [True: 151, False: 4]
  ------------------
 2425|    151|                    LZ4_wildCopy8(op, match, oCopyLimit);
 2426|    151|                    match += oCopyLimit - op;
 2427|    151|                    op = oCopyLimit;
 2428|    151|                }
 2429|    371|                while (op < cpy) { *op++ = *match++; }
  ------------------
  |  Branch (2429:24): [True: 216, False: 155]
  ------------------
 2430|    591|            } else {
 2431|    591|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    591|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2432|    591|                if (length > 16) { LZ4_wildCopy8(op+8, match+8, cpy); }
  ------------------
  |  Branch (2432:21): [True: 307, False: 284]
  ------------------
 2433|    591|            }
 2434|    746|            op = cpy;   /* wildcopy correction */
 2435|    746|        }
 2436|       |
 2437|       |        /* end of decoding */
 2438|    113|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  289|    113|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2439|    113|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2440|       |
 2441|       |        /* Overflow error detected */
 2442|    635|    _output_error:
 2443|    635|        return (int) (-(((const char*)ip)-src))-1;
 2444|     12|    }
 2445|     12|}
lz4.c:read_variable_length:
 1981|  47.5k|{
 1982|  47.5k|    Rvl_t s, length = 0;
 1983|  47.5k|    assert(ip != NULL);
  ------------------
  |  |  273|  47.5k|#    define assert(condition) ((void)0)
  ------------------
 1984|  47.5k|    assert(*ip !=  NULL);
  ------------------
  |  |  273|  47.5k|#    define assert(condition) ((void)0)
  ------------------
 1985|  47.5k|    assert(ilimit != NULL);
  ------------------
  |  |  273|  47.5k|#    define assert(condition) ((void)0)
  ------------------
 1986|  47.5k|    if (initial_check && unlikely((*ip) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  2.50k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.50k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 28, False: 2.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1986:9): [True: 2.50k, False: 45.0k]
  ------------------
 1987|     28|        return rvl_error;
 1988|     28|    }
 1989|  47.5k|    s = **ip;
 1990|  47.5k|    (*ip)++;
 1991|  47.5k|    length += s;
 1992|  47.5k|    if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  47.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  47.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 5, False: 47.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1993|      5|        return rvl_error;
 1994|      5|    }
 1995|       |    /* accumulator overflow detection (32-bit mode only) */
 1996|  47.5k|    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: 47.5k]
  ------------------
 1997|      0|        return rvl_error;
 1998|      0|    }
 1999|  47.5k|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  47.5k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  47.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 45.7k, False: 1.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|  80.2k|    do {
 2001|  80.2k|        s = **ip;
 2002|  80.2k|        (*ip)++;
 2003|  80.2k|        length += s;
 2004|  80.2k|        if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  80.2k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  80.2k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 14, False: 80.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2005|     14|            return rvl_error;
 2006|     14|        }
 2007|       |        /* accumulator overflow detection (32-bit mode only) */
 2008|  80.2k|        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: 80.2k]
  ------------------
 2009|      0|            return rvl_error;
 2010|      0|        }
 2011|  80.2k|    } while (s == 255);
  ------------------
  |  Branch (2011:14): [True: 78.4k, False: 1.74k]
  ------------------
 2012|       |
 2013|  1.74k|    return length;
 2014|  1.76k|}
lz4.c:LZ4_wildCopy32:
  523|  20.2k|{
  524|  20.2k|    BYTE* d = (BYTE*)dstPtr;
  525|  20.2k|    const BYTE* s = (const BYTE*)srcPtr;
  526|  20.2k|    BYTE* const e = (BYTE*)dstEnd;
  527|       |
  528|   220k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|   220k|#    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|   220k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (528:79): [True: 200k, False: 20.2k]
  ------------------
  529|  20.2k|}
lz4.c:LZ4_readLE16:
  431|  75.2k|{
  432|  75.2k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (432:9): [True: 75.2k, False: 0]
  ------------------
  433|  75.2k|        return LZ4_read16(memPtr);
  434|  75.2k|    } else {
  435|      0|        const BYTE* p = (const BYTE*)memPtr;
  436|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  437|      0|    }
  438|  75.2k|}
lz4.c:LZ4_memcpy_using_offset:
  536|  35.2k|{
  537|  35.2k|    BYTE v[8];
  538|       |
  539|  35.2k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  |  273|  35.2k|#    define assert(condition) ((void)0)
  ------------------
  540|       |
  541|  35.2k|    switch(offset) {
  542|  27.0k|    case 1:
  ------------------
  |  Branch (542:5): [True: 27.0k, False: 8.20k]
  ------------------
  543|  27.0k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  236|  27.0k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|  27.0k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  544|  27.0k|        break;
  545|    335|    case 2:
  ------------------
  |  Branch (545:5): [True: 335, False: 34.9k]
  ------------------
  546|    335|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  349|    335|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  547|    335|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  349|    335|#    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|    335|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  349|    335|#    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|    335|        break;
  557|    426|    case 4:
  ------------------
  |  Branch (557:5): [True: 426, False: 34.8k]
  ------------------
  558|    426|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  349|    426|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  559|    426|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  349|    426|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  560|    426|        break;
  561|  7.44k|    default:
  ------------------
  |  Branch (561:5): [True: 7.44k, False: 27.8k]
  ------------------
  562|  7.44k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  563|  7.44k|        return;
  564|  35.2k|    }
  565|       |
  566|  27.8k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  27.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  567|  27.8k|    dstPtr += 8;
  568|  1.09M|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (568:12): [True: 1.06M, False: 27.8k]
  ------------------
  569|  1.06M|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  1.06M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  570|  1.06M|        dstPtr += 8;
  571|  1.06M|    }
  572|  27.8k|}
lz4.c:LZ4_memcpy_using_offset_base:
  497|  7.44k|{
  498|  7.44k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  |  273|  7.44k|#    define assert(condition) ((void)0)
  ------------------
  499|  7.44k|    if (offset < 8) {
  ------------------
  |  Branch (499:9): [True: 6.99k, False: 444]
  ------------------
  500|  6.99k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  501|  6.99k|        dstPtr[0] = srcPtr[0];
  502|  6.99k|        dstPtr[1] = srcPtr[1];
  503|  6.99k|        dstPtr[2] = srcPtr[2];
  504|  6.99k|        dstPtr[3] = srcPtr[3];
  505|  6.99k|        srcPtr += inc32table[offset];
  506|  6.99k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  349|  6.99k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  507|  6.99k|        srcPtr -= dec64table[offset];
  508|  6.99k|        dstPtr += 8;
  509|  6.99k|    } else {
  510|    444|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|    444|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  511|    444|        dstPtr += 8;
  512|    444|        srcPtr += 8;
  513|    444|    }
  514|       |
  515|  7.44k|    LZ4_wildCopy8(dstPtr, srcPtr, dstEnd);
  516|  7.44k|}

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

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

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

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

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

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

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

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.28k|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.28k|    len = MIN(len, left);
  ------------------
  |  |  124|  3.28k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 3.28k]
  |  |  ------------------
  ------------------
  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.28k|#ifndef HAVE_MASKED_READWRITE
  247|  3.28k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  3.28k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 82, False: 3.19k]
  |  |  ------------------
  ------------------
  248|    903|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 821, False: 82]
  ------------------
  249|    821|            *out++ = *from++;
  250|    821|            --len;
  251|    821|        }
  252|       |
  253|     82|        return out;
  254|     82|    }
  255|  3.19k|#endif
  256|       |
  257|  3.19k|    if (len)
  ------------------
  |  Branch (257:9): [True: 3.19k, False: 0]
  ------------------
  258|  3.19k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  3.19k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  3.19k|    return out;
  261|  3.28k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|   180k|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|   180k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|   180k|    chunk_t chunk_load;
  118|   180k|    uint32_t chunk_mod = 0;
  119|   180k|    uint32_t adv_amount;
  120|   180k|    int64_t sdist = out - from;
  121|   180k|    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|   180k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 180k]
  |  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|   180k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 161k, False: 19.6k]
  ------------------
  144|   161k|        memset(out, *from, len);
  145|   161k|        return out + len;
  146|   161k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 427, False: 19.2k]
  ------------------
  147|    427|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    427|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    427|    }
  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|  19.2k|#ifdef HAVE_HALF_CHUNK
  158|  19.2k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 2.73k, False: 16.4k]
  ------------------
  159|  2.73k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 34, False: 2.70k]
  ------------------
  160|     34|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  2.70k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 865, False: 1.83k]
  |  Branch (162:32): [True: 269, False: 1.56k]
  ------------------
  163|  1.13k|            halfchunk_t halfchunk_load = GET_HALFCHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  164|       |
  165|  1.13k|            if (len == sizeof(halfchunk_t)) {
  ------------------
  |  Branch (165:17): [True: 233, False: 901]
  ------------------
  166|    233|                storehalfchunk(out, &halfchunk_load);
  167|    233|                len -= sizeof(halfchunk_t);
  168|    233|                out += sizeof(halfchunk_t);
  169|    233|            }
  170|       |
  171|  1.13k|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|  1.13k|            goto rem_bytes;
  173|  1.13k|        }
  174|  2.70k|    }
  175|  18.0k|#endif
  176|       |
  177|  18.0k|#ifdef HAVE_CHUNKMEMSET_2
  178|  18.0k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 2.04k, False: 15.9k]
  ------------------
  179|  2.04k|        chunkmemset_2(from, &chunk_load);
  180|  2.04k|    } else
  181|  15.9k|#endif
  182|  15.9k|#ifdef HAVE_CHUNKMEMSET_4
  183|  15.9k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 1.69k, False: 14.2k]
  ------------------
  184|  1.69k|        chunkmemset_4(from, &chunk_load);
  185|  1.69k|    } else
  186|  14.2k|#endif
  187|  14.2k|#ifdef HAVE_CHUNKMEMSET_8
  188|  14.2k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 464, False: 13.8k]
  ------------------
  189|    464|        chunkmemset_8(from, &chunk_load);
  190|    464|    } else
  191|  13.8k|#endif
  192|  13.8k|#ifdef HAVE_CHUNKMEMSET_16
  193|  13.8k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 986, False: 12.8k]
  ------------------
  194|    986|        chunkmemset_16(from, &chunk_load);
  195|    986|    } else
  196|  12.8k|#endif
  197|  12.8k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  18.0k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  42.9k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 24.8k, False: 18.0k]
  ------------------
  202|  24.8k|        storechunk(out, &chunk_load);
  203|  24.8k|        storechunk(out + adv_amount, &chunk_load);
  204|  24.8k|        out += 2 * adv_amount;
  205|  24.8k|        len -= 2 * adv_amount;
  206|  24.8k|    }
  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|  26.6k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 8.62k, False: 18.0k]
  ------------------
  213|  8.62k|        storechunk(out, &chunk_load);
  214|  8.62k|        len -= adv_amount;
  215|  8.62k|        out += adv_amount;
  216|  8.62k|    }
  217|       |
  218|  18.0k|#ifdef HAVE_HALF_CHUNK
  219|  19.1k|rem_bytes:
  220|  19.1k|#endif
  221|  19.1k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 18.9k, False: 260]
  ------------------
  222|  18.9k|        memcpy(out, &chunk_load, len);
  223|  18.9k|        out += len;
  224|  18.9k|    }
  225|       |
  226|  19.1k|    return out;
  227|  18.0k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|     34|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|     34|    halfchunk_t chunk;
   93|     34|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|     34|    loadhalfchunk(from, &chunk);
   95|     34|    storehalfchunk(out, &chunk);
   96|     34|    out += align;
   97|     34|    from += align;
   98|     34|    len -= align;
   99|     34|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 34]
  ------------------
  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|     34|    return out;
  107|     34|}
chunkset_avx2.c:chunksize_avx2:
    9|   181k|static inline size_t CHUNKSIZE(void) {
   10|   181k|    return sizeof(chunk_t);
   11|   181k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|  52.0k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|  52.0k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|  52.0k|    chunk_t chunk;
   27|  52.0k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|  52.0k|    loadchunk(from, &chunk);
   29|  52.0k|    storechunk(out, &chunk);
   30|  52.0k|    out += align;
   31|  52.0k|    from += align;
   32|  52.0k|    len -= align;
   33|   313k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 261k, False: 52.0k]
  ------------------
   34|   261k|        loadchunk(from, &chunk);
   35|   261k|        storechunk(out, &chunk);
   36|   261k|        out += sizeof(chunk_t);
   37|   261k|        from += sizeof(chunk_t);
   38|   261k|        len -= sizeof(chunk_t);
   39|   261k|    }
   40|  52.0k|    return out;
   41|  52.0k|}

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

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

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

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

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

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

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

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

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

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

zstd_decompress_block.c:ZSTD_highbit32:
  175|   369k|{
  176|   369k|    assert(val != 0);
  ------------------
  |  |   70|   369k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   369k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   369k|}
zstd_decompress_block.c:ZSTD_countLeadingZeros32:
   70|   369k|{
   71|   369k|    assert(val != 0);
  ------------------
  |  |   70|   369k|#    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|   369k|}
entropy_common.c:ZSTD_countTrailingZeros32:
   29|  6.17k|{
   30|  6.17k|    assert(val != 0);
  ------------------
  |  |   70|  6.17k|#    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|  6.17k|}
entropy_common.c:ZSTD_highbit32:
  175|  16.3k|{
  176|  16.3k|    assert(val != 0);
  ------------------
  |  |   70|  16.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  16.3k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  16.3k|}
entropy_common.c:ZSTD_countLeadingZeros32:
   70|  16.3k|{
   71|  16.3k|    assert(val != 0);
  ------------------
  |  |   70|  16.3k|#    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|  16.3k|}
fse_decompress.c:ZSTD_highbit32:
  175|  48.3k|{
  176|  48.3k|    assert(val != 0);
  ------------------
  |  |   70|  48.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  48.3k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  48.3k|}
fse_decompress.c:ZSTD_countLeadingZeros32:
   70|  48.3k|{
   71|  48.3k|    assert(val != 0);
  ------------------
  |  |   70|  48.3k|#    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|  48.3k|}
huf_decompress.c:ZSTD_highbit32:
  175|  1.25k|{
  176|  1.25k|    assert(val != 0);
  ------------------
  |  |   70|  1.25k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  1.25k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  1.25k|}
huf_decompress.c:ZSTD_countLeadingZeros32:
   70|  1.25k|{
   71|  1.25k|    assert(val != 0);
  ------------------
  |  |   70|  1.25k|#    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.25k|}
huf_decompress.c:ZSTD_countTrailingZeros64:
   94|    345|{
   95|    345|    assert(val != 0);
  ------------------
  |  |   70|    345|#    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|    345|}

zstd_decompress_block.c:BIT_initDStream:
  255|  2.28k|{
  256|  2.28k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      3|# 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|      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 (256:9): [True: 3, False: 2.27k]
  ------------------
  257|       |
  258|  2.27k|    bitD->start = (const char*)srcBuffer;
  259|  2.27k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  2.27k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 2.21k, False: 65]
  ------------------
  262|  2.21k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  2.21k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  2.21k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  2.21k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 2.08k, False: 132]
  ------------------
  266|  2.21k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    132|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    132|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    132|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 132, False: 2.08k]
  ------------------
  267|  2.21k|    } else {
  268|     65|        bitD->ptr   = bitD->start;
  269|     65|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|     65|        switch(srcSize)
  271|     65|        {
  272|      5|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 5, False: 60]
  ------------------
  273|      5|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      5|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     11|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 6, False: 59]
  ------------------
  276|     11|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     11|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     14|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 3, False: 62]
  ------------------
  279|     14|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     14|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     22|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 8, False: 57]
  ------------------
  282|     22|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     22|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|     34|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 12, False: 53]
  ------------------
  285|     34|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     34|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|     51|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 17, False: 48]
  ------------------
  288|     51|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     51|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|     65|        default: break;
  ------------------
  |  Branch (290:9): [True: 14, False: 51]
  ------------------
  291|     65|        }
  292|     65|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|     65|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 56, False: 9]
  ------------------
  294|     65|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 9, False: 56]
  ------------------
  295|     65|        }
  296|     56|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|     56|    }
  298|       |
  299|  2.13k|    return srcSize;
  300|  2.27k|}
zstd_decompress_block.c:BIT_readBits:
  363|  8.43M|{
  364|  8.43M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  8.43M|    BIT_skipBits(bitD, nbBits);
  366|  8.43M|    return value;
  367|  8.43M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  8.43M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  8.43M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  8.43M|    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|  8.43M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  8.43M|{
  309|  8.43M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  8.43M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  8.43M|#    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|  8.43M|#if defined(__x86_64__) || defined(_M_X64)
  318|  8.43M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  8.43M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  10.4M|{
  355|  10.4M|    bitD->bitsConsumed += nbBits;
  356|  10.4M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  2.81M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  2.81M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  2.81M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 2.65M, False: 165k]
  |  |  ------------------
  ------------------
  416|  2.65M|        static const BitContainerType zeroFilled = 0;
  417|  2.65M|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  2.65M|        return BIT_DStream_overflow;
  420|  2.65M|    }
  421|       |
  422|   165k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   165k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   165k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 123k, False: 41.1k]
  ------------------
  425|   123k|        return BIT_reloadDStream_internal(bitD);
  426|   123k|    }
  427|  41.1k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 20.7k, False: 20.3k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  20.7k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 20.6k, False: 159]
  ------------------
  430|    159|        return BIT_DStream_completed;
  431|  20.7k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  20.3k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  20.3k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  20.3k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 942, False: 19.3k]
  ------------------
  436|    942|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    942|            result = BIT_DStream_endOfBuffer;
  438|    942|        }
  439|  20.3k|        bitD->ptr -= nbBytes;
  440|  20.3k|        bitD->bitsConsumed -= nbBytes*8;
  441|  20.3k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  20.3k|        return result;
  443|  41.1k|    }
  444|  41.1k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|   123k|{
  386|   123k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   123k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   123k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   123k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   123k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   123k|    bitD->bitsConsumed &= 7;
  390|   123k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   123k|    return BIT_DStream_unfinished;
  392|   123k|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  2.03M|{
  373|  2.03M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  2.03M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  2.03M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  2.03M|    BIT_skipBits(bitD, nbBits);
  376|  2.03M|    return value;
  377|  2.03M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  2.03M|{
  348|  2.03M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  2.03M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  2.03M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  2.03M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  2.03M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|    470|{
  451|    470|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 431, False: 39]
  |  Branch (451:49): [True: 419, False: 12]
  ------------------
  452|    470|}
fse_decompress.c:BIT_initDStream:
  255|    911|{
  256|    911|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      4|# 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|      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 (256:9): [True: 4, False: 907]
  ------------------
  257|       |
  258|    907|    bitD->start = (const char*)srcBuffer;
  259|    907|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|    907|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 756, False: 151]
  ------------------
  262|    756|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    756|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    756|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    756|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 720, False: 36]
  ------------------
  266|    756|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 36, False: 720]
  ------------------
  267|    756|    } else {
  268|    151|        bitD->ptr   = bitD->start;
  269|    151|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    151|        switch(srcSize)
  271|    151|        {
  272|     12|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 12, False: 139]
  ------------------
  273|     12|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     12|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     23|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 11, False: 140]
  ------------------
  276|     23|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     23|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     40|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 17, False: 134]
  ------------------
  279|     40|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     40|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     73|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 33, False: 118]
  ------------------
  282|     73|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     73|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    111|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 38, False: 113]
  ------------------
  285|    111|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    111|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    141|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 30, False: 121]
  ------------------
  288|    141|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    141|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    151|        default: break;
  ------------------
  |  Branch (290:9): [True: 10, False: 141]
  ------------------
  291|    151|        }
  292|    151|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    151|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 142, False: 9]
  ------------------
  294|    151|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 9, False: 142]
  ------------------
  295|    151|        }
  296|    142|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    142|    }
  298|       |
  299|    862|    return srcSize;
  300|    907|}
fse_decompress.c:BIT_readBits:
  363|  82.3k|{
  364|  82.3k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  82.3k|    BIT_skipBits(bitD, nbBits);
  366|  82.3k|    return value;
  367|  82.3k|}
fse_decompress.c:BIT_lookBits:
  331|  82.3k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  82.3k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  82.3k|    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|  82.3k|}
fse_decompress.c:BIT_getMiddleBits:
  308|  82.3k|{
  309|  82.3k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  82.3k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  82.3k|#    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|  82.3k|#if defined(__x86_64__) || defined(_M_X64)
  318|  82.3k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  82.3k|}
fse_decompress.c:BIT_skipBits:
  354|   102k|{
  355|   102k|    bitD->bitsConsumed += nbBits;
  356|   102k|}
fse_decompress.c:BIT_reloadDStream:
  413|  50.1k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  50.1k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  50.1k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 847, False: 49.2k]
  |  |  ------------------
  ------------------
  416|    847|        static const BitContainerType zeroFilled = 0;
  417|    847|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    847|        return BIT_DStream_overflow;
  420|    847|    }
  421|       |
  422|  49.2k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  49.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  49.2k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 12.6k, False: 36.5k]
  ------------------
  425|  12.6k|        return BIT_reloadDStream_internal(bitD);
  426|  12.6k|    }
  427|  36.5k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 29.1k, False: 7.45k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  29.1k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 28.3k, False: 782]
  ------------------
  430|    782|        return BIT_DStream_completed;
  431|  29.1k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  7.45k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  7.45k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  7.45k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 77, False: 7.38k]
  ------------------
  436|     77|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|     77|            result = BIT_DStream_endOfBuffer;
  438|     77|        }
  439|  7.45k|        bitD->ptr -= nbBytes;
  440|  7.45k|        bitD->bitsConsumed -= nbBytes*8;
  441|  7.45k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  7.45k|        return result;
  443|  36.5k|    }
  444|  36.5k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  12.6k|{
  386|  12.6k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  12.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  12.6k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  12.6k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  12.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  12.6k|    bitD->bitsConsumed &= 7;
  390|  12.6k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  12.6k|    return BIT_DStream_unfinished;
  392|  12.6k|}
fse_decompress.c:BIT_readBitsFast:
  372|  20.5k|{
  373|  20.5k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  20.5k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  20.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  20.5k|    BIT_skipBits(bitD, nbBits);
  376|  20.5k|    return value;
  377|  20.5k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  20.5k|{
  348|  20.5k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  20.5k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  20.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  20.5k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  20.5k|}
huf_decompress.c:BIT_initDStream:
  255|    980|{
  256|    980|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     11|# 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|     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 (256:9): [True: 11, False: 969]
  ------------------
  257|       |
  258|    969|    bitD->start = (const char*)srcBuffer;
  259|    969|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|    969|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 780, False: 189]
  ------------------
  262|    780|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    780|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    780|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    780|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 767, False: 13]
  ------------------
  266|    780|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 13, False: 767]
  ------------------
  267|    780|    } else {
  268|    189|        bitD->ptr   = bitD->start;
  269|    189|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    189|        switch(srcSize)
  271|    189|        {
  272|     15|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 15, False: 174]
  ------------------
  273|     15|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     15|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     25|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 10, False: 179]
  ------------------
  276|     25|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     25|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     44|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 19, False: 170]
  ------------------
  279|     44|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     44|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     67|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 23, False: 166]
  ------------------
  282|     67|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     67|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    102|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 35, False: 154]
  ------------------
  285|    102|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    102|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    124|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 22, False: 167]
  ------------------
  288|    124|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    124|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    189|        default: break;
  ------------------
  |  Branch (290:9): [True: 65, False: 124]
  ------------------
  291|    189|        }
  292|    189|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    189|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 172, False: 17]
  ------------------
  294|    189|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 17, False: 172]
  ------------------
  295|    189|        }
  296|    172|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    172|    }
  298|       |
  299|    939|    return srcSize;
  300|    969|}
huf_decompress.c:BIT_reloadDStream:
  413|  53.7k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  53.7k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  53.7k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 98, False: 53.6k]
  |  |  ------------------
  ------------------
  416|     98|        static const BitContainerType zeroFilled = 0;
  417|     98|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|     98|        return BIT_DStream_overflow;
  420|     98|    }
  421|       |
  422|  53.6k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  53.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  53.6k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 50.0k, False: 3.54k]
  ------------------
  425|  50.0k|        return BIT_reloadDStream_internal(bitD);
  426|  50.0k|    }
  427|  3.54k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 785, False: 2.76k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|    785|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 773, False: 12]
  ------------------
  430|     12|        return BIT_DStream_completed;
  431|    785|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  2.76k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  2.76k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  2.76k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 406, False: 2.35k]
  ------------------
  436|    406|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    406|            result = BIT_DStream_endOfBuffer;
  438|    406|        }
  439|  2.76k|        bitD->ptr -= nbBytes;
  440|  2.76k|        bitD->bitsConsumed -= nbBytes*8;
  441|  2.76k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  2.76k|        return result;
  443|  3.54k|    }
  444|  3.54k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|  76.3k|{
  386|  76.3k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  76.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  76.3k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  76.3k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  76.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  76.3k|    bitD->bitsConsumed &= 7;
  390|  76.3k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  76.3k|    return BIT_DStream_unfinished;
  392|  76.3k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  1.06M|{
  348|  1.06M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  1.06M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.06M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  1.06M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  1.06M|}
huf_decompress.c:BIT_skipBits:
  354|  1.06M|{
  355|  1.06M|    bitD->bitsConsumed += nbBits;
  356|  1.06M|}
huf_decompress.c:BIT_endOfDStream:
  450|    885|{
  451|    885|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 627, False: 258]
  |  Branch (451:49): [True: 11, False: 616]
  ------------------
  452|    885|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  26.4k|{
  402|  26.4k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  26.4k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 258, False: 26.2k]
  |  |  ------------------
  ------------------
  403|    258|        return BIT_DStream_overflow;
  404|  26.2k|    return BIT_reloadDStream_internal(bitD);
  405|  26.4k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  4.29k|{
  387|  4.29k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 4.29k, False: 2]
  ------------------
  388|  4.29k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|   828k|{
  375|   828k|    return ptr - sub;
  376|   828k|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|   828k|{
  362|   828k|    return ptr + add;
  363|   828k|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|    897|{
  387|    897|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 896, False: 1]
  ------------------
  388|    897|}

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

FSE_isError:
   31|  1.27k|unsigned FSE_isError(size_t code) { return ERR_isError(code); }
FSE_readNCount_bmi2:
  209|  4.53k|{
  210|  4.53k|#if DYNAMIC_BMI2
  211|  4.53k|    if (bmi2) {
  ------------------
  |  Branch (211:9): [True: 639, False: 3.89k]
  ------------------
  212|    639|        return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  213|    639|    }
  214|  3.89k|#endif
  215|  3.89k|    (void)bmi2;
  216|  3.89k|    return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  217|  4.53k|}
FSE_readNCount:
  222|  3.52k|{
  223|  3.52k|    return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);
  224|  3.52k|}
HUF_readStats_wksp:
  332|  1.07k|{
  333|  1.07k|#if DYNAMIC_BMI2
  334|  1.07k|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (334:9): [True: 688, False: 384]
  ------------------
  335|    688|        return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  336|    688|    }
  337|    384|#endif
  338|    384|    (void)flags;
  339|    384|    return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  340|  1.07k|}
entropy_common.c:FSE_readNCount_body_bmi2:
  201|    639|{
  202|    639|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  203|    639|}
entropy_common.c:FSE_readNCount_body:
   44|  4.53k|{
   45|  4.53k|    const BYTE* const istart = (const BYTE*) headerBuffer;
   46|  4.53k|    const BYTE* const iend = istart + hbSize;
   47|  4.53k|    const BYTE* ip = istart;
   48|  4.53k|    int nbBits;
   49|  4.53k|    int remaining;
   50|  4.53k|    int threshold;
   51|  4.53k|    U32 bitStream;
   52|  4.53k|    int bitCount;
   53|  4.53k|    unsigned charnum = 0;
   54|  4.53k|    unsigned const maxSV1 = *maxSVPtr + 1;
   55|  4.53k|    int previous0 = 0;
   56|       |
   57|  4.53k|    if (hbSize < 8) {
  ------------------
  |  Branch (57:9): [True: 269, False: 4.26k]
  ------------------
   58|       |        /* This function only works when hbSize >= 8 */
   59|    269|        char buffer[8] = {0};
   60|    269|        ZSTD_memcpy(buffer, headerBuffer, hbSize);
  ------------------
  |  |   44|    269|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
   61|    269|        {   size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,
   62|    269|                                                    buffer, sizeof(buffer));
   63|    269|            if (FSE_isError(countSize)) return countSize;
  ------------------
  |  Branch (63:17): [True: 56, False: 213]
  ------------------
   64|    213|            if (countSize > hbSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     53|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     53|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     53|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (64:17): [True: 53, False: 160]
  ------------------
   65|    160|            return countSize;
   66|    213|    }   }
   67|  4.26k|    assert(hbSize >= 8);
  ------------------
  |  |   70|  4.26k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   68|       |
   69|       |    /* init */
   70|  4.26k|    ZSTD_memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0]));   /* all symbols not present in NCount have a frequency of 0 */
  ------------------
  |  |   46|  4.26k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
   71|  4.26k|    bitStream = MEM_readLE32(ip);
   72|  4.26k|    nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  |  616|  4.26k|#define FSE_MIN_TABLELOG 5
  ------------------
   73|  4.26k|    if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  618|  4.26k|#define FSE_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     49|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     49|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     49|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (73:9): [True: 49, False: 4.21k]
  ------------------
   74|  4.21k|    bitStream >>= 4;
   75|  4.21k|    bitCount = 4;
   76|  4.21k|    *tableLogPtr = nbBits;
   77|  4.21k|    remaining = (1<<nbBits)+1;
   78|  4.21k|    threshold = 1<<nbBits;
   79|  4.21k|    nbBits++;
   80|       |
   81|  51.5k|    for (;;) {
   82|  51.5k|        if (previous0) {
  ------------------
  |  Branch (82:13): [True: 5.87k, False: 45.6k]
  ------------------
   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.87k|            int repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
   89|  6.17k|            while (repeats >= 12) {
  ------------------
  |  Branch (89:20): [True: 308, False: 5.87k]
  ------------------
   90|    308|                charnum += 3 * 12;
   91|    308|                if (LIKELY(ip <= iend-7)) {
  ------------------
  |  |  187|    308|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 281, False: 27]
  |  |  ------------------
  ------------------
   92|    281|                    ip += 3;
   93|    281|                } else {
   94|     27|                    bitCount -= (int)(8 * (iend - 7 - ip));
   95|     27|                    bitCount &= 31;
   96|     27|                    ip = iend - 4;
   97|     27|                }
   98|    308|                bitStream = MEM_readLE32(ip) >> bitCount;
   99|    308|                repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
  100|    308|            }
  101|  5.87k|            charnum += 3 * repeats;
  102|  5.87k|            bitStream >>= 2 * repeats;
  103|  5.87k|            bitCount += 2 * repeats;
  104|       |
  105|       |            /* Add the final repeat which isn't 0b11. */
  106|  5.87k|            assert((bitStream & 3) < 3);
  ------------------
  |  |   70|  5.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  107|  5.87k|            charnum += bitStream & 3;
  108|  5.87k|            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.87k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (114:17): [True: 25, False: 5.84k]
  ------------------
  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.84k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  187|  11.6k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 4.31k, False: 1.52k]
  |  |  ------------------
  ------------------
  |  Branch (120:41): [True: 413, False: 1.11k]
  ------------------
  121|  4.73k|                assert((bitCount >> 3) <= 3); /* For first condition to work */
  ------------------
  |  |   70|  4.73k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  122|  4.73k|                ip += bitCount>>3;
  123|  4.73k|                bitCount &= 7;
  124|  4.73k|            } else {
  125|  1.11k|                bitCount -= (int)(8 * (iend - 4 - ip));
  126|  1.11k|                bitCount &= 31;
  127|  1.11k|                ip = iend - 4;
  128|  1.11k|            }
  129|  5.84k|            bitStream = MEM_readLE32(ip) >> bitCount;
  130|  5.84k|        }
  131|  51.5k|        {
  132|  51.5k|            int const max = (2*threshold-1) - remaining;
  133|  51.5k|            int count;
  134|       |
  135|  51.5k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (135:17): [True: 37.2k, False: 14.3k]
  ------------------
  136|  37.2k|                count = bitStream & (threshold-1);
  137|  37.2k|                bitCount += nbBits-1;
  138|  37.2k|            } else {
  139|  14.3k|                count = bitStream & (2*threshold-1);
  140|  14.3k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (140:21): [True: 5.28k, False: 9.04k]
  ------------------
  141|  14.3k|                bitCount += nbBits;
  142|  14.3k|            }
  143|       |
  144|  51.5k|            count--;   /* extra accuracy */
  145|       |            /* When it matters (small blocks), this is a
  146|       |             * predictable branch, because we don't use -1.
  147|       |             */
  148|  51.5k|            if (count >= 0) {
  ------------------
  |  Branch (148:17): [True: 26.4k, False: 25.1k]
  ------------------
  149|  26.4k|                remaining -= count;
  150|  26.4k|            } else {
  151|  25.1k|                assert(count == -1);
  ------------------
  |  |   70|  25.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  152|  25.1k|                remaining += count;
  153|  25.1k|            }
  154|  51.5k|            normalizedCounter[charnum++] = (short)count;
  155|  51.5k|            previous0 = !count;
  156|       |
  157|  51.5k|            assert(threshold > 1);
  ------------------
  |  |   70|  51.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  158|  51.5k|            if (remaining < threshold) {
  ------------------
  |  Branch (158:17): [True: 18.0k, False: 33.4k]
  ------------------
  159|       |                /* This branch can be folded into the
  160|       |                 * threshold update condition because we
  161|       |                 * know that threshold > 1.
  162|       |                 */
  163|  18.0k|                if (remaining <= 1) break;
  ------------------
  |  Branch (163:21): [True: 4.15k, False: 13.9k]
  ------------------
  164|  13.9k|                nbBits = ZSTD_highbit32(remaining) + 1;
  165|  13.9k|                threshold = 1 << (nbBits - 1);
  166|  13.9k|            }
  167|  47.3k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (167:17): [True: 39, False: 47.3k]
  ------------------
  168|       |
  169|  47.3k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  187|  94.6k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 37.0k, False: 10.3k]
  |  |  ------------------
  ------------------
  |  Branch (169:41): [True: 1.70k, False: 8.61k]
  ------------------
  170|  38.7k|                ip += bitCount>>3;
  171|  38.7k|                bitCount &= 7;
  172|  38.7k|            } else {
  173|  8.61k|                bitCount -= (int)(8 * (iend - 4 - ip));
  174|  8.61k|                bitCount &= 31;
  175|  8.61k|                ip = iend - 4;
  176|  8.61k|            }
  177|  47.3k|            bitStream = MEM_readLE32(ip) >> bitCount;
  178|  47.3k|    }   }
  179|  4.21k|    if (remaining != 1) 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 (179:9): [True: 64, False: 4.15k]
  ------------------
  180|       |    /* Only possible when there are too many zeros. */
  181|  4.15k|    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: 4.15k]
  ------------------
  182|  4.15k|    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: 4.15k]
  ------------------
  183|  4.15k|    *maxSVPtr = charnum-1;
  184|       |
  185|  4.15k|    ip += (bitCount+7)>>3;
  186|  4.15k|    return ip-istart;
  187|  4.15k|}
entropy_common.c:FSE_readNCount_body_default:
  193|  3.89k|{
  194|  3.89k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  195|  3.89k|}
entropy_common.c:HUF_readStats_body_bmi2:
  322|    688|{
  323|    688|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1);
  324|    688|}
entropy_common.c:HUF_readStats_body:
  248|  1.07k|{
  249|  1.07k|    U32 weightTotal;
  250|  1.07k|    const BYTE* ip = (const BYTE*) src;
  251|  1.07k|    size_t iSize;
  252|  1.07k|    size_t oSize;
  253|       |
  254|  1.07k|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (254:9): [True: 12, False: 1.06k]
  ------------------
  255|  1.06k|    iSize = ip[0];
  256|       |    /* ZSTD_memset(huffWeight, 0, hwSize);   *//* is not necessary, even though some analyzer complain ... */
  257|       |
  258|  1.06k|    if (iSize >= 128) {  /* special header */
  ------------------
  |  Branch (258:9): [True: 43, False: 1.01k]
  ------------------
  259|     43|        oSize = iSize - 127;
  260|     43|        iSize = ((oSize+1)/2);
  261|     43|        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 (261:13): [True: 10, False: 33]
  ------------------
  262|     33|        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: 33]
  ------------------
  263|     33|        ip += 1;
  264|     33|        {   U32 n;
  265|    539|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (265:23): [True: 506, False: 33]
  ------------------
  266|    506|                huffWeight[n]   = ip[n/2] >> 4;
  267|    506|                huffWeight[n+1] = ip[n/2] & 15;
  268|    506|    }   }   }
  269|  1.01k|    else  {   /* header compressed with FSE (normal case) */
  270|  1.01k|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (270:13): [True: 13, False: 1.00k]
  ------------------
  271|       |        /* max (hwSize-1) values decoded, as last one is implied */
  272|  1.00k|        oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2);
  273|  1.00k|        if (FSE_isError(oSize)) return oSize;
  ------------------
  |  Branch (273:13): [True: 168, False: 836]
  ------------------
  274|  1.00k|    }
  275|       |
  276|       |    /* collect weight stats */
  277|    869|    ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));
  ------------------
  |  |   46|    869|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  278|    869|    weightTotal = 0;
  279|  95.6k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (279:26): [True: 94.8k, False: 811]
  ------------------
  280|  94.8k|            if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|  94.8k|#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|     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 (280:17): [True: 58, False: 94.8k]
  ------------------
  281|  94.8k|            rankStats[huffWeight[n]]++;
  282|  94.8k|            weightTotal += (1 << huffWeight[n]) >> 1;
  283|  94.8k|    }   }
  284|    811|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (284:9): [True: 3, False: 808]
  ------------------
  285|       |
  286|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
  287|    808|    {   U32 const tableLog = ZSTD_highbit32(weightTotal) + 1;
  288|    808|        if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|    808|#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|     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 (288:13): [True: 10, False: 798]
  ------------------
  289|    798|        *tableLogPtr = tableLog;
  290|       |        /* determine last weight */
  291|    798|        {   U32 const total = 1 << tableLog;
  292|    798|            U32 const rest = total - weightTotal;
  293|    798|            U32 const verif = 1 << ZSTD_highbit32(rest);
  294|    798|            U32 const lastWeight = ZSTD_highbit32(rest) + 1;
  295|    798|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|     63|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     63|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     63|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (295:17): [True: 63, False: 735]
  ------------------
  296|    735|            huffWeight[oSize] = (BYTE)lastWeight;
  297|    735|            rankStats[lastWeight]++;
  298|    735|    }   }
  299|       |
  300|       |    /* check tree construction validity */
  301|    735|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   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 (301:9): [True: 4, False: 731]
  |  Branch (301:31): [True: 0, False: 731]
  ------------------
  302|       |
  303|       |    /* results */
  304|    731|    *nbSymbolsPtr = (U32)(oSize+1);
  305|    731|    return iSize+1;
  306|    735|}
entropy_common.c:HUF_readStats_body_default:
  313|    384|{
  314|    384|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0);
  315|    384|}

zstd_common.c:ERR_isError:
   52|  11.2k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  11.2k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  11.2k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  11.2k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  4.00k|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: 273, False: 3.73k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  14.9k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  14.9k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  14.9k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  14.9k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|  49.0k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  49.0k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  49.0k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  49.0k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  2.82M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.82M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.82M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.82M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|   158k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   158k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   158k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   158k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|  36.1k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  36.1k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  36.1k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  36.1k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  27.8k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  27.8k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  27.8k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  27.8k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  1.27k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.27k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.27k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.27k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  2.82k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.82k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.82k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.82k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  3.53k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  3.53k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  3.53k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.53k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|  6.05k|{
  323|  6.05k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 6.05k, False: 0]
  ------------------
  324|  6.05k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  6.05k|}
zstd_ddict.c:MEM_isLittleEndian:
  141|  6.05k|{
  142|  6.05k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  6.05k|    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|  6.05k|}
zstd_ddict.c:MEM_read32:
  183|  6.05k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  31.4k|{
  323|  31.4k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 31.4k, False: 0]
  ------------------
  324|  31.4k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  31.4k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  32.6k|{
  142|  32.6k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  32.6k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  32.6k|}
zstd_decompress.c:MEM_read32:
  183|  31.4k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|    593|{
  291|    593|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 593, False: 0]
  ------------------
  292|    593|        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|    593|}
zstd_decompress.c:MEM_read16:
  182|    593|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|    603|{
  339|    603|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 603, False: 0]
  ------------------
  340|    603|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|    603|}
zstd_decompress.c:MEM_read64:
  184|    603|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  6.96k|{
  312|  6.96k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  6.96k|}
zstd_decompress_block.c:MEM_readLE32:
  322|    751|{
  323|    751|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 751, False: 0]
  ------------------
  324|    751|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|    751|}
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|    751|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  25.4k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  7.17k|{
  291|  7.17k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 7.17k, False: 0]
  ------------------
  292|  7.17k|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|  7.17k|}
zstd_decompress_block.c:MEM_read16:
  182|  7.17k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  13.0M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  2.81M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|   146k|{
  355|   146k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 146k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   146k|    else
  358|   146k|        return (size_t)MEM_readLE64(memPtr);
  359|   146k|}
zstd_decompress_block.c:MEM_readLE64:
  338|   146k|{
  339|   146k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 146k, False: 0]
  ------------------
  340|   146k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   146k|}
zstd_decompress_block.c:MEM_read64:
  184|   146k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|  46.8k|{
  323|  46.8k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 46.8k, False: 0]
  ------------------
  324|  46.8k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  46.8k|}
zstd_v05.c:MEM_isLittleEndian:
  141|   349k|{
  142|   349k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   349k|    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|   349k|}
zstd_v05.c:MEM_read32:
  183|  46.8k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.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_v05.c:MEM_32bits:
  137|   408k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.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_v05.c:MEM_read64:
  184|   147k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE16:
  290|    817|{
  291|    817|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 817, False: 0]
  ------------------
  292|    817|        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|    817|}
zstd_v05.c:MEM_read16:
  182|    817|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_v05.c:MEM_64bits:
  138|  22.9k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v05.c:MEM_writeLE16:
  300|   154k|{
  301|   154k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (301:9): [True: 154k, False: 0]
  ------------------
  302|   154k|        MEM_write16(memPtr, val);
  303|   154k|    } else {
  304|      0|        BYTE* p = (BYTE*)memPtr;
  305|      0|        p[0] = (BYTE)val;
  306|      0|        p[1] = (BYTE)(val>>8);
  307|      0|    }
  308|   154k|}
zstd_v05.c:MEM_write16:
  187|   154k|MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; }
entropy_common.c:MEM_readLE32:
  322|  57.7k|{
  323|  57.7k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 57.7k, False: 0]
  ------------------
  324|  57.7k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  57.7k|}
entropy_common.c:MEM_isLittleEndian:
  141|  57.7k|{
  142|  57.7k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  57.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|  57.7k|}
entropy_common.c:MEM_read32:
  183|  57.7k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  1.78k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  20.8k|{
  355|  20.8k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 20.8k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  20.8k|    else
  358|  20.8k|        return (size_t)MEM_readLE64(memPtr);
  359|  20.8k|}
fse_decompress.c:MEM_32bits:
  137|  20.8k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  20.8k|{
  142|  20.8k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  20.8k|    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|  20.8k|}
fse_decompress.c:MEM_readLE64:
  338|  20.8k|{
  339|  20.8k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 20.8k, False: 0]
  ------------------
  340|  20.8k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  20.8k|}
fse_decompress.c:MEM_read64:
  184|  20.8k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   242k|{
  142|   242k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   242k|    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|   242k|}
huf_decompress.c:MEM_write64:
  189|   168k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|  80.6k|{
  355|  80.6k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 80.6k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  80.6k|    else
  358|  80.6k|        return (size_t)MEM_readLE64(memPtr);
  359|  80.6k|}
huf_decompress.c:MEM_32bits:
  137|  81.5k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|  80.6k|{
  339|  80.6k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 80.6k, False: 0]
  ------------------
  340|  80.6k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  80.6k|}
huf_decompress.c:MEM_read64:
  184|  80.6k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   190k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  1.61k|{
  291|  1.61k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.61k, False: 0]
  ------------------
  292|  1.61k|        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.61k|}
huf_decompress.c:MEM_read16:
  182|  1.61k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

zstd_decompress.c:ZSTD_cpuSupportsBmi2:
  319|  7.15k|{
  320|  7.15k|    ZSTD_cpuid_t cpuid = ZSTD_cpuid();
  321|  7.15k|    return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);
  ------------------
  |  Branch (321:12): [True: 7.15k, False: 0]
  |  Branch (321:38): [True: 7.15k, False: 0]
  ------------------
  322|  7.15k|}
zstd_decompress_block.c:ZSTD_wildcopy:
  217|  1.50M|{
  218|  1.50M|    ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src;
  219|  1.50M|    const BYTE* ip = (const BYTE*)src;
  220|  1.50M|    BYTE* op = (BYTE*)dst;
  221|  1.50M|    BYTE* const oend = op + length;
  222|       |
  223|  1.50M|    if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) {
  ------------------
  |  |  200|   312k|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (223:9): [True: 312k, False: 1.18M]
  |  Branch (223:50): [True: 312k, False: 220]
  ------------------
  224|       |        /* Handle short offset copies. */
  225|  6.82M|        do {
  226|  6.82M|            COPY8(op, ip);
  ------------------
  |  |  177|  6.82M|#define COPY8(d,s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0)
  |  |  ------------------
  |  |  |  Branch (177:63): [Folded, False: 6.82M]
  |  |  ------------------
  ------------------
  227|  6.82M|        } while (op < oend);
  ------------------
  |  Branch (227:18): [True: 6.51M, False: 312k]
  ------------------
  228|  1.18M|    } else {
  229|  1.18M|        assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN);
  ------------------
  |  |   70|  1.18M|#    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|  1.18M|        ZSTD_copy16(op, ip);
  237|  1.18M|        if (16 >= length) return;
  ------------------
  |  Branch (237:13): [True: 972k, False: 216k]
  ------------------
  238|   216k|        op += 16;
  239|   216k|        ip += 16;
  240|  3.56M|        do {
  241|  3.56M|            COPY16(op, ip);
  ------------------
  |  |  197|  3.56M|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 3.56M]
  |  |  ------------------
  ------------------
  242|  3.56M|            COPY16(op, ip);
  ------------------
  |  |  197|  3.56M|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 3.56M]
  |  |  ------------------
  ------------------
  243|  3.56M|        }
  244|  3.56M|        while (op < oend);
  ------------------
  |  Branch (244:16): [True: 3.34M, False: 216k]
  ------------------
  245|   216k|    }
  246|  1.50M|}
zstd_decompress_block.c:ZSTD_copy8:
  170|  7.13M|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|  7.13M|    ZSTD_memcpy(dst, src, 8);
  ------------------
  |  |   44|  7.13M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  175|  7.13M|#endif
  176|  7.13M|}
zstd_decompress_block.c:ZSTD_copy16:
  183|  10.8M|static void ZSTD_copy16(void* dst, const void* src) {
  184|       |#if defined(ZSTD_ARCH_ARM_NEON)
  185|       |    vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));
  186|       |#elif defined(ZSTD_ARCH_X86_SSE2)
  187|       |    _mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src));
  188|       |#elif defined(__clang__)
  189|       |    ZSTD_memmove(dst, src, 16);
  190|       |#else
  191|       |    /* ZSTD_memmove is not inlined properly by gcc */
  192|       |    BYTE copy16_buf[16];
  193|       |    ZSTD_memcpy(copy16_buf, src, 16);
  194|       |    ZSTD_memcpy(dst, copy16_buf, 16);
  195|       |#endif
  196|  10.8M|}

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

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

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

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

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

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

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

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

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

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

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

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

blosc2.c:is_little_endian:
   42|  85.5M|static bool is_little_endian(void) {
   43|  85.5M|  static const int i = 1;
   44|  85.5M|  char* p = (char*)&i;
   45|       |
   46|  85.5M|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 85.5M, False: 0]
  ------------------
   47|  85.5M|    return true;
   48|  85.5M|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|  85.5M|}
blosc2.c:load_lib:
  317|      5|static inline void* load_lib(char *plugin_name, char *libpath) {
  318|      5|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (318:7): [True: 0, False: 5]
  ------------------
  319|      0|    BLOSC_TRACE_ERROR("Invalid plugin name");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|      0|    return NULL;
  321|      0|  }
  322|       |    // Attempt to directly load the library by name
  323|       |#if defined(_WIN32)
  324|       |    // Windows dynamic library (DLL) format
  325|       |    snprintf(libpath, PATH_MAX, "blosc2_%s.dll", plugin_name);
  326|       |#else
  327|       |    // Unix/Linux/Mac OS dynamic library (.so) format
  328|      5|    snprintf(libpath, PATH_MAX, "libblosc2_%s.so", plugin_name);
  329|      5|#endif
  330|      5|    void* loaded_lib = dlopen(libpath, RTLD_LAZY);
  331|      5|    if (loaded_lib != NULL) {
  ------------------
  |  Branch (331:9): [True: 0, False: 5]
  ------------------
  332|      0|        BLOSC_TRACE_INFO("Successfully loaded %s directly\n", libpath);
  ------------------
  |  |   95|      0|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  333|      0|        return loaded_lib;
  334|      5|    } else {
  335|       |#if defined(_WIN32)
  336|       |        BLOSC_TRACE_INFO("Failed to load %s directly, error: %lu\n", libpath, GetLastError());
  337|       |#else
  338|      5|        BLOSC_TRACE_INFO("Failed to load %s directly, error: %s\n", libpath, dlerror());
  ------------------
  |  |   95|      5|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  339|      5|#endif
  340|      5|    }
  341|       |    // If direct loading fails, fallback to using Python to find the library path
  342|      5|    if (get_libpath(plugin_name, libpath, "") < 0 && get_libpath(plugin_name, libpath, "3") < 0) {
  ------------------
  |  Branch (342:9): [True: 5, False: 0]
  |  Branch (342:54): [True: 5, False: 0]
  ------------------
  343|      5|        BLOSC_TRACE_ERROR("Problems when running python or python3 for getting plugin path");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|      5|        return NULL;
  345|      5|    }
  346|       |
  347|      0|    if (strlen(libpath) == 0) {
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|        BLOSC_TRACE_ERROR("Could not find plugin libpath");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  349|      0|        return NULL;
  350|      0|    }
  351|       |
  352|       |    // Try to load the library again with the path from Python
  353|      0|    loaded_lib = dlopen(libpath, RTLD_LAZY);
  354|      0|    if (loaded_lib == NULL) {
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|        BLOSC_TRACE_ERROR("Attempt to load plugin in path '%s' failed with error: %s", libpath, dlerror());
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|      0|    } else {
  357|      0|        BLOSC_TRACE_INFO("Successfully loaded library with Python path: %s\n", libpath);
  ------------------
  |  |   95|      0|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|      0|    }
  359|       |
  360|      0|    return loaded_lib;
  361|      0|}
blosc2.c:blosc2_valid_plugin_name:
  275|     15|static inline bool blosc2_valid_plugin_name(const char *plugin_name) {
  276|     15|  if (plugin_name == NULL || plugin_name[0] == '\0') {
  ------------------
  |  Branch (276:7): [True: 0, False: 15]
  |  Branch (276:30): [True: 0, False: 15]
  ------------------
  277|      0|    return false;
  278|      0|  }
  279|     96|  for (const unsigned char *p = (const unsigned char *)plugin_name; *p != '\0'; ++p) {
  ------------------
  |  Branch (279:69): [True: 81, False: 15]
  ------------------
  280|     81|    if (!isalnum(*p) && *p != '_') {
  ------------------
  |  Branch (280:9): [True: 0, False: 81]
  |  Branch (280:25): [True: 0, False: 0]
  ------------------
  281|      0|      return false;
  282|      0|    }
  283|     81|  }
  284|     15|  return true;
  285|     15|}
blosc2.c:get_libpath:
  288|     10|static inline int get_libpath(char *plugin_name, char *libpath, char *python_version) {
  289|     10|  BLOSC_TRACE_INFO("Trying to get plugin path with python%s\n", python_version);
  ------------------
  |  |   95|     10|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|     10|  char python_cmd[PATH_MAX] = {0};
  291|     10|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (291:7): [True: 0, False: 10]
  ------------------
  292|      0|    BLOSC_TRACE_ERROR("Invalid plugin name");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  294|      0|  }
  295|     10|  int written = snprintf(python_cmd, sizeof(python_cmd),
  296|     10|                         "python%s -c \"import blosc2_%s; blosc2_%s.print_libpath()\"",
  297|     10|                         python_version, plugin_name, plugin_name);
  298|     10|  if (written < 0 || (size_t)written >= sizeof(python_cmd)) {
  ------------------
  |  Branch (298:7): [True: 0, False: 10]
  |  Branch (298:22): [True: 0, False: 10]
  ------------------
  299|      0|    BLOSC_TRACE_ERROR("Python command is too long");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|      0|    return BLOSC2_ERROR_FAILURE;
  301|      0|  }
  302|     10|  FILE *fp = popen(python_cmd, "r");
  303|     10|  if (fp == NULL) {
  ------------------
  |  Branch (303:7): [True: 0, False: 10]
  ------------------
  304|      0|    BLOSC_TRACE_ERROR("Could not run python");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  305|      0|    return BLOSC2_ERROR_FAILURE;
  306|      0|  }
  307|     10|  if (fgets(libpath, PATH_MAX, fp) == NULL) {
  ------------------
  |  Branch (307:7): [True: 10, False: 0]
  ------------------
  308|     10|    BLOSC_TRACE_ERROR("Could not read python output");
  ------------------
  |  |   93|     10|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|     10|    pclose(fp);
  310|     10|    return BLOSC2_ERROR_FAILURE;
  311|     10|  }
  312|      0|  pclose(fp);
  313|       |
  314|      0|  return BLOSC2_ERROR_SUCCESS;
  315|     10|}
blosc2.c:sw32_:
  115|   275k|static inline int32_t sw32_(const void* pa) {
  116|   275k|  int32_t idest;
  117|       |
  118|   275k|  bool little_endian = is_little_endian();
  119|   275k|  if (little_endian) {
  ------------------
  |  Branch (119:7): [True: 275k, False: 0]
  ------------------
  120|   275k|    memcpy(&idest, pa, sizeof(idest));
  121|   275k|  }
  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|   275k|  return idest;
  137|   275k|}
frame.c:endian_handler:
   56|   548k|{
   57|   548k|  bool little_endian = is_little_endian();
   58|   548k|  if (little_endian == little) {
  ------------------
  |  Branch (58:7): [True: 0, False: 548k]
  ------------------
   59|      0|    memcpy(dest, pa, size);
   60|      0|  }
   61|   548k|  else {
   62|   548k|    uint8_t* pa_ = (uint8_t*)pa;
   63|   548k|    uint8_t pa2_[8];
   64|   548k|    switch (size) {
   65|   229k|      case 8:
  ------------------
  |  Branch (65:7): [True: 229k, False: 318k]
  ------------------
   66|   229k|        pa2_[0] = pa_[7];
   67|   229k|        pa2_[1] = pa_[6];
   68|   229k|        pa2_[2] = pa_[5];
   69|   229k|        pa2_[3] = pa_[4];
   70|   229k|        pa2_[4] = pa_[3];
   71|   229k|        pa2_[5] = pa_[2];
   72|   229k|        pa2_[6] = pa_[1];
   73|   229k|        pa2_[7] = pa_[0];
   74|   229k|        break;
   75|   300k|      case 4:
  ------------------
  |  Branch (75:7): [True: 300k, False: 247k]
  ------------------
   76|   300k|        pa2_[0] = pa_[3];
   77|   300k|        pa2_[1] = pa_[2];
   78|   300k|        pa2_[2] = pa_[1];
   79|   300k|        pa2_[3] = pa_[0];
   80|   300k|        break;
   81|  3.62k|      case 2:
  ------------------
  |  Branch (81:7): [True: 3.62k, False: 544k]
  ------------------
   82|  3.62k|        pa2_[0] = pa_[1];
   83|  3.62k|        pa2_[1] = pa_[0];
   84|  3.62k|        break;
   85|  14.0k|      case 1:
  ------------------
  |  Branch (85:7): [True: 14.0k, False: 534k]
  ------------------
   86|  14.0k|        pa2_[0] = pa_[0];
   87|  14.0k|        break;
   88|      0|      default:
  ------------------
  |  Branch (88:7): [True: 0, False: 548k]
  ------------------
   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|   548k|    }
   91|   548k|    memcpy(dest, pa2_, size);
   92|   548k|  }
   93|   548k|}
frame.c:is_little_endian:
   42|   548k|static bool is_little_endian(void) {
   43|   548k|  static const int i = 1;
   44|   548k|  char* p = (char*)&i;
   45|       |
   46|   548k|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 548k, False: 0]
  ------------------
   47|   548k|    return true;
   48|   548k|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|   548k|}
frame.c:blosc2_nchunks_to_offsets_nbytes:
  103|   151k|static inline bool blosc2_nchunks_to_offsets_nbytes(int64_t nchunks, int32_t *off_nbytes) {
  104|   151k|  const int64_t max_nchunks = INT32_MAX / (int64_t)sizeof(int64_t);
  105|   151k|  if (nchunks < 0 || nchunks > max_nchunks) {
  ------------------
  |  Branch (105:7): [True: 0, False: 151k]
  |  Branch (105:22): [True: 79, False: 151k]
  ------------------
  106|     79|    return false;
  107|     79|  }
  108|   151k|  if (off_nbytes != NULL) {
  ------------------
  |  Branch (108:7): [True: 151k, False: 0]
  ------------------
  109|   151k|    *off_nbytes = (int32_t)(nchunks * (int64_t)sizeof(int64_t));
  110|   151k|  }
  111|       |  return true;
  112|   151k|}

blosc2_stdio_open:
  137|     38|void *blosc2_stdio_open(const char *urlpath, const char *mode, void *params) {
  138|     38|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|     38|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  139|     38|  if (urlpath == NULL || mode == NULL) {
  ------------------
  |  Branch (139:7): [True: 38, False: 0]
  |  Branch (139:26): [True: 0, False: 0]
  ------------------
  140|     38|    BLOSC_TRACE_ERROR("Invalid arguments for stdio open.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|     38|    return NULL;
  142|     38|  }
  143|      0|  FILE *file = fopen(urlpath, mode);
  144|      0|  if (file == NULL) {
  ------------------
  |  Branch (144:7): [True: 0, False: 0]
  ------------------
  145|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|      0|    return NULL;
  147|      0|  }
  148|      0|  blosc2_stdio_file *my_fp = malloc(sizeof(blosc2_stdio_file));
  149|      0|  if (my_fp == NULL) {
  ------------------
  |  Branch (149:7): [True: 0, False: 0]
  ------------------
  150|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  151|      0|    fclose(file);
  152|      0|    return NULL;
  153|      0|  }
  154|      0|  my_fp->file = file;
  155|      0|  return my_fp;
  156|      0|}
blosc2_stdio_destroy:
  302|  12.8k|int blosc2_stdio_destroy(void* params) {
  303|  12.8k|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|  12.8k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  304|  12.8k|  return 0;
  305|  12.8k|}

do_nothing:
  632|  1.62M|int do_nothing(uint8_t filter, char cmode) {
  633|  1.62M|  if (cmode == 'c') {
  ------------------
  |  Branch (633:7): [True: 0, False: 1.62M]
  ------------------
  634|      0|    return (filter == BLOSC_NOFILTER);
  635|  1.62M|  } else {
  636|       |    // TRUNC_PREC do not have to be applied during decompression
  637|  1.62M|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (637:13): [True: 541k, False: 1.07M]
  |  Branch (637:43): [True: 147k, False: 932k]
  ------------------
  638|  1.62M|  }
  639|  1.62M|}
next_filter:
  642|   504k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  643|   822k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (643:36): [True: 822k, False: 0]
  ------------------
  644|   822k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (644:9): [True: 504k, False: 317k]
  ------------------
  645|   504k|      return filters[i];
  646|   504k|    }
  647|   822k|  }
  648|      0|  return BLOSC_NOFILTER;
  649|   504k|}
last_filter:
  652|   132k|int last_filter(const uint8_t* filters, char cmode) {
  653|   132k|  int last_index = -1;
  654|   930k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (654:40): [True: 797k, False: 132k]
  ------------------
  655|   797k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (655:9): [True: 427k, False: 370k]
  ------------------
  656|   427k|      last_index = i;
  657|   427k|    }
  658|   797k|  }
  659|   132k|  return last_index;
  660|   132k|}
read_chunk_header:
  739|  85.2M|{
  740|  85.2M|  memset(header, 0, sizeof(blosc_header));
  741|       |
  742|  85.2M|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (742:7): [True: 0, False: 85.2M]
  ------------------
  743|      0|    BLOSC_TRACE_ERROR("Not enough space to read Blosc header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      0|    return BLOSC2_ERROR_READ_BUFFER;
  745|      0|  }
  746|       |
  747|  85.2M|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  748|       |
  749|  85.2M|  bool little_endian = is_little_endian();
  750|       |
  751|  85.2M|  if (!little_endian) {
  ------------------
  |  Branch (751:7): [True: 0, False: 85.2M]
  ------------------
  752|      0|    header->nbytes = bswap32_(header->nbytes);
  753|      0|    header->blocksize = bswap32_(header->blocksize);
  754|      0|    header->cbytes = bswap32_(header->cbytes);
  755|      0|  }
  756|       |
  757|  85.2M|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (757:7): [True: 42, False: 85.2M]
  ------------------
  758|     42|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   93|     42|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     42|    do {                                            \
  |  |  |  |   98|     42|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     42|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     42|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|     42|    return BLOSC2_ERROR_INVALID_HEADER;
  760|     42|  }
  761|  85.2M|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (761:7): [True: 33, False: 85.2M]
  ------------------
  762|     33|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   93|     33|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     33|    do {                                            \
  |  |  |  |   98|     33|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     33|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 33, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     33|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  763|     33|    return BLOSC2_ERROR_INVALID_HEADER;
  764|     33|  }
  765|  85.2M|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (765:7): [True: 7, False: 85.2M]
  ------------------
  766|      7|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      7|    return BLOSC2_ERROR_INVALID_HEADER;
  768|      7|  }
  769|  85.2M|  if (header->typesize == 0) {
  ------------------
  |  Branch (769:7): [True: 5, False: 85.2M]
  ------------------
  770|      5|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  771|      5|    return BLOSC2_ERROR_INVALID_HEADER;
  772|      5|  }
  773|       |
  774|       |  /* Read extended header if it is wanted */
  775|  85.2M|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (775:7): [True: 123k, False: 85.1M]
  |  Branch (775:28): [True: 122k, False: 741]
  |  Branch (775:65): [True: 122k, False: 470]
  ------------------
  776|   122k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (776:9): [True: 5, False: 122k]
  ------------------
  777|      5|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|      5|      return BLOSC2_ERROR_INVALID_HEADER;
  779|      5|    }
  780|   122k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (780:9): [True: 0, False: 122k]
  ------------------
  781|      0|      BLOSC_TRACE_ERROR("Not enough space to read Blosc extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  782|      0|      return BLOSC2_ERROR_READ_BUFFER;
  783|      0|    }
  784|       |
  785|   122k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  786|   122k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  787|       |
  788|   122k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (788:9): [True: 322, False: 121k]
  |  Branch (788:55): [True: 103, False: 219]
  ------------------
  789|    103|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  790|    103|      if (special_type != 0) {
  ------------------
  |  Branch (790:11): [True: 6, False: 97]
  ------------------
  791|      6|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  792|      6|        return BLOSC2_ERROR_INVALID_HEADER;
  793|      6|      }
  794|    103|    }
  795|       |
  796|   122k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  797|   122k|    if (special_type != 0) {
  ------------------
  |  Branch (797:9): [True: 22.4k, False: 99.6k]
  ------------------
  798|  22.4k|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (798:11): [True: 414, False: 22.0k]
  ------------------
  799|       |        // In this case, the actual type size must be derived from the cbytes
  800|    414|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  801|    414|        if (typesize <= 0) {
  ------------------
  |  Branch (801:13): [True: 1, False: 413]
  ------------------
  802|      1|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  804|      1|        }
  805|    413|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (805:13): [True: 0, False: 413]
  ------------------
  806|      0|          BLOSC_TRACE_ERROR("`typesize` is greater than maximum allowed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  807|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  808|      0|        }
  809|    413|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (809:13): [True: 4, False: 409]
  ------------------
  810|      4|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  811|      4|          return BLOSC2_ERROR_INVALID_HEADER;
  812|      4|        }
  813|    409|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (813:13): [True: 15, False: 394]
  ------------------
  814|     15|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|     15|          return BLOSC2_ERROR_INVALID_HEADER;
  816|     15|        }
  817|    409|      }
  818|  22.0k|      else {
  819|       |        // All-zero chunks fill with memset, which works regardless of element alignment.
  820|  22.0k|        if (special_type != BLOSC2_SPECIAL_ZERO
  ------------------
  |  Branch (820:13): [True: 1.39k, False: 20.6k]
  ------------------
  821|  1.39k|            && header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (821:16): [True: 7, False: 1.38k]
  ------------------
  822|      7|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  823|      7|          return BLOSC2_ERROR_INVALID_HEADER;
  824|      7|        }
  825|  22.0k|      }
  826|  22.4k|    }
  827|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  828|       |    // did not initialize filters to zero beyond the max supported.
  829|   122k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (829:9): [True: 5.85k, False: 116k]
  ------------------
  830|  5.85k|      header->filters[5] = 0;
  831|  5.85k|      header->filters_meta[5] = 0;
  832|  5.85k|    }
  833|   122k|  }
  834|  85.1M|  else {
  835|  85.1M|    flags_to_filters(header->flags, header->filters);
  836|  85.1M|  }
  837|  85.2M|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (837:7): [True: 50.5M, False: 34.7M]
  ------------------
  838|  50.5M|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (838:7): [True: 7, False: 50.5M]
  ------------------
  839|       |    /* Version from future with unsupported chunk features. */
  840|      7|    return BLOSC2_ERROR_VERSION_SUPPORT;
  841|      7|  }
  842|  85.2M|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (842:7): [True: 310, False: 85.2M]
  ------------------
  843|    310|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (843:7): [True: 1, False: 309]
  ------------------
  844|      1|    BLOSC_TRACE_ERROR("VL-block chunks cannot be memcpyed.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  845|      1|    return BLOSC2_ERROR_INVALID_HEADER;
  846|      1|  }
  847|  85.2M|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (847:7): [True: 85.2M, False: 309]
  ------------------
  848|  85.2M|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (848:7): [True: 85.2M, False: 16.8k]
  |  Branch (848:29): [True: 90.5k, False: 85.1M]
  ------------------
  849|  90.5k|    header->blocksize = header->nbytes;
  850|  90.5k|  }
  851|  85.2M|  return 0;
  852|  85.2M|}
fill_codec:
  935|      5|int fill_codec(blosc2_codec *codec) {
  936|      5|  char libpath[PATH_MAX];
  937|      5|  void *lib = load_lib(codec->compname, libpath);
  938|      5|  if(lib == NULL) {
  ------------------
  |  Branch (938:6): [True: 5, False: 0]
  ------------------
  939|      5|    BLOSC_TRACE_ERROR("Error while loading the library for codec `%s`", codec->compname);
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|      5|    return BLOSC2_ERROR_FAILURE;
  941|      5|  }
  942|       |
  943|      0|  codec_info *info = dlsym(lib, "info");
  944|      0|  if (info == NULL) {
  ------------------
  |  Branch (944:7): [True: 0, False: 0]
  ------------------
  945|      0|    BLOSC_TRACE_ERROR("`info` symbol cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  946|      0|    dlclose(lib);
  947|      0|    return BLOSC2_ERROR_FAILURE;
  948|      0|  }
  949|      0|  codec->encoder = dlsym(lib, info->encoder);
  950|      0|  codec->decoder = dlsym(lib, info->decoder);
  951|       |
  952|      0|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (952:7): [True: 0, False: 0]
  |  Branch (952:33): [True: 0, False: 0]
  ------------------
  953|      0|    BLOSC_TRACE_ERROR("encoder or decoder cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  954|      0|    dlclose(lib);
  955|      0|    return BLOSC2_ERROR_FAILURE;
  956|      0|  }
  957|       |
  958|       |  /* If ever add .free function in future for codec params
  959|       |  codecparams_info *info2 = dlsym(lib, "info2");
  960|       |  if (info2 != NULL) {
  961|       |    // New plugin (e.g. openzl) with free function for codec_params defined
  962|       |    // will be used when destroying context in blosc2_free_ctx
  963|       |      codec->free = dlsym(lib, info2->free);
  964|       |  }
  965|       |  else{
  966|       |    codec->free = NULL;
  967|       |  }
  968|       |  */
  969|       |
  970|      0|  return BLOSC2_ERROR_SUCCESS;
  971|      0|}
_cycle_buffers:
 1048|   388k|void _cycle_buffers(uint8_t **src, uint8_t **dest, uint8_t **tmp) {
 1049|   388k|  uint8_t *tmp2 = *src;
 1050|   388k|  *src = *dest;
 1051|   388k|  *dest = *tmp;
 1052|   388k|  *tmp = tmp2;
 1053|   388k|}
pipeline_backward:
 1475|   118k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1476|   118k|  blosc2_context* context = thread_context->parent_context;
 1477|   118k|  int32_t typesize = context->typesize;
 1478|   118k|  uint8_t* filters = context->filters;
 1479|   118k|  uint8_t* filters_meta = context->filters_meta;
 1480|   118k|  uint8_t* _src = src;
 1481|   118k|  uint8_t* _dest = tmp;
 1482|   118k|  uint8_t* _tmp = tmp2;
 1483|   118k|  int errcode = 0;
 1484|       |
 1485|   571k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1485:40): [True: 571k, False: 0]
  ------------------
 1486|       |    // Delta filter requires the whole chunk ready
 1487|   571k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1487:28): [True: 117k, False: 453k]
  |  Branch (1487:56): [True: 74.2k, False: 379k]
  ------------------
 1488|   379k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1488:28): [True: 99.1k, False: 279k]
  ------------------
 1489|   571k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1489:9): [True: 291k, False: 279k]
  |  Branch (1489:29): [True: 291k, False: 0]
  ------------------
 1490|   291k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1490:10): [True: 92.4k, False: 198k]
  |  Branch (1490:39): [True: 153k, False: 45.4k]
  ------------------
 1491|   245k|      _dest = dest + offset;
 1492|   245k|    }
 1493|   571k|    int rc = BLOSC2_ERROR_SUCCESS;
 1494|   571k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1494:9): [True: 459k, False: 112k]
  ------------------
 1495|   459k|      switch (filters[i]) {
 1496|   123k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1496:9): [True: 123k, False: 335k]
  ------------------
 1497|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1498|   123k|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1498:28): [True: 11.3k, False: 112k]
  ------------------
 1499|   123k|          break;
 1500|  60.7k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1500:9): [True: 60.7k, False: 398k]
  ------------------
 1501|  60.7k|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1501:15): [True: 0, False: 60.7k]
  ------------------
 1502|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1503|      0|          }
 1504|  60.7k|          break;
 1505|  92.4k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1505:9): [True: 92.4k, False: 366k]
  ------------------
 1506|  92.4k|          if (context->nthreads == 1) {
  ------------------
  |  Branch (1506:15): [True: 92.4k, False: 0]
  ------------------
 1507|       |            /* Serial mode */
 1508|  92.4k|            delta_decoder(dest, offset, bsize, typesize, _dest);
 1509|  92.4k|          } else {
 1510|      0|            struct blosc_job_group *job = context->job;
 1511|      0|            blosc2_pthread_mutex_t *delta_mutex = job != NULL ? &job->delta_mutex : &context->delta_mutex;
  ------------------
  |  |   89|      0|#define blosc2_pthread_mutex_t pthread_mutex_t
  ------------------
  |  Branch (1511:51): [True: 0, False: 0]
  ------------------
 1512|      0|            blosc2_pthread_cond_t *delta_cv = job != NULL ? &job->delta_cv : &context->delta_cv;
  ------------------
  |  |   95|      0|#define blosc2_pthread_cond_t pthread_cond_t
  ------------------
  |  Branch (1512:47): [True: 0, False: 0]
  ------------------
 1513|      0|            int *dref_not_init = job != NULL ? &job->dref_not_init : &context->dref_not_init;
  ------------------
  |  Branch (1513:34): [True: 0, False: 0]
  ------------------
 1514|       |            /* Force the thread in charge of the block 0 to go first */
 1515|      0|            blosc2_pthread_mutex_lock(delta_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 1516|      0|            if (*dref_not_init) {
  ------------------
  |  Branch (1516:17): [True: 0, False: 0]
  ------------------
 1517|      0|              if (offset != 0) {
  ------------------
  |  Branch (1517:19): [True: 0, False: 0]
  ------------------
 1518|      0|                blosc2_pthread_cond_wait(delta_cv, delta_mutex);
  ------------------
  |  |   98|      0|#define blosc2_pthread_cond_wait(a, b) pthread_cond_wait((a), (b))
  ------------------
 1519|      0|              } else {
 1520|      0|                delta_decoder(dest, offset, bsize, typesize, _dest);
 1521|      0|                *dref_not_init = 0;
 1522|      0|                blosc2_pthread_cond_broadcast(delta_cv);
  ------------------
  |  |  100|      0|#define blosc2_pthread_cond_broadcast(a) pthread_cond_broadcast((a))
  ------------------
 1523|      0|              }
 1524|      0|            }
 1525|      0|            blosc2_pthread_mutex_unlock(delta_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 1526|      0|            if (offset != 0) {
  ------------------
  |  Branch (1526:17): [True: 0, False: 0]
  ------------------
 1527|      0|              delta_decoder(dest, offset, bsize, typesize, _dest);
 1528|      0|            }
 1529|      0|          }
 1530|  92.4k|          break;
 1531|  47.3k|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1531:9): [True: 47.3k, False: 411k]
  ------------------
 1532|       |          // TRUNC_PREC filter does not need to be undone
 1533|  47.3k|          break;
 1534|   135k|        default:
  ------------------
  |  Branch (1534:9): [True: 135k, False: 324k]
  ------------------
 1535|   135k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1535:15): [True: 79, False: 135k]
  ------------------
 1536|     79|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   93|     79|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     79|    do {                                            \
  |  |  |  |   98|     79|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     79|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     79|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1537|     79|                              filters[i]);
 1538|     79|            errcode = -1;
 1539|     79|          }
 1540|   459k|      }
 1541|   459k|    } else {
 1542|       |        // Look for the filters_meta in user filters and run it
 1543|   402k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1543:30): [True: 402k, False: 168]
  ------------------
 1544|   402k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1544:15): [True: 111k, False: 290k]
  ------------------
 1545|   111k|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1545:17): [True: 0, False: 111k]
  ------------------
 1546|       |              // Dynamically load filter
 1547|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1547:19): [True: 0, False: 0]
  ------------------
 1548|      0|                BLOSC_TRACE_ERROR("Could not load filter %d.", g_filters[j].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1549|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1550|      0|              }
 1551|      0|            }
 1552|   111k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1552:17): [True: 111k, False: 0]
  ------------------
 1553|   111k|              blosc2_dparams dparams;
 1554|   111k|              blosc2_ctx_get_dparams(context, &dparams);
 1555|   111k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1556|   111k|            } else {
 1557|      0|              BLOSC_TRACE_ERROR("Backward function is NULL");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1558|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1559|      0|            }
 1560|   111k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1560:17): [True: 30, False: 111k]
  ------------------
 1561|     30|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   93|     30|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     30|    do {                                            \
  |  |  |  |   98|     30|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     30|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 30, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     30|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1562|     30|              return rc;
 1563|     30|            }
 1564|   111k|            goto urfiltersuccess;
 1565|   111k|          }
 1566|   402k|        }
 1567|    168|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|    168|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    168|    do {                                            \
  |  |  |  |   98|    168|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    168|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 168, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    168|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1568|    168|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1569|   111k|      urfiltersuccess:;
 1570|   111k|    }
 1571|       |
 1572|       |    // Cycle buffers when required
 1573|   571k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1573:9): [True: 435k, False: 135k]
  |  Branch (1573:43): [True: 388k, False: 47.3k]
  ------------------
 1574|   388k|      _cycle_buffers(&_src, &_dest, &_tmp);
 1575|   388k|    }
 1576|   571k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1576:9): [True: 117k, False: 453k]
  ------------------
 1577|   117k|      break;
 1578|   117k|    }
 1579|   571k|  }
 1580|       |
 1581|   117k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1581:7): [True: 117k, False: 0]
  |  Branch (1581:38): [True: 22.7k, False: 95.2k]
  ------------------
 1582|  22.7k|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1583|  22.7k|  }
 1584|       |
 1585|       |  /* Postfilter function */
 1586|   117k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1586:7): [True: 0, False: 117k]
  ------------------
 1587|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1588|      0|    blosc2_postfilter_params postparams;
 1589|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1590|      0|    postparams.input = _src;
 1591|      0|    postparams.output = dest + offset;
 1592|      0|    postparams.size = bsize;
 1593|      0|    postparams.typesize = typesize;
 1594|      0|    postparams.offset = nblock * context->blocksize;
 1595|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1595:25): [True: 0, False: 0]
  ------------------
 1596|      0|    postparams.nblock = nblock;
 1597|      0|    postparams.tid = thread_context->tid;
 1598|      0|    postparams.ttmp = thread_context->tmp;
 1599|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1600|      0|    postparams.ctx = context;
 1601|       |
 1602|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1602:9): [True: 0, False: 0]
  ------------------
 1603|      0|      BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|      0|      return BLOSC2_ERROR_POSTFILTER;
 1605|      0|    }
 1606|      0|  }
 1607|       |
 1608|   117k|  return errcode;
 1609|   117k|}
free_thread_context:
 2294|  68.5k|void free_thread_context(struct thread_context* thread_context) {
 2295|  68.5k|  destroy_thread_context(thread_context);
 2296|  68.5k|  my_free(thread_context);
 2297|  68.5k|}
check_nthreads:
 2300|  65.8k|int check_nthreads(blosc2_context* context) {
 2301|  65.8k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2301:7): [True: 0, False: 65.8k]
  |  Branch (2301:53): [True: 0, False: 0]
  ------------------
 2302|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2302|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2303|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2304|      0|  }
 2305|  65.8k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2305:7): [True: 0, False: 65.8k]
  ------------------
 2306|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2306|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2307|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2308|      0|  }
 2309|       |
 2310|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2311|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2312|       |   * clear it so the re-attach logic below creates a fresh one. */
 2313|  65.8k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|   131k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2313:7): [True: 0, False: 65.8k]
  ------------------
 2314|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2314:7): [True: 0, False: 0]
  ------------------
 2315|      0|    context->thread_pool = NULL;
 2316|      0|    context->threads_started = 0;
 2317|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2318|      0|  }
 2319|       |
 2320|  65.8k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2320:7): [True: 0, False: 65.8k]
  ------------------
 2321|      0|    release_thread_backend(context);
 2322|      0|    context->nthreads = context->new_nthreads;
 2323|      0|  }
 2324|  65.8k|  if (context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2324:7): [True: 0, False: 65.8k]
  |  Branch (2324:32): [True: 0, False: 0]
  ------------------
 2325|      0|    int rc;
 2326|      0|    if (threads_callback) {
  ------------------
  |  Branch (2326:9): [True: 0, False: 0]
  ------------------
 2327|      0|      rc = init_callback_threads(context);
 2328|      0|    }
 2329|      0|    else {
 2330|       |#if defined(_WIN32)
 2331|       |      rc = init_threadpool(context);
 2332|       |#else
 2333|      0|      rc = attach_shared_pool(context);
 2334|      0|#endif
 2335|      0|    }
 2336|      0|    if (rc < 0) {
  ------------------
  |  Branch (2336:9): [True: 0, False: 0]
  ------------------
 2337|      0|      return rc;
 2338|      0|    }
 2339|      0|  }
 2340|  65.8k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2340:7): [True: 65.8k, False: 0]
  ------------------
 2341|  65.8k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  65.8k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2342|  65.8k|  }
 2343|       |
 2344|  65.8k|  return context->nthreads;
 2345|  65.8k|}
build_filters:
 3687|  22.7k|                   const int32_t typesize, uint8_t* filters) {
 3688|       |
 3689|       |  /* Fill the end part of the filter pipeline */
 3690|  22.7k|  if ((doshuffle == BLOSC_SHUFFLE) && (typesize > 1))
  ------------------
  |  Branch (3690:7): [True: 0, False: 22.7k]
  |  Branch (3690:39): [True: 0, False: 0]
  ------------------
 3691|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
 3692|  22.7k|  if (doshuffle == BLOSC_BITSHUFFLE)
  ------------------
  |  Branch (3692:7): [True: 0, False: 22.7k]
  ------------------
 3693|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
 3694|  22.7k|  if (doshuffle == BLOSC_NOSHUFFLE)
  ------------------
  |  Branch (3694:7): [True: 0, False: 22.7k]
  ------------------
 3695|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_NOSHUFFLE;
 3696|  22.7k|  if (delta)
  ------------------
  |  Branch (3696:7): [True: 0, False: 22.7k]
  ------------------
 3697|      0|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
 3698|  22.7k|}
blosc2_decompress_ctx:
 3944|  66.7k|                          void* dest, int32_t destsize) {
 3945|  66.7k|  int result;
 3946|       |
 3947|  66.7k|  if (context->do_compress != 0) {
  ------------------
  |  Branch (3947:7): [True: 0, False: 66.7k]
  ------------------
 3948|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3949|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3950|      0|  }
 3951|       |
 3952|  66.7k|  result = blosc_run_decompression_with_context(context, src, srcsize, dest, destsize);
 3953|       |
 3954|       |  // Reset a possible block_maskout
 3955|  66.7k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (3955:7): [True: 0, False: 66.7k]
  ------------------
 3956|      0|    free(context->block_maskout);
 3957|      0|    context->block_maskout = NULL;
 3958|      0|  }
 3959|  66.7k|  context->block_maskout_nitems = 0;
 3960|       |
 3961|  66.7k|  return result;
 3962|  66.7k|}
_blosc_getitem:
 4266|  56.5k|                   int start, int nitems, void* dest, int32_t destsize) {
 4267|  56.5k|  uint8_t* _src = (uint8_t*)(src);  /* current pos for source buffer */
 4268|  56.5k|  uint8_t* _dest = (uint8_t*)(dest);
 4269|  56.5k|  int32_t ntbytes = 0;              /* the number of uncompressed bytes */
 4270|  56.5k|  int32_t bsize, bsize2, ebsize, leftoverblock;
 4271|  56.5k|  int32_t startb, stopb;
 4272|  56.5k|  int32_t stop;
 4273|  56.5k|  int32_t nitems_bytes;
 4274|  56.5k|  int64_t start64 = (int64_t)start;
 4275|  56.5k|  int64_t nitems64 = (int64_t)nitems;
 4276|  56.5k|  int64_t typesize64 = (int64_t)header->typesize;
 4277|  56.5k|  int64_t stop64;
 4278|  56.5k|  int64_t nitems_bytes64;
 4279|  56.5k|  int64_t start_bytes64;
 4280|  56.5k|  int64_t stop_bytes64;
 4281|  56.5k|  int j, rc;
 4282|       |
 4283|  56.5k|  if (nitems == 0) {
  ------------------
  |  Branch (4283:7): [True: 0, False: 56.5k]
  ------------------
 4284|       |    // We have nothing to do
 4285|      0|    return 0;
 4286|      0|  }
 4287|  56.5k|  if (nitems < 0) {
  ------------------
  |  Branch (4287:7): [True: 0, False: 56.5k]
  ------------------
 4288|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4289|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4290|      0|  }
 4291|       |
 4292|  56.5k|  nitems_bytes64 = nitems64 * typesize64;
 4293|  56.5k|  if (nitems_bytes64 < 0 || nitems_bytes64 > INT32_MAX || nitems_bytes64 > destsize) {
  ------------------
  |  Branch (4293:7): [True: 0, False: 56.5k]
  |  Branch (4293:29): [True: 0, False: 56.5k]
  |  Branch (4293:59): [True: 185, False: 56.3k]
  ------------------
 4294|    185|    BLOSC_TRACE_ERROR("`nitems`*`typesize` out of dest bounds.");
  ------------------
  |  |   93|    185|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    185|    do {                                            \
  |  |  |  |   98|    185|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    185|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 185, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    185|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4295|    185|    return BLOSC2_ERROR_WRITE_BUFFER;
 4296|    185|  }
 4297|  56.3k|  nitems_bytes = (int32_t)nitems_bytes64;
 4298|       |
 4299|  56.3k|  int32_t* bstarts = (int32_t*)(_src + context->header_overhead);
 4300|       |
 4301|       |  /* Check region boundaries */
 4302|  56.3k|  start_bytes64 = start64 * typesize64;
 4303|  56.3k|  if ((start < 0) || (start_bytes64 < 0) || (start_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4303:7): [True: 0, False: 56.3k]
  |  Branch (4303:22): [True: 0, False: 56.3k]
  |  Branch (4303:45): [True: 0, False: 56.3k]
  ------------------
 4304|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4305|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4306|      0|  }
 4307|       |
 4308|  56.3k|  stop64 = start64 + nitems64;
 4309|  56.3k|  if ((stop64 < 0) || (stop64 > INT32_MAX)) {
  ------------------
  |  Branch (4309:7): [True: 0, False: 56.3k]
  |  Branch (4309:23): [True: 0, False: 56.3k]
  ------------------
 4310|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4311|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4312|      0|  }
 4313|  56.3k|  stop = (int32_t)stop64;
 4314|       |
 4315|  56.3k|  stop_bytes64 = stop64 * typesize64;
 4316|  56.3k|  if ((stop_bytes64 < 0) || (stop_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4316:7): [True: 0, False: 56.3k]
  |  Branch (4316:29): [True: 0, False: 56.3k]
  ------------------
 4317|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4318|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4319|      0|  }
 4320|       |
 4321|  56.3k|  bool chunk_memcpyed = (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0;
 4322|  56.3k|  if (!context->special_type && !chunk_memcpyed &&
  ------------------
  |  Branch (4322:7): [True: 50.1k, False: 6.17k]
  |  Branch (4322:33): [True: 49.1k, False: 1.04k]
  ------------------
 4323|  49.1k|      ((uint8_t *)(_src + srcsize) < (uint8_t *)(bstarts + context->nblocks))) {
  ------------------
  |  Branch (4323:7): [True: 0, False: 49.1k]
  ------------------
 4324|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4325|      0|    return BLOSC2_ERROR_READ_BUFFER;
 4326|      0|  }
 4327|       |
 4328|  56.3k|  bool memcpyed = header->flags & (uint8_t)BLOSC_MEMCPYED;
 4329|  56.3k|  if (context->special_type) {
  ------------------
  |  Branch (4329:7): [True: 6.17k, False: 50.1k]
  ------------------
 4330|       |    // Fake a runlen as if its a memcpyed chunk
 4331|  6.17k|    memcpyed = true;
 4332|  6.17k|  }
 4333|       |
 4334|  56.3k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (4334:19): [True: 55.8k, False: 466]
  ------------------
 4335|  55.8k|                  (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (4335:19): [True: 917, False: 54.9k]
  |  Branch (4335:54): [True: 0, False: 917]
  ------------------
 4336|  56.3k|  if (memcpyed && !is_lazy && !context->postfilter) {
  ------------------
  |  Branch (4336:7): [True: 7.21k, False: 49.1k]
  |  Branch (4336:19): [True: 7.21k, False: 0]
  |  Branch (4336:31): [True: 7.21k, False: 0]
  ------------------
 4337|       |    // Short-circuit for (non-lazy) memcpyed or special values
 4338|  7.21k|    ntbytes = nitems_bytes;
 4339|  7.21k|    switch (context->special_type) {
 4340|     64|      case BLOSC2_SPECIAL_VALUE: {
  ------------------
  |  Branch (4340:7): [True: 64, False: 7.15k]
  ------------------
 4341|       |        // The repeated value's width is cbytes minus the header, not the header
 4342|       |        // typesize byte (which is left unconstrained for special-value chunks).
 4343|       |        // Derive it the same way blosc_d() does so a crafted typesize cannot make
 4344|       |        // set_values() read past the end of the chunk.
 4345|     64|        int32_t value_typesize = header->cbytes - context->header_overhead;
 4346|     64|        rc = set_values(value_typesize, _src, _dest, ntbytes);
 4347|     64|        if (rc < 0) {
  ------------------
  |  Branch (4347:13): [True: 29, False: 35]
  ------------------
 4348|     29|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|     29|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     29|    do {                                            \
  |  |  |  |   98|     29|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     29|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     29|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4349|     29|          return BLOSC2_ERROR_DATA;
 4350|     29|        }
 4351|     35|        break;
 4352|     64|      }
 4353|     60|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (4353:7): [True: 60, False: 7.15k]
  ------------------
 4354|     60|        rc = set_nans(context->typesize, _dest, ntbytes);
 4355|     60|        if (rc < 0) {
  ------------------
  |  Branch (4355:13): [True: 0, False: 60]
  ------------------
 4356|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4357|      0|          return BLOSC2_ERROR_DATA;
 4358|      0|        }
 4359|     60|        break;
 4360|  6.03k|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (4360:7): [True: 6.03k, False: 1.18k]
  ------------------
 4361|  6.03k|        memset(_dest, 0, ntbytes);
 4362|  6.03k|        break;
 4363|     14|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (4363:7): [True: 14, False: 7.20k]
  ------------------
 4364|       |        // We do nothing here
 4365|     14|        break;
 4366|  1.04k|      case BLOSC2_NO_SPECIAL:
  ------------------
  |  Branch (4366:7): [True: 1.04k, False: 6.17k]
  ------------------
 4367|  1.04k|        {
 4368|  1.04k|          int64_t src_offset64 = (int64_t)context->header_overhead + start_bytes64;
 4369|  1.04k|          int64_t src_stop64 = src_offset64 + nitems_bytes64;
 4370|  1.04k|          if ((src_offset64 < 0) || (src_stop64 < src_offset64) || (src_stop64 > srcsize)) {
  ------------------
  |  Branch (4370:15): [True: 0, False: 1.04k]
  |  Branch (4370:37): [True: 0, False: 1.04k]
  |  Branch (4370:68): [True: 0, False: 1.04k]
  ------------------
 4371|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4372|      0|            return BLOSC2_ERROR_READ_BUFFER;
 4373|      0|          }
 4374|  1.04k|          _src += (int32_t)src_offset64;
 4375|  1.04k|        }
 4376|      0|        memcpy(_dest, _src, ntbytes);
 4377|  1.04k|        break;
 4378|      0|      default:
  ------------------
  |  Branch (4378:7): [True: 0, False: 7.21k]
  ------------------
 4379|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4380|      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]
  |  |  ------------------
  ------------------
 4381|  7.21k|    }
 4382|  7.19k|    return ntbytes;
 4383|  7.21k|  }
 4384|       |
 4385|  49.1k|  ebsize = header->blocksize + header->typesize * (signed)sizeof(int32_t);
 4386|  49.1k|  struct thread_context* scontext = context->serial_context;
 4387|       |  /* Resize the temporaries in serial context if needed */
 4388|  49.1k|  if (header->blocksize > scontext->tmp_blocksize) {
  ------------------
  |  Branch (4388:7): [True: 0, False: 49.1k]
  ------------------
 4389|      0|    my_free(scontext->tmp);
 4390|      0|    scontext->tmp_nbytes = (size_t)4 * ebsize;
 4391|      0|    scontext->tmp = my_malloc(scontext->tmp_nbytes);
 4392|      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]
  |  |  ------------------
  ------------------
 4393|      0|    scontext->tmp2 = scontext->tmp + ebsize;
 4394|      0|    scontext->tmp3 = scontext->tmp2 + ebsize;
 4395|      0|    scontext->tmp4 = scontext->tmp3 + ebsize;
 4396|      0|    scontext->tmp_blocksize = (int32_t)header->blocksize;
 4397|      0|  }
 4398|       |
 4399|   100k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (4399:15): [True: 86.3k, False: 13.6k]
  ------------------
 4400|  86.3k|    bsize = header->blocksize;
 4401|  86.3k|    leftoverblock = 0;
 4402|  86.3k|    if ((j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (4402:9): [True: 49.1k, False: 37.2k]
  |  Branch (4402:40): [True: 37.2k, False: 11.8k]
  ------------------
 4403|  37.2k|      bsize = context->leftover;
 4404|  37.2k|      leftoverblock = 1;
 4405|  37.2k|    }
 4406|       |
 4407|       |    /* Compute start & stop for each block */
 4408|  86.3k|    startb = start * header->typesize - j * header->blocksize;
 4409|  86.3k|    stopb = stop * header->typesize - j * header->blocksize;
 4410|  86.3k|    if (stopb <= 0) {
  ------------------
  |  Branch (4410:9): [True: 35.4k, False: 50.9k]
  ------------------
 4411|       |      // We can exit as soon as this block is beyond stop
 4412|  35.4k|      break;
 4413|  35.4k|    }
 4414|  50.9k|    if (startb >= header->blocksize) {
  ------------------
  |  Branch (4414:9): [True: 1.70k, False: 49.2k]
  ------------------
 4415|  1.70k|      continue;
 4416|  1.70k|    }
 4417|  49.2k|    if (startb < 0) {
  ------------------
  |  Branch (4417:9): [True: 98, False: 49.1k]
  ------------------
 4418|     98|      startb = 0;
 4419|     98|    }
 4420|  49.2k|    if (stopb > header->blocksize) {
  ------------------
  |  Branch (4420:9): [True: 98, False: 49.1k]
  ------------------
 4421|     98|      stopb = header->blocksize;
 4422|     98|    }
 4423|  49.2k|    bsize2 = stopb - startb;
 4424|       |
 4425|  49.2k|#if defined(HAVE_ZFP)
 4426|  49.2k|    if (context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) {
  ------------------
  |  Branch (4426:9): [True: 8.95k, False: 40.2k]
  ------------------
 4427|  8.95k|      scontext->zfp_cell_start = startb / context->typesize;
 4428|  8.95k|      scontext->zfp_cell_nitems = nitems;
 4429|  8.95k|    }
 4430|  49.2k|#endif /* HAVE_ZFP */
 4431|       |
 4432|       |    /* Do the actual data copy */
 4433|       |    // Regular decompression.  Put results in tmp2.
 4434|       |    // If the block is aligned and the worst case fits in destination, let's avoid a copy
 4435|  49.2k|    bool get_single_block = ((startb == 0) && (bsize == nitems_bytes));
  ------------------
  |  Branch (4435:30): [True: 1.34k, False: 47.8k]
  |  Branch (4435:47): [True: 5, False: 1.34k]
  ------------------
 4436|  49.2k|    uint8_t* tmp2 = get_single_block ? dest : scontext->tmp2;
  ------------------
  |  Branch (4436:21): [True: 5, False: 49.2k]
  ------------------
 4437|       |
 4438|       |    // If memcpyed we don't have a bstarts section (because it is not needed)
 4439|  49.2k|    int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (4439:26): [True: 0, False: 49.2k]
  ------------------
 4440|  49.2k|      context->header_overhead + j * header->blocksize : sw32_(bstarts + j);
 4441|       |
 4442|  49.2k|    int32_t cbytes = blosc_d(context->serial_context, bsize, leftoverblock, memcpyed,
 4443|  49.2k|                             src, srcsize, src_offset, j,
 4444|  49.2k|                             tmp2, 0, scontext->tmp, scontext->tmp3);
 4445|  49.2k|    if (cbytes < 0) {
  ------------------
  |  Branch (4445:9): [True: 0, False: 49.2k]
  ------------------
 4446|      0|      ntbytes = cbytes;
 4447|      0|      break;
 4448|      0|    }
 4449|  49.2k|    if (scontext->zfp_cell_nitems > 0) {
  ------------------
  |  Branch (4449:9): [True: 8.95k, False: 40.2k]
  ------------------
 4450|  8.95k|      if (cbytes == bsize2) {
  ------------------
  |  Branch (4450:11): [True: 0, False: 8.95k]
  ------------------
 4451|      0|        memcpy((uint8_t *) dest, tmp2, (unsigned int) bsize2);
 4452|  8.95k|      } else if (cbytes == context->blocksize) {
  ------------------
  |  Branch (4452:18): [True: 8.91k, False: 41]
  ------------------
 4453|  8.91k|        memcpy((uint8_t *) dest, tmp2 + scontext->zfp_cell_start * context->typesize, (unsigned int) bsize2);
 4454|  8.91k|        cbytes = bsize2;
 4455|  8.91k|      }
 4456|  40.2k|    } else if (!get_single_block) {
  ------------------
  |  Branch (4456:16): [True: 40.2k, False: 5]
  ------------------
 4457|       |      /* Copy to destination */
 4458|  40.2k|      memcpy((uint8_t *) dest + ntbytes, tmp2 + startb, (unsigned int) bsize2);
 4459|  40.2k|    }
 4460|  49.2k|    ntbytes += bsize2;
 4461|  49.2k|  }
 4462|       |
 4463|  49.1k|  scontext->zfp_cell_nitems = 0;
 4464|       |
 4465|  49.1k|  if (ntbytes >= 0 && ntbytes != nitems_bytes) {
  ------------------
  |  Branch (4465:7): [True: 49.1k, False: 0]
  |  Branch (4465:23): [True: 0, False: 49.1k]
  ------------------
 4466|       |    // A partial decode must not look like a success: callers that only test for
 4467|       |    // a negative return would silently keep hold of an incompletely filled dest.
 4468|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4469|      0|                      ntbytes, nitems_bytes);
 4470|      0|    return BLOSC2_ERROR_DATA;
 4471|      0|  }
 4472|       |
 4473|  49.1k|  return ntbytes;
 4474|  49.1k|}
blosc2_getitem:
 4476|  56.5k|int blosc2_getitem(const void* src, int32_t srcsize, int start, int nitems, void* dest, int32_t destsize) {
 4477|  56.5k|  blosc2_context context;
 4478|  56.5k|  int result;
 4479|       |
 4480|       |  /* Minimally populate the context */
 4481|  56.5k|  memset(&context, 0, sizeof(blosc2_context));
 4482|       |
 4483|  56.5k|  context.schunk = g_schunk;
 4484|  56.5k|  context.nthreads = 1;  // force a serial decompression; fixes #95
 4485|       |
 4486|       |  /* Call the actual getitem function */
 4487|  56.5k|  result = blosc2_getitem_ctx(&context, src, srcsize, start, nitems, dest, destsize);
 4488|       |
 4489|       |  /* Release resources */
 4490|  56.5k|  if (context.serial_context != NULL) {
  ------------------
  |  Branch (4490:7): [True: 56.5k, False: 0]
  ------------------
 4491|  56.5k|    free_thread_context(context.serial_context);
 4492|  56.5k|  }
 4493|  56.5k|  return result;
 4494|  56.5k|}
blosc2_getitem_ctx:
 4542|  56.5k|    int start, int nitems, void* dest, int32_t destsize) {
 4543|  56.5k|  blosc_header header;
 4544|  56.5k|  int result = getitem_read_header(src, srcsize, &header);
 4545|  56.5k|  if (result < 0) {
  ------------------
  |  Branch (4545:7): [True: 0, False: 56.5k]
  ------------------
 4546|      0|    return result;
 4547|      0|  }
 4548|       |
 4549|  56.5k|  return getitem_with_header(context, &header, src, srcsize, start, nitems, dest, destsize);
 4550|  56.5k|}
blosc2_get_nthreads:
 5608|  25.7k|{
 5609|  25.7k|  int16_t nthreads;
 5610|  25.7k|  if (!g_initlib) {
  ------------------
  |  Branch (5610:7): [True: 0, False: 25.7k]
  ------------------
 5611|      0|    blosc2_init();
 5612|      0|  }
 5613|  25.7k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  25.7k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5614|  25.7k|  nthreads = g_nthreads;
 5615|  25.7k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  25.7k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5616|  25.7k|  return nthreads;
 5617|  25.7k|}
blosc2_set_nthreads:
 5619|  14.0k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5620|  14.0k|  int16_t ret;          /* the previous number of threads */
 5621|       |
 5622|       |  /* Check whether the library should be initialized */
 5623|  14.0k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5623:7): [True: 0, False: 14.0k]
  ------------------
 5624|       |
 5625|  14.0k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  14.0k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5626|  14.0k|  ret = g_nthreads;
 5627|  14.0k|  if (nthreads != ret) {
  ------------------
  |  Branch (5627:7): [True: 0, False: 14.0k]
  ------------------
 5628|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5629|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5630|      0|    g_nthreads = nthreads;
 5631|      0|    g_global_context->new_nthreads = nthreads;
 5632|      0|    int16_t ret2 = check_nthreads(g_global_context);
 5633|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5633:9): [True: 0, False: 0]
  ------------------
 5634|      0|      g_nthreads = ret;
 5635|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5636|      0|      g_global_context->nthreads = old_nthreads;
 5637|      0|      check_nthreads(g_global_context);
 5638|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5639|      0|      return ret2;
 5640|      0|    }
 5641|      0|  }
 5642|  14.0k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  14.0k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5643|       |
 5644|  14.0k|  return ret;
 5645|  14.0k|}
blosc2_cbuffer_sizes:
 5797|  85.1M|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 5798|  85.1M|  blosc_header header;
 5799|  85.1M|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 5800|  85.1M|  if (rc < 0) {
  ------------------
  |  Branch (5800:7): [True: 87, False: 85.1M]
  ------------------
 5801|       |    /* Return zeros if error reading header */
 5802|     87|    memset(&header, 0, sizeof(header));
 5803|     87|  }
 5804|       |
 5805|       |  /* Read the interesting values */
 5806|  85.1M|  if (nbytes != NULL)
  ------------------
  |  Branch (5806:7): [True: 85.0M, False: 45.5k]
  ------------------
 5807|  85.0M|    *nbytes = header.nbytes;
 5808|  85.1M|  if (cbytes != NULL)
  ------------------
  |  Branch (5808:7): [True: 85.1M, False: 0]
  ------------------
 5809|  85.1M|    *cbytes = header.cbytes;
 5810|  85.1M|  if (blocksize != NULL)
  ------------------
  |  Branch (5810:7): [True: 68.9k, False: 85.0M]
  ------------------
 5811|  68.9k|    *blocksize = header.blocksize;
 5812|  85.1M|  return rc;
 5813|  85.1M|}
blosc2_init:
 5948|  14.0k|void blosc2_init(void) {
 5949|       |  /* Return if Blosc is already initialized */
 5950|  14.0k|  if (g_initlib) return;
  ------------------
  |  Branch (5950:7): [True: 0, False: 14.0k]
  ------------------
 5951|       |
 5952|  14.0k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 5953|  14.0k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 5954|  14.0k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 5955|  14.0k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 5956|  14.0k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 5957|  14.0k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 5958|  14.0k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 5959|  14.0k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 5960|  14.0k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 5961|  14.0k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 5962|       |
 5963|  14.0k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 5964|       |
 5965|  14.0k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 5966|  14.0k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 5967|  14.0k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 5968|  14.0k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 5969|  14.0k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 5970|  14.0k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 5971|  14.0k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 5972|  14.0k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 5973|  14.0k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 5974|  14.0k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 5975|       |
 5976|  14.0k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 5977|       |
 5978|  14.0k|  g_ncodecs = 0;
 5979|  14.0k|  g_nfilters = 0;
 5980|  14.0k|  g_ntuners = 0;
 5981|       |
 5982|  14.0k|#if defined(HAVE_PLUGINS)
 5983|  14.0k|  #include "blosc2/blosc2-common.h"
 5984|  14.0k|  #include "blosc2/blosc2-stdio.h"
 5985|  14.0k|  register_codecs();
 5986|  14.0k|  register_filters();
 5987|  14.0k|  register_tuners();
 5988|  14.0k|#endif
 5989|  14.0k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  14.0k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5990|  14.0k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  14.0k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5991|       |  /* Create a global context */
 5992|  14.0k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5993|  14.0k|  memset(g_global_context, 0, sizeof(blosc2_context));
 5994|  14.0k|  g_global_context->nthreads = g_nthreads;
 5995|  14.0k|  g_global_context->new_nthreads = g_nthreads;
 5996|  14.0k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  14.0k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5997|  14.0k|  g_initlib = 1;
 5998|  14.0k|}
blosc2_free_resources:
 6001|  14.0k|int blosc2_free_resources(void) {
 6002|       |  /* Return if Blosc is not initialized */
 6003|  14.0k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (6003:7): [True: 0, False: 14.0k]
  ------------------
 6004|       |
 6005|  14.0k|  return release_thread_backend(g_global_context);
 6006|  14.0k|}
blosc2_destroy:
 6009|  14.0k|void blosc2_destroy(void) {
 6010|       |  /* Return if Blosc is not initialized */
 6011|  14.0k|  if (!g_initlib) return;
  ------------------
  |  Branch (6011:7): [True: 0, False: 14.0k]
  ------------------
 6012|       |
 6013|  14.0k|  blosc2_free_resources();
 6014|  14.0k|  g_initlib = 0;
 6015|  14.0k|  blosc2_free_ctx(g_global_context);
 6016|       |
 6017|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 6018|       |   * Do this before freeing the pools so that release_thread_backend callers
 6019|       |   * that race with us will take the "skip" path rather than locking the
 6020|       |   * soon-to-be-destroyed pool_registry_mutex. */
 6021|  14.0k|  g_destroy_count++;
 6022|       |
 6023|       |  /* Tear down any remaining shared pools */
 6024|  14.0k|  struct blosc_shared_pool *pool = shared_pools;
 6025|  14.0k|  while (pool != NULL) {
  ------------------
  |  Branch (6025:10): [True: 0, False: 14.0k]
  ------------------
 6026|      0|    struct blosc_shared_pool *next = pool->next;
 6027|      0|    destroy_shared_pool(pool);
 6028|      0|    pool = next;
 6029|      0|  }
 6030|  14.0k|  shared_pools = NULL;
 6031|  14.0k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  14.0k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6032|       |
 6033|  14.0k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  14.0k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6034|  14.0k|}
blosc2_create_cctx:
 6040|  22.8k|blosc2_context* blosc2_create_cctx(blosc2_cparams cparams) {
 6041|  22.8k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6042|  22.8k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  22.8k|    do {                                            \
  |  |  105|  22.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 22.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|  22.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
 6043|       |
 6044|       |  /* Populate the context, using zeros as default values */
 6045|  22.8k|  memset(context, 0, sizeof(blosc2_context));
 6046|  22.8k|  context->do_compress = 1;   /* meant for compression */
 6047|  22.8k|  context->use_dict = cparams.use_dict;
 6048|  22.8k|  if (cparams.instr_codec) {
  ------------------
  |  Branch (6048:7): [True: 0, False: 22.8k]
  ------------------
 6049|      0|    context->blosc2_flags = BLOSC2_INSTR_CODEC;
 6050|      0|  }
 6051|       |
 6052|   159k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (6052:19): [True: 136k, False: 22.7k]
  ------------------
 6053|   136k|    context->filters[i] = cparams.filters[i];
 6054|   136k|    context->filters_meta[i] = cparams.filters_meta[i];
 6055|       |
 6056|   136k|    if (context->filters[i] >= BLOSC_LAST_FILTER && context->filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (6056:9): [True: 1.98k, False: 134k]
  |  Branch (6056:53): [True: 21, False: 1.96k]
  ------------------
 6057|     21|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   93|     21|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     21|    do {                                            \
  |  |  |  |   98|     21|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     21|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     21|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6058|     21|                        context->filters[i]);
 6059|     21|      free(context);
 6060|     21|      return NULL;
 6061|     21|    }
 6062|   136k|    if (context->filters[i] > BLOSC_LAST_REGISTERED_FILTER && context->filters[i] <= BLOSC2_GLOBAL_REGISTERED_FILTERS_STOP) {
  ------------------
  |  Branch (6062:9): [True: 1.35k, False: 135k]
  |  Branch (6062:63): [True: 49, False: 1.30k]
  ------------------
 6063|     49|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6064|     49|                        context->filters[i]);
 6065|     49|      free(context);
 6066|     49|      return NULL;
 6067|     49|    }
 6068|   136k|  }
 6069|       |
 6070|  22.7k|#if defined(HAVE_ZFP)
 6071|  22.7k|#include "blosc2/codecs-registry.h"
 6072|  22.7k|  if ((context->compcode >= BLOSC_CODEC_ZFP_FIXED_ACCURACY) && (context->compcode <= BLOSC_CODEC_ZFP_FIXED_RATE)) {
  ------------------
  |  Branch (6072:7): [True: 0, False: 22.7k]
  |  Branch (6072:64): [True: 0, False: 0]
  ------------------
 6073|      0|    for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) {
  ------------------
  |  Branch (6073:21): [True: 0, False: 0]
  ------------------
 6074|      0|      if ((context->filters[i] == BLOSC_SHUFFLE) || (context->filters[i] == BLOSC_BITSHUFFLE)) {
  ------------------
  |  Branch (6074:11): [True: 0, False: 0]
  |  Branch (6074:53): [True: 0, False: 0]
  ------------------
 6075|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6076|      0|        return NULL;
 6077|      0|      }
 6078|      0|    }
 6079|      0|  }
 6080|  22.7k|#endif /* HAVE_ZFP */
 6081|       |
 6082|       |  /* Check for a BLOSC_SHUFFLE environment variable */
 6083|  22.7k|  int doshuffle = -1;
 6084|  22.7k|  char* envvar = getenv("BLOSC_SHUFFLE");
 6085|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6085:7): [True: 0, False: 22.7k]
  ------------------
 6086|      0|    if (strcmp(envvar, "NOSHUFFLE") == 0) {
  ------------------
  |  Branch (6086:9): [True: 0, False: 0]
  ------------------
 6087|      0|      doshuffle = BLOSC_NOSHUFFLE;
 6088|      0|    }
 6089|      0|    else if (strcmp(envvar, "SHUFFLE") == 0) {
  ------------------
  |  Branch (6089:14): [True: 0, False: 0]
  ------------------
 6090|      0|      doshuffle = BLOSC_SHUFFLE;
 6091|      0|    }
 6092|      0|    else if (strcmp(envvar, "BITSHUFFLE") == 0) {
  ------------------
  |  Branch (6092:14): [True: 0, False: 0]
  ------------------
 6093|      0|      doshuffle = BLOSC_BITSHUFFLE;
 6094|      0|    }
 6095|      0|    else {
 6096|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6097|      0|    }
 6098|      0|  }
 6099|       |  /* Check for a BLOSC_DELTA environment variable */
 6100|  22.7k|  int dodelta = BLOSC_NOFILTER;
 6101|  22.7k|  envvar = getenv("BLOSC_DELTA");
 6102|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6102:7): [True: 0, False: 22.7k]
  ------------------
 6103|      0|    if (strcmp(envvar, "1") == 0) {
  ------------------
  |  Branch (6103:9): [True: 0, False: 0]
  ------------------
 6104|      0|      dodelta = BLOSC_DELTA;
 6105|      0|    } else if (strcmp(envvar, "0") == 0){
  ------------------
  |  Branch (6105:16): [True: 0, False: 0]
  ------------------
 6106|      0|      dodelta = BLOSC_NOFILTER;
 6107|      0|    }
 6108|      0|    else {
 6109|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6110|      0|    }
 6111|      0|  }
 6112|       |  /* Check for a BLOSC_TYPESIZE environment variable */
 6113|  22.7k|  context->typesize = cparams.typesize;
 6114|  22.7k|  envvar = getenv("BLOSC_TYPESIZE");
 6115|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6115:7): [True: 0, False: 22.7k]
  ------------------
 6116|      0|    int32_t value;
 6117|      0|    errno = 0; /* To distinguish success/failure after call */
 6118|      0|    value = (int32_t) strtol(envvar, NULL, 10);
 6119|      0|    if ((errno != EINVAL) && (value > 0)) {
  ------------------
  |  Branch (6119:9): [True: 0, False: 0]
  |  Branch (6119:30): [True: 0, False: 0]
  ------------------
 6120|      0|      context->typesize = value;
 6121|      0|    }
 6122|      0|    else {
 6123|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6124|      0|    }
 6125|      0|  }
 6126|  22.7k|  build_filters(doshuffle, dodelta, context->typesize, context->filters);
 6127|       |
 6128|  22.7k|  context->clevel = cparams.clevel;
 6129|       |  /* Check for a BLOSC_CLEVEL environment variable */
 6130|  22.7k|  envvar = getenv("BLOSC_CLEVEL");
 6131|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6131:7): [True: 0, False: 22.7k]
  ------------------
 6132|      0|    int value;
 6133|      0|    errno = 0; /* To distinguish success/failure after call */
 6134|      0|    value = (int)strtol(envvar, NULL, 10);
 6135|      0|    if ((errno != EINVAL) && (value >= 0)) {
  ------------------
  |  Branch (6135:9): [True: 0, False: 0]
  |  Branch (6135:30): [True: 0, False: 0]
  ------------------
 6136|      0|      context->clevel = value;
 6137|      0|    }
 6138|      0|    else {
 6139|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6140|      0|    }
 6141|      0|  }
 6142|       |
 6143|  22.7k|  context->compcode = cparams.compcode;
 6144|       |  /* Check for a BLOSC_COMPRESSOR environment variable */
 6145|  22.7k|  envvar = getenv("BLOSC_COMPRESSOR");
 6146|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6146:7): [True: 0, False: 22.7k]
  ------------------
 6147|      0|    int codec = blosc2_compname_to_compcode(envvar);
 6148|      0|    if (codec >= BLOSC_LAST_CODEC) {
  ------------------
  |  Branch (6148:9): [True: 0, False: 0]
  ------------------
 6149|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6150|      0|      return NULL;
 6151|      0|    }
 6152|      0|    context->compcode = codec;
 6153|      0|  }
 6154|  22.7k|  context->compcode_meta = cparams.compcode_meta;
 6155|       |
 6156|  22.7k|  context->blocksize = cparams.blocksize;
 6157|       |  /* Check for a BLOSC_BLOCKSIZE environment variable */
 6158|  22.7k|  envvar = getenv("BLOSC_BLOCKSIZE");
 6159|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6159:7): [True: 0, False: 22.7k]
  ------------------
 6160|      0|    int32_t blocksize;
 6161|      0|    errno = 0; /* To distinguish success/failure after call */
 6162|      0|    blocksize = (int32_t) strtol(envvar, NULL, 10);
 6163|      0|    if ((errno != EINVAL) && (blocksize > 0)) {
  ------------------
  |  Branch (6163:9): [True: 0, False: 0]
  |  Branch (6163:30): [True: 0, False: 0]
  ------------------
 6164|      0|      context->blocksize = blocksize;
 6165|      0|    }
 6166|      0|    else {
 6167|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6168|      0|    }
 6169|      0|  }
 6170|       |
 6171|  22.7k|  context->nthreads = cparams.nthreads;
 6172|       |  /* Check for a BLOSC_NTHREADS environment variable */
 6173|  22.7k|  envvar = getenv("BLOSC_NTHREADS");
 6174|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6174:7): [True: 0, False: 22.7k]
  ------------------
 6175|      0|    errno = 0; /* To distinguish success/failure after call */
 6176|      0|    int16_t nthreads = (int16_t) strtol(envvar, NULL, 10);
 6177|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (6177:9): [True: 0, False: 0]
  |  Branch (6177:30): [True: 0, False: 0]
  ------------------
 6178|      0|      context->nthreads = nthreads;
 6179|      0|    }
 6180|      0|    else {
 6181|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6182|      0|    }
 6183|      0|  }
 6184|  22.7k|  context->new_nthreads = context->nthreads;
 6185|       |
 6186|  22.7k|  context->splitmode = cparams.splitmode;
 6187|       |  /* Check for a BLOSC_SPLITMODE environment variable */
 6188|  22.7k|  envvar = getenv("BLOSC_SPLITMODE");
 6189|  22.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6189:7): [True: 0, False: 22.7k]
  ------------------
 6190|      0|    int32_t splitmode = -1;
 6191|      0|    if (strcmp(envvar, "ALWAYS") == 0) {
  ------------------
  |  Branch (6191:9): [True: 0, False: 0]
  ------------------
 6192|      0|      splitmode = BLOSC_ALWAYS_SPLIT;
 6193|      0|    }
 6194|      0|    else if (strcmp(envvar, "NEVER") == 0) {
  ------------------
  |  Branch (6194:14): [True: 0, False: 0]
  ------------------
 6195|      0|      splitmode = BLOSC_NEVER_SPLIT;
 6196|      0|    }
 6197|      0|    else if (strcmp(envvar, "AUTO") == 0) {
  ------------------
  |  Branch (6197:14): [True: 0, False: 0]
  ------------------
 6198|      0|      splitmode = BLOSC_AUTO_SPLIT;
 6199|      0|    }
 6200|      0|    else if (strcmp(envvar, "FORWARD_COMPAT") == 0) {
  ------------------
  |  Branch (6200:14): [True: 0, False: 0]
  ------------------
 6201|      0|      splitmode = BLOSC_FORWARD_COMPAT_SPLIT;
 6202|      0|    }
 6203|      0|    else {
 6204|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6205|      0|    }
 6206|      0|    if (splitmode >= 0) {
  ------------------
  |  Branch (6206:9): [True: 0, False: 0]
  ------------------
 6207|      0|      context->splitmode = splitmode;
 6208|      0|    }
 6209|      0|  }
 6210|       |
 6211|  22.7k|  context->threads_started = 0;
 6212|  22.7k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  22.7k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6213|  22.7k|  context->schunk = cparams.schunk;
 6214|       |
 6215|  22.7k|  if (cparams.prefilter != NULL) {
  ------------------
  |  Branch (6215:7): [True: 0, False: 22.7k]
  ------------------
 6216|      0|    context->prefilter = cparams.prefilter;
 6217|      0|    context->preparams = (blosc2_prefilter_params*)my_malloc(sizeof(blosc2_prefilter_params));
 6218|      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]
  |  |  ------------------
  ------------------
 6219|      0|    memcpy(context->preparams, cparams.preparams, sizeof(blosc2_prefilter_params));
 6220|      0|  }
 6221|       |
 6222|  22.7k|  if (cparams.tuner_id <= 0) {
  ------------------
  |  Branch (6222:7): [True: 22.7k, False: 0]
  ------------------
 6223|  22.7k|    cparams.tuner_id = g_tuner;
 6224|  22.7k|  } else {
 6225|      0|    for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6225:21): [True: 0, False: 0]
  ------------------
 6226|      0|      if (g_tuners[i].id == cparams.tuner_id) {
  ------------------
  |  Branch (6226:11): [True: 0, False: 0]
  ------------------
 6227|      0|        if (g_tuners[i].init == NULL) {
  ------------------
  |  Branch (6227:13): [True: 0, False: 0]
  ------------------
 6228|      0|          if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6228:15): [True: 0, False: 0]
  ------------------
 6229|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6230|      0|            return NULL;
 6231|      0|          }
 6232|      0|        }
 6233|      0|        if (g_tuners[i].init(cparams.tuner_params, context, NULL) < 0) {
  ------------------
  |  Branch (6233:13): [True: 0, False: 0]
  ------------------
 6234|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6235|      0|          return NULL;
 6236|      0|        }
 6237|      0|        goto urtunersuccess;
 6238|      0|      }
 6239|      0|    }
 6240|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6241|      0|    return NULL;
 6242|      0|  }
 6243|  22.7k|  urtunersuccess:;
 6244|       |
 6245|  22.7k|  context->tuner_id = cparams.tuner_id;
 6246|       |
 6247|  22.7k|  context->codec_params = cparams.codec_params;
 6248|  22.7k|  memcpy(context->filter_params, cparams.filter_params, BLOSC2_MAX_FILTERS * sizeof(void*));
 6249|       |
 6250|  22.7k|  return context;
 6251|  22.7k|}
blosc2_create_dctx:
 6254|  25.0k|blosc2_context* blosc2_create_dctx(blosc2_dparams dparams) {
 6255|  25.0k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6256|  25.0k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  25.0k|    do {                                            \
  |  |  105|  25.0k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 25.0k]
  |  |  ------------------
  |  |  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.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
 6257|       |
 6258|       |  /* Populate the context, using zeros as default values */
 6259|  25.0k|  memset(context, 0, sizeof(blosc2_context));
 6260|  25.0k|  context->do_compress = 0;   /* Meant for decompression */
 6261|       |
 6262|  25.0k|  context->nthreads = dparams.nthreads;
 6263|  25.0k|  char* envvar = getenv("BLOSC_NTHREADS");
 6264|  25.0k|  if (envvar != NULL) {
  ------------------
  |  Branch (6264:7): [True: 0, False: 25.0k]
  ------------------
 6265|      0|    errno = 0; /* To distinguish success/failure after call */
 6266|      0|    long nthreads = strtol(envvar, NULL, 10);
 6267|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (6267:9): [True: 0, False: 0]
  |  Branch (6267:30): [True: 0, False: 0]
  ------------------
 6268|      0|      context->nthreads = (int16_t) nthreads;
 6269|      0|    }
 6270|      0|  }
 6271|  25.0k|  context->new_nthreads = context->nthreads;
 6272|       |
 6273|  25.0k|  context->threads_started = 0;
 6274|  25.0k|  context->block_maskout = NULL;
 6275|  25.0k|  context->block_maskout_nitems = 0;
 6276|  25.0k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  25.0k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6277|  25.0k|  context->schunk = dparams.schunk;
 6278|       |
 6279|  25.0k|  if (dparams.postfilter != NULL) {
  ------------------
  |  Branch (6279:7): [True: 0, False: 25.0k]
  ------------------
 6280|      0|    context->postfilter = dparams.postfilter;
 6281|      0|    context->postparams = (blosc2_postfilter_params*)my_malloc(sizeof(blosc2_postfilter_params));
 6282|      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]
  |  |  ------------------
  ------------------
 6283|      0|    memcpy(context->postparams, dparams.postparams, sizeof(blosc2_postfilter_params));
 6284|      0|  }
 6285|       |
 6286|  25.0k|  return context;
 6287|  25.0k|}
blosc2_free_ctx:
 6290|  61.8k|void blosc2_free_ctx(blosc2_context* context) {
 6291|  61.8k|  if (g_initlib ||
  ------------------
  |  Branch (6291:7): [True: 47.8k, False: 14.0k]
  ------------------
 6292|  14.0k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  75.8k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6292:7): [True: 0, False: 14.0k]
  ------------------
 6293|  47.8k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  14.0k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6293:7): [True: 0, False: 14.0k]
  ------------------
 6294|  47.8k|    release_thread_backend(context);
 6295|  47.8k|  }
 6296|  61.8k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6296:7): [True: 11.9k, False: 49.8k]
  ------------------
 6297|  11.9k|    free_thread_context(context->serial_context);
 6298|  11.9k|  }
 6299|  61.8k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  61.8k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6300|  61.8k|  release_context_dict_buffer(context);
 6301|  61.8k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6301:7): [True: 0, False: 61.8k]
  ------------------
 6302|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6302:9): [True: 0, False: 0]
  ------------------
 6303|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6304|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6304:16): [True: 0, False: 0]
  ------------------
 6305|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6306|      0|    }
 6307|      0|#ifdef HAVE_ZSTD
 6308|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6308:14): [True: 0, False: 0]
  ------------------
 6309|      0|      ZSTD_freeCDict(context->dict_cdict);
 6310|      0|    }
 6311|      0|#endif
 6312|      0|  }
 6313|  61.8k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6313:7): [True: 2.56k, False: 59.2k]
  ------------------
 6314|  2.56k|#ifdef HAVE_ZSTD
 6315|  2.56k|    ZSTD_freeDDict(context->dict_ddict);
 6316|  2.56k|#endif
 6317|  2.56k|  }
 6318|  61.8k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6318:7): [True: 0, False: 61.8k]
  ------------------
 6319|      0|    int rc;
 6320|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6320:9): [True: 0, False: 0]
  |  Branch (6320:49): [True: 0, False: 0]
  ------------------
 6321|      0|      rc = blosc_stune_free(context);
 6322|      0|    } else {
 6323|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6323:23): [True: 0, False: 0]
  ------------------
 6324|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6324:13): [True: 0, False: 0]
  ------------------
 6325|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6325:15): [True: 0, False: 0]
  ------------------
 6326|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6326:17): [True: 0, False: 0]
  ------------------
 6327|      0|              BLOSC_TRACE_ERROR("Could not load tuner %d.", g_tuners[i].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6328|      0|              return;
 6329|      0|            }
 6330|      0|          }
 6331|      0|          rc = g_tuners[i].free(context);
 6332|      0|          goto urtunersuccess;
 6333|      0|        }
 6334|      0|      }
 6335|      0|      BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", context->tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6336|      0|      return;
 6337|      0|      urtunersuccess:;
 6338|      0|    }
 6339|      0|    if (rc < 0) {
  ------------------
  |  Branch (6339:9): [True: 0, False: 0]
  ------------------
 6340|      0|      BLOSC_TRACE_ERROR("Error in user-defined tuner free function\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6341|      0|      return;
 6342|      0|    }
 6343|      0|  }
 6344|       |  /* May be needed if codec_params ever contains nested objects
 6345|       |  if (context->codec_params != NULL) {
 6346|       |    int rc;
 6347|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6348|       |      if (g_codecs[i].compcode == context->compcode) {
 6349|       |        if (g_codecs[i].free == NULL) {
 6350|       |          // Dynamically load codec plugin
 6351|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6352|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6353|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6354|       |          }
 6355|       |        }
 6356|       |        if (g_codecs[i].free == NULL){
 6357|       |          // no free func, codec_params is simple
 6358|       |          my_free(context->codec_params);
 6359|       |        }
 6360|       |        else{ // has free function for codec_params (e.g. openzl)
 6361|       |        rc = g_codecs[i].free(context->codec_params);
 6362|       |          goto urcodecsuccess;
 6363|       |        }
 6364|       |      }
 6365|       |    }
 6366|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6367|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6368|       |    urcodecsuccess:;
 6369|       |    if (rc < 0) {
 6370|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6371|       |      return;
 6372|       |    }
 6373|       |  }
 6374|       |  */
 6375|  61.8k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6375:7): [True: 0, False: 61.8k]
  ------------------
 6376|      0|    my_free(context->preparams);
 6377|      0|  }
 6378|  61.8k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6378:7): [True: 0, False: 61.8k]
  ------------------
 6379|      0|    my_free(context->postparams);
 6380|      0|  }
 6381|       |
 6382|  61.8k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6382:7): [True: 0, False: 61.8k]
  ------------------
 6383|      0|    free(context->block_maskout);
 6384|      0|  }
 6385|  61.8k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6385:7): [True: 254, False: 61.5k]
  ------------------
 6386|    254|    free(context->blocknbytes);
 6387|    254|  }
 6388|  61.8k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6388:7): [True: 254, False: 61.5k]
  ------------------
 6389|    254|    free(context->blockoffsets);
 6390|    254|  }
 6391|  61.8k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6391:7): [True: 254, False: 61.5k]
  ------------------
 6392|    254|    free(context->blockcbytes);
 6393|    254|  }
 6394|  61.8k|  my_free(context);
 6395|  61.8k|}
blosc2_ctx_get_dparams:
 6422|   112k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6423|   112k|  dparams->nthreads = ctx->nthreads;
 6424|   112k|  dparams->schunk = ctx->schunk;
 6425|   112k|  dparams->postfilter = ctx->postfilter;
 6426|   112k|  dparams->postparams = ctx->postparams;
 6427|   112k|  dparams->typesize = ctx->typesize;
 6428|       |
 6429|   112k|  return BLOSC2_ERROR_SUCCESS;
 6430|   112k|}
blosc2_chunk_zeros:
 6452|  8.57k|int blosc2_chunk_zeros(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6453|  8.57k|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6453:7): [True: 0, False: 8.57k]
  ------------------
 6454|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6455|      0|    return BLOSC2_ERROR_DATA;
 6456|      0|  }
 6457|       |
 6458|  8.57k|  if ((nbytes > 0) && (nbytes % cparams.typesize)) {
  ------------------
  |  Branch (6458:7): [True: 1.23k, False: 7.34k]
  |  Branch (6458:23): [True: 12, False: 1.22k]
  ------------------
 6459|     12|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6460|     12|    return BLOSC2_ERROR_DATA;
 6461|     12|  }
 6462|       |
 6463|  8.56k|  blosc_header header;
 6464|  8.56k|  blosc2_context* context = blosc2_create_cctx(cparams);
 6465|  8.56k|  if (context == NULL) {
  ------------------
  |  Branch (6465:7): [True: 0, False: 8.56k]
  ------------------
 6466|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6467|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6468|      0|  }
 6469|       |
 6470|  8.56k|  int error = initialize_context_compression(
 6471|  8.56k|          context, NULL, nbytes, dest, destsize,
 6472|  8.56k|          context->clevel, context->filters, context->filters_meta,
 6473|  8.56k|          context->typesize, context->compcode, context->blocksize,
 6474|  8.56k|          context->new_nthreads, context->nthreads, context->splitmode,
 6475|  8.56k|          context->tuner_id, context->tuner_params, context->schunk);
 6476|  8.56k|  if (error <= 0) {
  ------------------
  |  Branch (6476:7): [True: 9, False: 8.55k]
  ------------------
 6477|      9|    blosc2_free_ctx(context);
 6478|      9|    return error;
 6479|      9|  }
 6480|       |
 6481|  8.55k|  memset(&header, 0, sizeof(header));
 6482|  8.55k|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6483|  8.55k|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6484|  8.55k|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6485|  8.55k|  header.typesize = context->typesize;
 6486|  8.55k|  header.nbytes = (int32_t)nbytes;
 6487|  8.55k|  header.blocksize = context->blocksize;
 6488|  8.55k|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6489|  8.55k|  header.blosc2_flags = BLOSC2_SPECIAL_ZERO << 4;  // mark chunk as all zeros
 6490|  8.55k|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6491|       |
 6492|  8.55k|  blosc2_free_ctx(context);
 6493|       |
 6494|  8.55k|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6495|  8.56k|}
blosc2_chunk_uninit:
 6499|    775|int blosc2_chunk_uninit(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6500|    775|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6500:7): [True: 0, False: 775]
  ------------------
 6501|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6502|      0|    return BLOSC2_ERROR_DATA;
 6503|      0|  }
 6504|       |
 6505|    775|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6505:7): [True: 2, False: 773]
  ------------------
 6506|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6507|      2|    return BLOSC2_ERROR_DATA;
 6508|      2|  }
 6509|       |
 6510|    773|  blosc_header header;
 6511|    773|  blosc2_context* context = blosc2_create_cctx(cparams);
 6512|    773|  if (context == NULL) {
  ------------------
  |  Branch (6512:7): [True: 0, False: 773]
  ------------------
 6513|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6514|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6515|      0|  }
 6516|    773|  int error = initialize_context_compression(
 6517|    773|          context, NULL, nbytes, dest, destsize,
 6518|    773|          context->clevel, context->filters, context->filters_meta,
 6519|    773|          context->typesize, context->compcode, context->blocksize,
 6520|    773|          context->new_nthreads, context->nthreads, context->splitmode,
 6521|    773|          context->tuner_id, context->tuner_params, context->schunk);
 6522|    773|  if (error <= 0) {
  ------------------
  |  Branch (6522:7): [True: 4, False: 769]
  ------------------
 6523|      4|    blosc2_free_ctx(context);
 6524|      4|    return error;
 6525|      4|  }
 6526|       |
 6527|    769|  memset(&header, 0, sizeof(header));
 6528|    769|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6529|    769|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6530|    769|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6531|    769|  header.typesize = context->typesize;
 6532|    769|  header.nbytes = (int32_t)nbytes;
 6533|    769|  header.blocksize = context->blocksize;
 6534|    769|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6535|    769|  header.blosc2_flags = BLOSC2_SPECIAL_UNINIT << 4;  // mark chunk as uninitialized
 6536|    769|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6537|       |
 6538|    769|  blosc2_free_ctx(context);
 6539|       |
 6540|    769|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6541|    773|}
blosc2_chunk_nans:
 6545|    573|int blosc2_chunk_nans(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6546|    573|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6546:7): [True: 0, False: 573]
  ------------------
 6547|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6548|      0|    return BLOSC2_ERROR_DATA;
 6549|      0|  }
 6550|       |
 6551|    573|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6551:7): [True: 0, False: 573]
  ------------------
 6552|      0|    BLOSC_TRACE_ERROR("nbytes must be 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6553|      0|    return BLOSC2_ERROR_DATA;
 6554|      0|  }
 6555|       |
 6556|    573|  blosc_header header;
 6557|    573|  blosc2_context* context = blosc2_create_cctx(cparams);
 6558|    573|  if (context == NULL) {
  ------------------
  |  Branch (6558:7): [True: 0, False: 573]
  ------------------
 6559|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6560|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6561|      0|  }
 6562|       |
 6563|    573|  int error = initialize_context_compression(
 6564|    573|          context, NULL, nbytes, dest, destsize,
 6565|    573|          context->clevel, context->filters, context->filters_meta,
 6566|    573|          context->typesize, context->compcode, context->blocksize,
 6567|    573|          context->new_nthreads, context->nthreads, context->splitmode,
 6568|    573|          context->tuner_id, context->tuner_params, context->schunk);
 6569|    573|  if (error <= 0) {
  ------------------
  |  Branch (6569:7): [True: 3, False: 570]
  ------------------
 6570|      3|    blosc2_free_ctx(context);
 6571|      3|    return error;
 6572|      3|  }
 6573|       |
 6574|    570|  memset(&header, 0, sizeof(header));
 6575|    570|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6576|    570|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6577|    570|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6578|    570|  header.typesize = context->typesize;
 6579|    570|  header.nbytes = (int32_t)nbytes;
 6580|    570|  header.blocksize = context->blocksize;
 6581|    570|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6582|    570|  header.blosc2_flags = BLOSC2_SPECIAL_NAN << 4;  // mark chunk as all NaNs
 6583|    570|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6584|       |
 6585|    570|  blosc2_free_ctx(context);
 6586|       |
 6587|    570|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6588|    573|}
register_filter_private:
 6642|  70.1k|int register_filter_private(blosc2_filter *filter) {
 6643|  70.1k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  70.1k|    do {                                            \
  |  |  105|  70.1k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 70.1k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  70.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 70.1k]
  |  |  ------------------
  ------------------
 6644|  70.1k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6644:9): [True: 0, False: 70.1k]
  ------------------
 6645|      0|        BLOSC_TRACE_ERROR("Can not register more filters");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6646|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6647|      0|    }
 6648|  70.1k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6648:9): [True: 0, False: 70.1k]
  ------------------
 6649|      0|        BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_FILTERS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6650|      0|        return BLOSC2_ERROR_FAILURE;
 6651|      0|    }
 6652|       |    /* This condition can never be fulfilled
 6653|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6654|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6655|       |        return BLOSC2_ERROR_FAILURE;
 6656|       |    }
 6657|       |    */
 6658|       |
 6659|   210k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6659:26): [True: 140k, False: 70.1k]
  ------------------
 6660|   140k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6660:11): [True: 0, False: 140k]
  ------------------
 6661|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6661:13): [True: 0, False: 0]
  ------------------
 6662|      0|          BLOSC_TRACE_ERROR("The filter (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6663|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6664|      0|          return BLOSC2_ERROR_FAILURE;
 6665|      0|        }
 6666|      0|        else {
 6667|       |          // Already registered, so no more actions needed
 6668|      0|          return BLOSC2_ERROR_SUCCESS;
 6669|      0|        }
 6670|      0|      }
 6671|   140k|    }
 6672|       |
 6673|  70.1k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6674|  70.1k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6675|       |
 6676|  70.1k|    return BLOSC2_ERROR_SUCCESS;
 6677|  70.1k|}
register_codec_private:
 6692|   126k|int register_codec_private(blosc2_codec *codec) {
 6693|   126k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|   126k|    do {                                            \
  |  |  105|   126k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 126k]
  |  |  ------------------
  |  |  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|   126k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 126k]
  |  |  ------------------
  ------------------
 6694|   126k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6694:9): [True: 0, False: 126k]
  ------------------
 6695|      0|      BLOSC_TRACE_ERROR("Can not register more codecs");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6696|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6697|      0|    }
 6698|   126k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6698:9): [True: 0, False: 126k]
  ------------------
 6699|      0|      BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_CODECS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6700|      0|      return BLOSC2_ERROR_FAILURE;
 6701|      0|    }
 6702|       |    /* This condition can never be fulfilled
 6703|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 6704|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 6705|       |      return BLOSC2_ERROR_FAILURE;
 6706|       |    }
 6707|       |     */
 6708|       |
 6709|   631k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (6709:21): [True: 504k, False: 126k]
  ------------------
 6710|   504k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (6710:11): [True: 0, False: 504k]
  ------------------
 6711|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (6711:13): [True: 0, False: 0]
  ------------------
 6712|      0|          BLOSC_TRACE_ERROR("The codec (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6713|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 6714|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 6715|      0|        }
 6716|      0|        else {
 6717|       |          // Already registered, so no more actions needed
 6718|      0|          return BLOSC2_ERROR_SUCCESS;
 6719|      0|        }
 6720|      0|      }
 6721|   504k|    }
 6722|       |
 6723|   126k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 6724|   126k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 6725|       |
 6726|   126k|    return BLOSC2_ERROR_SUCCESS;
 6727|   126k|}
register_tuner_private:
 6742|  14.0k|int register_tuner_private(blosc2_tuner *tuner) {
 6743|  14.0k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  14.0k|    do {                                            \
  |  |  105|  14.0k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 14.0k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  14.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 6744|  14.0k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (6744:7): [True: 0, False: 14.0k]
  ------------------
 6745|      0|    BLOSC_TRACE_ERROR("Can not register more tuners");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6746|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 6747|      0|  }
 6748|  14.0k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (6748:7): [True: 0, False: 14.0k]
  ------------------
 6749|      0|    BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_TUNER_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6750|      0|    return BLOSC2_ERROR_FAILURE;
 6751|      0|  }
 6752|       |
 6753|  14.0k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6753:19): [True: 0, False: 14.0k]
  ------------------
 6754|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (6754:9): [True: 0, False: 0]
  ------------------
 6755|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (6755:11): [True: 0, False: 0]
  ------------------
 6756|      0|        BLOSC_TRACE_ERROR("The tuner (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6757|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 6758|      0|        return BLOSC2_ERROR_FAILURE;
 6759|      0|      }
 6760|      0|      else {
 6761|       |        // Already registered, so no more actions needed
 6762|      0|        return BLOSC2_ERROR_SUCCESS;
 6763|      0|      }
 6764|      0|    }
 6765|      0|  }
 6766|       |
 6767|  14.0k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 6768|  14.0k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 6769|       |
 6770|  14.0k|  return BLOSC2_ERROR_SUCCESS;
 6771|  14.0k|}
_blosc2_register_io_cb:
 6784|  28.0k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 6785|       |
 6786|  42.0k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6786:24): [True: 42.0k, False: 2]
  ------------------
 6787|  42.0k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (6787:9): [True: 28.0k, False: 14.0k]
  ------------------
 6788|  28.0k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (6788:11): [True: 0, False: 28.0k]
  ------------------
 6789|      0|        BLOSC_TRACE_ERROR("The IO (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6790|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 6791|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 6792|      0|      }
 6793|  28.0k|      else {
 6794|       |        // Already registered, so no more actions needed
 6795|  28.0k|        return BLOSC2_ERROR_SUCCESS;
 6796|  28.0k|      }
 6797|  28.0k|    }
 6798|  42.0k|  }
 6799|       |
 6800|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 6801|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 6802|       |
 6803|      2|  return BLOSC2_ERROR_SUCCESS;
 6804|  28.0k|}
blosc2_get_io_cb:
 6821|   130k|blosc2_io_cb *blosc2_get_io_cb(uint8_t id) {
 6822|       |  // If g_initlib is not set by blosc2_init() this function will try to read
 6823|       |  // uninitialized memory. We should therefore always return NULL in that case
 6824|   130k|  if (!g_initlib) {
  ------------------
  |  Branch (6824:7): [True: 0, False: 130k]
  ------------------
 6825|      0|    return NULL;
 6826|      0|  }
 6827|   130k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6827:24): [True: 130k, False: 0]
  ------------------
 6828|   130k|    if (g_ios[i].id == id) {
  ------------------
  |  Branch (6828:9): [True: 130k, False: 0]
  ------------------
 6829|   130k|      return &g_ios[i];
 6830|   130k|    }
 6831|   130k|  }
 6832|      0|  if (id == BLOSC2_IO_FILESYSTEM) {
  ------------------
  |  Branch (6832:7): [True: 0, False: 0]
  ------------------
 6833|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS) < 0) {
  ------------------
  |  Branch (6833:9): [True: 0, False: 0]
  ------------------
 6834|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6835|      0|      return NULL;
 6836|      0|    }
 6837|      0|    return blosc2_get_io_cb(id);
 6838|      0|  }
 6839|      0|  else if (id == BLOSC2_IO_FILESYSTEM_MMAP) {
  ------------------
  |  Branch (6839:12): [True: 0, False: 0]
  ------------------
 6840|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP) < 0) {
  ------------------
  |  Branch (6840:9): [True: 0, False: 0]
  ------------------
 6841|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6842|      0|      return NULL;
 6843|      0|    }
 6844|      0|    return blosc2_get_io_cb(id);
 6845|      0|  }
 6846|      0|  return NULL;
 6847|      0|}
blosc2_error_string:
 6916|     64|const char *blosc2_error_string(int error_code) {
 6917|     64|  switch (error_code) {
 6918|     63|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (6918:5): [True: 63, False: 1]
  ------------------
 6919|     63|      return "Generic failure";
 6920|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (6920:5): [True: 0, False: 64]
  ------------------
 6921|      0|      return "Bad stream";
 6922|      0|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (6922:5): [True: 0, False: 64]
  ------------------
 6923|      0|      return "Invalid data";
 6924|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (6924:5): [True: 0, False: 64]
  ------------------
 6925|      0|      return "Memory alloc/realloc failure";
 6926|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (6926:5): [True: 0, False: 64]
  ------------------
 6927|      0|      return "Not enough space to read";
 6928|      1|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (6928:5): [True: 1, False: 63]
  ------------------
 6929|      1|      return "Not enough space to write";
 6930|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (6930:5): [True: 0, False: 64]
  ------------------
 6931|      0|      return "Codec not supported";
 6932|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (6932:5): [True: 0, False: 64]
  ------------------
 6933|      0|      return "Invalid parameter supplied to codec";
 6934|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (6934:5): [True: 0, False: 64]
  ------------------
 6935|      0|      return "Codec dictionary error";
 6936|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (6936:5): [True: 0, False: 64]
  ------------------
 6937|      0|      return "Version not supported";
 6938|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (6938:5): [True: 0, False: 64]
  ------------------
 6939|      0|      return "Invalid value in header";
 6940|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (6940:5): [True: 0, False: 64]
  ------------------
 6941|      0|      return "Invalid parameter supplied to function";
 6942|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (6942:5): [True: 0, False: 64]
  ------------------
 6943|      0|      return "File read failure";
 6944|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (6944:5): [True: 0, False: 64]
  ------------------
 6945|      0|      return "File write failure";
 6946|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (6946:5): [True: 0, False: 64]
  ------------------
 6947|      0|      return "File open failure";
 6948|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (6948:5): [True: 0, False: 64]
  ------------------
 6949|      0|      return "Not found";
 6950|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (6950:5): [True: 0, False: 64]
  ------------------
 6951|      0|      return "Bad run length encoding";
 6952|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (6952:5): [True: 0, False: 64]
  ------------------
 6953|      0|      return "Filter pipeline error";
 6954|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (6954:5): [True: 0, False: 64]
  ------------------
 6955|      0|      return "Chunk insert failure";
 6956|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (6956:5): [True: 0, False: 64]
  ------------------
 6957|      0|      return "Chunk append failure";
 6958|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (6958:5): [True: 0, False: 64]
  ------------------
 6959|      0|      return "Chunk update failure";
 6960|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (6960:5): [True: 0, False: 64]
  ------------------
 6961|      0|      return "Sizes larger than 2gb not supported";
 6962|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (6962:5): [True: 0, False: 64]
  ------------------
 6963|      0|      return "Super-chunk copy failure";
 6964|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (6964:5): [True: 0, False: 64]
  ------------------
 6965|      0|      return "Wrong type for frame";
 6966|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (6966:5): [True: 0, False: 64]
  ------------------
 6967|      0|      return "File truncate failure";
 6968|      0|    case BLOSC2_ERROR_LOCK:
  ------------------
  |  Branch (6968:5): [True: 0, False: 64]
  ------------------
 6969|      0|      return "Frame lock failure";
 6970|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (6970:5): [True: 0, False: 64]
  ------------------
 6971|      0|      return "Thread or thread context creation failure";
 6972|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (6972:5): [True: 0, False: 64]
  ------------------
 6973|      0|      return "Postfilter failure";
 6974|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (6974:5): [True: 0, False: 64]
  ------------------
 6975|      0|      return "Special frame failure";
 6976|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (6976:5): [True: 0, False: 64]
  ------------------
 6977|      0|      return "Special super-chunk failure";
 6978|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (6978:5): [True: 0, False: 64]
  ------------------
 6979|      0|      return "IO plugin error";
 6980|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (6980:5): [True: 0, False: 64]
  ------------------
 6981|      0|      return "Remove file failure";
 6982|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (6982:5): [True: 0, False: 64]
  ------------------
 6983|      0|      return "Pointer is null";
 6984|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (6984:5): [True: 0, False: 64]
  ------------------
 6985|      0|      return "Invalid index";
 6986|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (6986:5): [True: 0, False: 64]
  ------------------
 6987|      0|      return "Metalayer has not been found";
 6988|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (6988:5): [True: 0, False: 64]
  ------------------
 6989|      0|      return "Maximum buffersize exceeded";
 6990|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (6990:5): [True: 0, False: 64]
  ------------------
 6991|      0|      return "Tuner failure";
 6992|      0|    default:
  ------------------
  |  Branch (6992:5): [True: 0, False: 64]
  ------------------
 6993|      0|      return "Unknown error";
 6994|     64|  }
 6995|     64|}
blosc2.c:flags_to_filters:
  687|  85.1M|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  688|       |  /* Initialize the filter pipeline */
  689|  85.1M|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  690|       |  /* Fill the filter pipeline */
  691|  85.1M|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (691:7): [True: 85.1M, False: 3.41k]
  ------------------
  692|  85.1M|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  693|  85.1M|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (693:7): [True: 85.1M, False: 3.87k]
  ------------------
  694|  85.1M|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  695|  85.1M|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (695:7): [True: 53.0M, False: 32.0M]
  ------------------
  696|  53.0M|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  697|  85.1M|}
blosc2.c:destroy_thread_context:
 2276|  68.5k|static void destroy_thread_context(struct thread_context* thread_context) {
 2277|  68.5k|  my_free(thread_context->tmp);
 2278|  68.5k|#if defined(HAVE_ZSTD)
 2279|  68.5k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2279:7): [True: 0, False: 68.5k]
  ------------------
 2280|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2281|      0|  }
 2282|  68.5k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2282:7): [True: 7.15k, False: 61.3k]
  ------------------
 2283|  7.15k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2284|  7.15k|  }
 2285|  68.5k|#endif
 2286|  68.5k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2286:7): [True: 0, False: 68.5k]
  ------------------
 2287|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2288|      0|  }
 2289|  68.5k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2289:7): [True: 0, False: 68.5k]
  ------------------
 2290|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2291|      0|  }
 2292|  68.5k|}
blosc2.c:my_free:
  272|   198k|static void my_free(void* block) {
  273|       |#if defined(_WIN32)
  274|       |  _aligned_free(block);
  275|       |#else
  276|   198k|  free(block);
  277|   198k|#endif  /* _WIN32 */
  278|   198k|}
blosc2.c:initialize_context_compression:
 2392|  9.91k|        blosc2_schunk* schunk) {
 2393|       |
 2394|       |  /* Set parameters */
 2395|  9.91k|  context->do_compress = 1;
 2396|  9.91k|  context->src = (const uint8_t*)src;
 2397|  9.91k|  context->srcsize = srcsize;
 2398|  9.91k|  context->dest = (uint8_t*)dest;
 2399|  9.91k|  context->output_bytes = 0;
 2400|  9.91k|  context->destsize = destsize;
 2401|  9.91k|  context->sourcesize = srcsize;
 2402|  9.91k|  context->typesize = typesize;
 2403|  9.91k|  context->filter_flags = filters_to_flags(filters);
 2404|  69.3k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (2404:19): [True: 59.4k, False: 9.91k]
  ------------------
 2405|  59.4k|    context->filters[i] = filters[i];
 2406|  59.4k|    context->filters_meta[i] = filters_meta[i];
 2407|  59.4k|  }
 2408|  9.91k|  context->compcode = compressor;
 2409|  9.91k|  context->nthreads = nthreads;
 2410|  9.91k|  context->new_nthreads = new_nthreads;
 2411|  9.91k|  context->clevel = clevel;
 2412|  9.91k|  context->schunk = schunk;
 2413|  9.91k|  context->tuner_params = tuner_params;
 2414|  9.91k|  context->tuner_id = tuner_id;
 2415|  9.91k|  context->splitmode = splitmode;
 2416|  9.91k|  context->header_blocksize = (int32_t)blocksize;
 2417|  9.91k|  context->blosc2_flags2 = 0;
 2418|  9.91k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2418:7): [True: 0, False: 9.91k]
  ------------------
 2419|      0|    free(context->blocknbytes);
 2420|      0|    context->blocknbytes = NULL;
 2421|      0|  }
 2422|  9.91k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2422:7): [True: 0, False: 9.91k]
  ------------------
 2423|      0|    free(context->blockoffsets);
 2424|      0|    context->blockoffsets = NULL;
 2425|      0|  }
 2426|  9.91k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2426:7): [True: 0, False: 9.91k]
  ------------------
 2427|      0|    free(context->blockcbytes);
 2428|      0|    context->blockcbytes = NULL;
 2429|      0|  }
 2430|  9.91k|  context->vlblock_sources = NULL;
 2431|  9.91k|  context->vlblock_dests = NULL;
 2432|       |  /* tuner some compression parameters */
 2433|  9.91k|  context->blocksize = (int32_t)blocksize;
 2434|  9.91k|  int rc = 0;
 2435|  9.91k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (2435:7): [True: 0, False: 9.91k]
  ------------------
 2436|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2436:9): [True: 0, False: 0]
  |  Branch (2436:49): [True: 0, False: 0]
  ------------------
 2437|      0|      if (blosc_stune_next_cparams(context) < 0) {
  ------------------
  |  Branch (2437:11): [True: 0, False: 0]
  ------------------
 2438|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2439|      0|        return BLOSC2_ERROR_TUNER;
 2440|      0|      }
 2441|      0|    } else {
 2442|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2442:23): [True: 0, False: 0]
  ------------------
 2443|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2443:13): [True: 0, False: 0]
  ------------------
 2444|      0|          if (g_tuners[i].next_cparams == NULL) {
  ------------------
  |  Branch (2444:15): [True: 0, False: 0]
  ------------------
 2445|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2445:17): [True: 0, False: 0]
  ------------------
 2446|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2447|      0|              return BLOSC2_ERROR_FAILURE;
 2448|      0|            }
 2449|      0|          }
 2450|      0|          if (g_tuners[i].next_cparams(context) < 0) {
  ------------------
  |  Branch (2450:15): [True: 0, False: 0]
  ------------------
 2451|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2452|      0|            return BLOSC2_ERROR_TUNER;
 2453|      0|          }
 2454|      0|          if (g_tuners[i].id == BLOSC_BTUNE && context->blocksize == 0) {
  ------------------
  |  Branch (2454:15): [True: 0, False: 0]
  |  Branch (2454:48): [True: 0, False: 0]
  ------------------
 2455|       |            // Call stune for initializing blocksize
 2456|      0|            if (blosc_stune_next_blocksize(context) < 0) {
  ------------------
  |  Branch (2456:17): [True: 0, False: 0]
  ------------------
 2457|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2458|      0|              return BLOSC2_ERROR_TUNER;
 2459|      0|            }
 2460|      0|          }
 2461|      0|          goto urtunersuccess;
 2462|      0|        }
 2463|      0|      }
 2464|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2465|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2466|      0|    }
 2467|  9.91k|  } else {
 2468|  9.91k|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|  9.91k|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2468:9): [True: 9.91k, False: 0]
  |  Branch (2468:49): [True: 9.91k, False: 0]
  ------------------
 2469|  9.91k|      rc = blosc_stune_next_blocksize(context);
 2470|  9.91k|    } else {
 2471|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2471:23): [True: 0, False: 0]
  ------------------
 2472|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2472:13): [True: 0, False: 0]
  ------------------
 2473|      0|          if (g_tuners[i].next_blocksize == NULL) {
  ------------------
  |  Branch (2473:15): [True: 0, False: 0]
  ------------------
 2474|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2474:17): [True: 0, False: 0]
  ------------------
 2475|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2476|      0|              return BLOSC2_ERROR_FAILURE;
 2477|      0|            }
 2478|      0|          }
 2479|      0|          rc = g_tuners[i].next_blocksize(context);
 2480|      0|          goto urtunersuccess;
 2481|      0|        }
 2482|      0|      }
 2483|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2484|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2485|      0|    }
 2486|  9.91k|  }
 2487|  9.91k|  urtunersuccess:;
 2488|  9.91k|  if (rc < 0) {
  ------------------
  |  Branch (2488:7): [True: 0, False: 9.91k]
  ------------------
 2489|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2490|      0|    return BLOSC2_ERROR_TUNER;
 2491|      0|  }
 2492|       |
 2493|       |
 2494|       |  /* Check buffer size limits */
 2495|  9.91k|  if (srcsize > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (2495:7): [True: 0, False: 9.91k]
  ------------------
 2496|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|      0|                      BLOSC2_MAX_BUFFERSIZE);
 2498|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2499|      0|  }
 2500|       |
 2501|  9.91k|  if (destsize < BLOSC2_MAX_OVERHEAD) {
  ------------------
  |  Branch (2501:7): [True: 0, False: 9.91k]
  ------------------
 2502|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|      0|                      BLOSC2_MAX_OVERHEAD);
 2504|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2505|      0|  }
 2506|       |
 2507|       |  /* Compression level */
 2508|  9.91k|  if (clevel < 0 || clevel > 9) {
  ------------------
  |  Branch (2508:7): [True: 0, False: 9.91k]
  |  Branch (2508:21): [True: 0, False: 9.91k]
  ------------------
 2509|       |    /* If clevel not in 0..9, print an error */
 2510|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2511|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2512|      0|  }
 2513|       |
 2514|       |  /* Dictionary support is only available for ZSTD, LZ4, and LZ4HC.
 2515|       |   * Skip the check when src is NULL (special-value chunks): no compression
 2516|       |   * will actually happen, so codec compatibility is irrelevant. */
 2517|  9.91k|  if (src != NULL && context->use_dict && context->compcode != BLOSC_ZSTD &&
  ------------------
  |  Branch (2517:7): [True: 0, False: 9.91k]
  |  Branch (2517:22): [True: 0, False: 0]
  |  Branch (2517:43): [True: 0, False: 0]
  ------------------
 2518|      0|      context->compcode != BLOSC_LZ4 && context->compcode != BLOSC_LZ4HC) {
  ------------------
  |  Branch (2518:7): [True: 0, False: 0]
  |  Branch (2518:41): [True: 0, False: 0]
  ------------------
 2519|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2520|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2521|      0|  }
 2522|       |
 2523|       |  /* Check typesize limits */
 2524|  9.91k|  if (context->typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (2524:7): [True: 16, False: 9.89k]
  ------------------
 2525|       |    // If typesize is too large for Blosc2, return an error
 2526|     16|    BLOSC_TRACE_ERROR("Typesize cannot exceed %d bytes.", BLOSC2_MAXTYPESIZE);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2527|     16|    return BLOSC2_ERROR_INVALID_PARAM;
 2528|     16|  }
 2529|       |  /* Now, cap typesize so that blosc2 split machinery can continue to work */
 2530|  9.89k|  if (context->typesize > BLOSC_MAX_TYPESIZE) {
  ------------------
  |  Branch (2530:7): [True: 8.39k, False: 1.49k]
  ------------------
 2531|       |    /* If typesize is too large, treat buffer as an 1-byte stream. */
 2532|  8.39k|    context->typesize = 1;
 2533|  8.39k|  }
 2534|       |
 2535|  9.89k|  blosc2_calculate_blocks(context);
 2536|       |
 2537|  9.89k|  return 1;
 2538|  9.91k|}
blosc2.c:filters_to_flags:
  664|   131k|static uint8_t filters_to_flags(const uint8_t* filters) {
  665|   131k|  uint8_t flags = 0;
  666|       |
  667|   923k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (667:19): [True: 791k, False: 131k]
  ------------------
  668|   791k|    switch (filters[i]) {
  669|   117k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (669:7): [True: 117k, False: 673k]
  ------------------
  670|   117k|        flags |= BLOSC_DOSHUFFLE;
  671|   117k|        break;
  672|  57.7k|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (672:7): [True: 57.7k, False: 734k]
  ------------------
  673|  57.7k|        flags |= BLOSC_DOBITSHUFFLE;
  674|  57.7k|        break;
  675|  73.2k|      case BLOSC_DELTA:
  ------------------
  |  Branch (675:7): [True: 73.2k, False: 718k]
  ------------------
  676|  73.2k|        flags |= BLOSC_DODELTA;
  677|  73.2k|        break;
  678|   542k|      default :
  ------------------
  |  Branch (678:7): [True: 542k, False: 248k]
  ------------------
  679|   542k|        break;
  680|   791k|    }
  681|   791k|  }
  682|   131k|  return flags;
  683|   131k|}
blosc2.c:blosc2_calculate_blocks:
  854|   132k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  855|       |  /* Compute number of blocks in buffer */
  856|   132k|  context->nblocks = context->sourcesize / context->blocksize;
  857|   132k|  context->leftover = context->sourcesize % context->blocksize;
  858|   132k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (858:22): [True: 86.9k, False: 45.9k]
  ------------------
  859|  86.9k|                     (context->nblocks + 1) : context->nblocks;
  860|   132k|}
blosc2.c:clibcode_to_clibname:
  305|      3|static const char* clibcode_to_clibname(int clibcode) {
  306|      3|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (306:7): [True: 0, False: 3]
  ------------------
  307|      3|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (307:7): [True: 0, False: 3]
  ------------------
  308|      3|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (308:7): [True: 0, False: 3]
  ------------------
  309|      3|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (309:7): [True: 0, False: 3]
  ------------------
  310|     30|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (310:19): [True: 27, False: 3]
  ------------------
  311|     27|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (311:9): [True: 0, False: 27]
  ------------------
  312|      0|      return g_codecs[i].compname;
  313|     27|  }
  314|      3|  return NULL;                  /* should never happen */
  315|      3|}
blosc2.c:blosc_run_decompression_with_context:
 3911|  66.7k|                                                void* dest, int32_t destsize) {
 3912|  66.7k|  blosc_header header;
 3913|  66.7k|  int32_t ntbytes;
 3914|  66.7k|  int rc;
 3915|       |
 3916|  66.7k|  rc = read_chunk_header(src, srcsize, true, &header);
 3917|  66.7k|  if (rc < 0) {
  ------------------
  |  Branch (3917:7): [True: 46, False: 66.7k]
  ------------------
 3918|     46|    return rc;
 3919|     46|  }
 3920|       |
 3921|  66.7k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (3921:7): [True: 0, False: 66.7k]
  ------------------
 3922|       |    // Not enough space for writing into the destination
 3923|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 3924|      0|  }
 3925|       |
 3926|  66.7k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 3927|  66.7k|  if (rc < 0) {
  ------------------
  |  Branch (3927:7): [True: 874, False: 65.8k]
  ------------------
 3928|    874|    return rc;
 3929|    874|  }
 3930|       |
 3931|       |  /* Do the actual decompression */
 3932|  65.8k|  ntbytes = do_job(context);
 3933|  65.8k|  if (ntbytes < 0) {
  ------------------
  |  Branch (3933:7): [True: 9.66k, False: 56.2k]
  ------------------
 3934|  9.66k|    return ntbytes;
 3935|  9.66k|  }
 3936|       |
 3937|  65.8k|  assert(ntbytes <= (int32_t)destsize);
 3938|  56.2k|  return ntbytes;
 3939|  65.8k|}
blosc2.c:initialize_context_decompression:
 2689|  66.7k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2690|  66.7k|  int32_t bstarts_end;
 2691|  66.7k|  bool vlblocks;
 2692|       |
 2693|  66.7k|  context->do_compress = 0;
 2694|  66.7k|  context->src = (const uint8_t*)src;
 2695|  66.7k|  context->srcsize = srcsize;
 2696|  66.7k|  context->dest = (uint8_t*)dest;
 2697|  66.7k|  context->destsize = destsize;
 2698|  66.7k|  context->output_bytes = 0;
 2699|  66.7k|  context->vlblock_sources = NULL;
 2700|  66.7k|  context->vlblock_dests = NULL;
 2701|  66.7k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2701:7): [True: 0, False: 66.7k]
  ------------------
 2702|      0|    free(context->blocknbytes);
 2703|      0|    context->blocknbytes = NULL;
 2704|      0|  }
 2705|  66.7k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2705:7): [True: 0, False: 66.7k]
  ------------------
 2706|      0|    free(context->blockoffsets);
 2707|      0|    context->blockoffsets = NULL;
 2708|      0|  }
 2709|  66.7k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2709:7): [True: 0, False: 66.7k]
  ------------------
 2710|      0|    free(context->blockcbytes);
 2711|      0|    context->blockcbytes = NULL;
 2712|      0|  }
 2713|       |
 2714|  66.7k|  int rc = blosc2_initialize_context_from_header(context, header);
 2715|  66.7k|  if (rc < 0) {
  ------------------
  |  Branch (2715:7): [True: 0, False: 66.7k]
  ------------------
 2716|      0|    return rc;
 2717|      0|  }
 2718|  66.7k|  clear_context_decompression_dict(context);
 2719|  66.7k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2720|  66.7k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2720:19): [True: 66.0k, False: 741]
  ------------------
 2721|  66.0k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2721:19): [True: 1.07k, False: 64.9k]
  ------------------
 2722|       |
 2723|       |  /* Check that we have enough space to decompress */
 2724|  66.7k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2724:7): [True: 0, False: 66.7k]
  ------------------
 2725|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2726|      0|  }
 2727|       |
 2728|  66.7k|  if (context->block_maskout != NULL && context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2728:7): [True: 0, False: 66.7k]
  |  Branch (2728:41): [True: 0, False: 0]
  ------------------
 2729|      0|    BLOSC_TRACE_ERROR("The number of items in block_maskout (%d) must match the number"
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2730|      0|                      " of blocks in chunk (%d).",
 2731|      0|                      context->block_maskout_nitems, context->nblocks);
 2732|      0|    return BLOSC2_ERROR_DATA;
 2733|      0|  }
 2734|       |
 2735|  66.7k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2736|  66.7k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2736:7): [True: 1, False: 66.7k]
  ------------------
 2737|      1|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|      1|                      context->special_type);
 2739|      1|    return BLOSC2_ERROR_DATA;
 2740|      1|  }
 2741|       |
 2742|  66.7k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2743|  66.7k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2743:7): [True: 429, False: 66.3k]
  |  Branch (2743:19): [True: 35, False: 394]
  ------------------
 2744|     35|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   93|     35|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     35|    do {                                            \
  |  |  |  |   98|     35|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     35|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 35, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     35|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2745|     35|    return BLOSC2_ERROR_DATA;
 2746|     35|  }
 2747|       |
 2748|  66.7k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2748:7): [True: 8.31k, False: 58.4k]
  |  Branch (2748:32): [True: 8.30k, False: 1]
  ------------------
 2749|  8.30k|      !context->special_type) {
  ------------------
  |  Branch (2749:7): [True: 0, False: 8.30k]
  ------------------
 2750|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 2751|      0|    return 0;
 2752|      0|  }
 2753|       |
 2754|  66.7k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2755|  66.7k|  bstarts_end = context->header_overhead;
 2756|  66.7k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2756:7): [True: 50.5k, False: 16.1k]
  |  Branch (2756:33): [True: 50.1k, False: 363]
  ------------------
 2757|  50.1k|    size_t bstarts_end_tmp;
 2758|  50.1k|    size_t bstarts_nbytes;
 2759|  50.1k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2759:9): [True: 19, False: 50.1k]
  ------------------
 2760|  50.1k|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2760:9): [True: 0, False: 50.1k]
  ------------------
 2761|  50.1k|        !checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2761:9): [True: 0, False: 50.1k]
  ------------------
 2762|  50.1k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2762:9): [True: 4, False: 50.1k]
  ------------------
 2763|     23|      BLOSC_TRACE_ERROR("Invalid bstarts size in chunk header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2764|     23|      return BLOSC2_ERROR_INVALID_HEADER;
 2765|     23|    }
 2766|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 2767|  50.1k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2768|  50.1k|  }
 2769|       |
 2770|  66.6k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2770:7): [True: 80, False: 66.6k]
  ------------------
 2771|     80|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|     80|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     80|    do {                                            \
  |  |  |  |   98|     80|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     80|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 80, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     80|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2772|     80|    return BLOSC2_ERROR_READ_BUFFER;
 2773|     80|  }
 2774|       |
 2775|  66.6k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2775:7): [True: 262, False: 66.3k]
  |  Branch (2775:19): [True: 80, False: 182]
  |  Branch (2775:30): [True: 80, False: 0]
  |  Branch (2775:56): [True: 80, False: 0]
  ------------------
 2776|     80|    size_t block_csizes_nbytes;
 2777|     80|    size_t trailer_meta_nbytes;
 2778|     80|    size_t lazy_trailer_end;
 2779|     80|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2779:9): [True: 0, False: 80]
  |  Branch (2779:33): [True: 0, False: 80]
  ------------------
 2780|     80|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2780:9): [True: 0, False: 80]
  ------------------
 2781|     80|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2781:9): [True: 0, False: 80]
  ------------------
 2782|     80|        !checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2782:9): [True: 0, False: 80]
  ------------------
 2783|     80|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2783:9): [True: 6, False: 74]
  ------------------
 2784|      6|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2785|      6|      return BLOSC2_ERROR_READ_BUFFER;
 2786|      6|    }
 2787|     80|  }
 2788|  66.6k|  srcsize -= bstarts_end;
 2789|       |
 2790|       |  /* Read optional dictionary if flag set */
 2791|  66.6k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2791:7): [True: 8.57k, False: 58.0k]
  |  Branch (2791:51): [True: 8.52k, False: 48]
  ------------------
 2792|  8.52k|    context->use_dict = 1;
 2793|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2794|  8.52k|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2794:9): [True: 3, False: 8.52k]
  ------------------
 2795|      3|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2796|      3|      return BLOSC2_ERROR_READ_BUFFER;
 2797|      3|    }
 2798|  8.52k|    srcsize -= sizeof(int32_t);
 2799|       |    // Read dictionary size
 2800|  8.52k|    context->dict_size = sw32_(context->src + bstarts_end);
 2801|  8.52k|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2801:9): [True: 16, False: 8.50k]
  |  Branch (2801:36): [True: 26, False: 8.47k]
  ------------------
 2802|     42|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|     42|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     42|    do {                                            \
  |  |  |  |   98|     42|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     42|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     42|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2803|     42|      return BLOSC2_ERROR_CODEC_DICT;
 2804|     42|    }
 2805|  8.47k|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2805:9): [True: 11, False: 8.46k]
  ------------------
 2806|     11|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2807|     11|      return BLOSC2_ERROR_READ_BUFFER;
 2808|     11|    }
 2809|  8.46k|    srcsize -= context->dict_size;
 2810|       |    // dict_buffer points directly into the source chunk — no copy needed
 2811|  8.46k|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2812|  8.46k|    context->dict_buffer_owned = false;
 2813|  8.46k|#if defined(HAVE_ZSTD)
 2814|       |    // context->compcode during decompression holds the format code (flags >> 5),
 2815|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 2816|  8.46k|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2816:9): [True: 7.27k, False: 1.19k]
  ------------------
 2817|  7.27k|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2818|  7.27k|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2818:11): [True: 384, False: 6.89k]
  ------------------
 2819|    384|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|    384|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    384|    do {                                            \
  |  |  |  |   98|    384|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    384|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 384, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    384|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2820|    384|        return BLOSC2_ERROR_CODEC_DICT;
 2821|    384|      }
 2822|  7.27k|    }
 2823|  8.46k|#endif   // HAVE_ZSTD
 2824|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2825|  8.46k|  }
 2826|  58.0k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2826:12): [True: 48, False: 58.0k]
  |  Branch (2826:56): [True: 48, False: 0]
  ------------------
 2827|     48|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2828|     48|    if (rc < 0) {
  ------------------
  |  Branch (2828:9): [True: 48, False: 0]
  ------------------
 2829|     48|      return rc;
 2830|     48|    }
 2831|     48|  }
 2832|       |
 2833|  66.1k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2833:7): [True: 254, False: 65.8k]
  |  Branch (2833:19): [True: 254, False: 0]
  |  Branch (2833:45): [True: 254, False: 0]
  ------------------
 2834|    254|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2835|    254|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    254|    do {                                            \
  |  |  105|    254|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 254]
  |  |  ------------------
  |  |  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|    254|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 254]
  |  |  ------------------
  ------------------
 2836|    254|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2837|    254|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    254|    do {                                            \
  |  |  105|    254|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 254]
  |  |  ------------------
  |  |  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|    254|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 254]
  |  |  ------------------
  ------------------
 2838|    254|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2839|    254|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    254|    do {                                            \
  |  |  105|    254|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 254]
  |  |  ------------------
  |  |  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|    254|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 254]
  |  |  ------------------
  ------------------
 2840|       |
 2841|    254|    if (is_lazy) {
  ------------------
  |  Branch (2841:9): [True: 73, False: 181]
  ------------------
 2842|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 2843|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 2844|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 2845|     73|      int32_t max_csize = 0;
 2846|     88|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2846:27): [True: 79, False: 9]
  ------------------
 2847|     79|        int32_t bstart = sw32_(context->bstarts + i);
 2848|     79|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2848:31): [True: 31, False: 48]
  ------------------
 2849|     48|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2850|     79|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2850:13): [True: 10, False: 69]
  |  Branch (2850:37): [True: 35, False: 34]
  ------------------
 2851|     64|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2851:13): [True: 19, False: 15]
  ------------------
 2852|     64|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   93|     64|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     64|    do {                                            \
  |  |  |  |   98|     64|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     64|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 64, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     64|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2853|     64|          return BLOSC2_ERROR_INVALID_HEADER;
 2854|     64|        }
 2855|     15|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2856|     15|        context->blockoffsets[i] = 0;  // unknown
 2857|     15|        context->blockcbytes[i] = next_bstart - bstart;
 2858|     15|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2858:13): [True: 14, False: 1]
  ------------------
 2859|     14|          max_csize = context->blockcbytes[i];
 2860|     14|        }
 2861|     15|      }
 2862|      9|      context->blocksize = max_csize;
 2863|      9|      context->leftover = 0;
 2864|      9|    }
 2865|    181|    else {
 2866|    181|      int32_t max_blocksize = 0;
 2867|    181|      int64_t total_nbytes = 0;
 2868|    181|      int32_t prev_bstart = 0;
 2869|    228|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2869:27): [True: 184, False: 44]
  ------------------
 2870|    184|        int32_t bstart = sw32_(context->bstarts + i);
 2871|    184|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2871:31): [True: 42, False: 142]
  ------------------
 2872|    142|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2873|    184|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2873:13): [True: 5, False: 179]
  |  Branch (2873:37): [True: 0, False: 179]
  |  Branch (2873:62): [True: 38, False: 141]
  ------------------
 2874|    141|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2874:13): [True: 30, False: 111]
  |  Branch (2874:45): [True: 3, False: 108]
  ------------------
 2875|     76|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|     76|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     76|    do {                                            \
  |  |  |  |   98|     76|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     76|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 76, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     76|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2876|     76|          return BLOSC2_ERROR_INVALID_HEADER;
 2877|     76|        }
 2878|    108|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2879|    108|        context->blockcbytes[i] = next_bstart - bstart;
 2880|    108|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2880:13): [True: 29, False: 79]
  ------------------
 2881|     29|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   93|     29|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     29|    do {                                            \
  |  |  |  |   98|     29|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     29|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     29|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2882|     29|          return BLOSC2_ERROR_INVALID_HEADER;
 2883|     29|        }
 2884|     79|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2884:13): [True: 0, False: 79]
  ------------------
 2885|      0|          BLOSC_TRACE_ERROR("Invalid VL-block cumulative size in chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2886|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2887|      0|        }
 2888|     79|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2889|     79|        total_nbytes += context->blocknbytes[i];
 2890|     79|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2890:13): [True: 32, False: 47]
  ------------------
 2891|     32|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2892|     32|          return BLOSC2_ERROR_INVALID_HEADER;
 2893|     32|        }
 2894|     47|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2894:13): [True: 46, False: 1]
  ------------------
 2895|     46|          max_blocksize = context->blocknbytes[i];
 2896|     46|        }
 2897|     47|        prev_bstart = bstart;
 2898|     47|      }
 2899|     44|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2899:11): [True: 40, False: 4]
  ------------------
 2900|     40|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   93|     40|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     40|    do {                                            \
  |  |  |  |   98|     40|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     40|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     40|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2901|     40|        return BLOSC2_ERROR_INVALID_HEADER;
 2902|     40|      }
 2903|      4|      context->blocksize = max_blocksize;
 2904|      4|      context->leftover = 0;
 2905|      4|    }
 2906|    254|  }
 2907|       |
 2908|  65.8k|  return 0;
 2909|  66.1k|}
blosc2.c:load_lazy_chunk_dict:
 2635|     48|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 2636|     48|  int32_t dict_offset = bstarts_end;
 2637|     48|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2637:7): [True: 3, False: 45]
  ------------------
 2638|      3|    BLOSC_TRACE_ERROR("Lazy chunk dictionary header exceeds chunk length.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2639|      3|    return BLOSC2_ERROR_INVALID_HEADER;
 2640|      3|  }
 2641|       |
 2642|     45|  uint8_t dict_size_buf[sizeof(int32_t)];
 2643|     45|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 2644|     45|                                 "Cannot open frame file for lazy chunk dictionary read.",
 2645|     45|                                 "Cannot read lazy chunk dictionary size from disk.");
 2646|     45|  if (rc < 0) {
  ------------------
  |  Branch (2646:7): [True: 45, False: 0]
  ------------------
 2647|     45|    return rc;
 2648|     45|  }
 2649|       |
 2650|      0|  context->dict_size = sw32_(dict_size_buf);
 2651|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2651:7): [True: 0, False: 0]
  |  Branch (2651:34): [True: 0, False: 0]
  ------------------
 2652|      0|    BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2653|      0|    return BLOSC2_ERROR_CODEC_DICT;
 2654|      0|  }
 2655|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (2655:7): [True: 0, False: 0]
  ------------------
 2656|      0|    BLOSC_TRACE_ERROR("Lazy chunk dictionary exceeds chunk length.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2657|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2658|      0|  }
 2659|       |
 2660|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 2661|      0|  BLOSC_ERROR_NULL(context->dict_buffer, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2662|      0|  context->dict_buffer_owned = true;
 2663|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 2664|      0|                             context->dict_buffer, context->dict_size,
 2665|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 2666|      0|                             "Cannot read lazy chunk dictionary from disk.");
 2667|      0|  if (rc < 0) {
  ------------------
  |  Branch (2667:7): [True: 0, False: 0]
  ------------------
 2668|      0|    release_context_dict_buffer(context);
 2669|      0|    return rc;
 2670|      0|  }
 2671|       |
 2672|      0|  context->use_dict = 1;
 2673|      0|#if defined(HAVE_ZSTD)
 2674|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2674:7): [True: 0, False: 0]
  ------------------
 2675|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2676|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2676:9): [True: 0, False: 0]
  ------------------
 2677|      0|      release_context_dict_buffer(context);
 2678|      0|      BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for lazy chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2679|      0|      return BLOSC2_ERROR_CODEC_DICT;
 2680|      0|    }
 2681|      0|  }
 2682|      0|#endif
 2683|       |
 2684|      0|  return 0;
 2685|      0|}
blosc2.c:read_lazy_chunk_bytes:
 2565|     45|                                 const char* open_error, const char* read_error) {
 2566|     45|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (2566:7): [True: 15, False: 30]
  |  Branch (2566:34): [True: 0, False: 30]
  ------------------
 2567|     15|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2568|     15|    return BLOSC2_ERROR_INVALID_PARAM;
 2569|     15|  }
 2570|       |
 2571|     30|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2572|     30|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2573|     30|  if (io_cb == NULL) {
  ------------------
  |  Branch (2573:7): [True: 0, False: 30]
  ------------------
 2574|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2575|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 2576|      0|  }
 2577|       |
 2578|     30|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 2579|     30|                           context->nblocks * (int32_t)sizeof(int32_t);
 2580|     30|  int32_t nchunk_lazy;
 2581|     30|  int64_t chunk_offset;
 2582|     30|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 2583|     30|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 2584|       |
 2585|     30|  void* fp = NULL;
 2586|     30|  int64_t io_pos;
 2587|     30|  if (frame->sframe) {
  ------------------
  |  Branch (2587:7): [True: 0, False: 30]
  ------------------
 2588|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 2589|      0|    io_pos = offset;
 2590|      0|  }
 2591|     30|  else {
 2592|     30|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (2592:9): [True: 11, False: 19]
  |  Branch (2592:29): [True: 0, False: 19]
  ------------------
 2593|     11|      BLOSC_TRACE_ERROR("Lazy chunk offset cannot be negative.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2594|     11|      return BLOSC2_ERROR_INVALID_HEADER;
 2595|     11|    }
 2596|     19|    fp = frame_reader_acquire(frame, context->schunk->storage->io);
 2597|     19|    if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (2597:9): [True: 0, False: 19]
  ------------------
 2598|      0|      BLOSC_TRACE_ERROR("Lazy chunk offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2599|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2599:11): [True: 0, False: 0]
  ------------------
 2600|      0|        frame_reader_release(frame, io_cb, fp);
 2601|      0|      }
 2602|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2603|      0|    }
 2604|     19|    io_pos = frame->file_offset + chunk_offset;
 2605|     19|    if (io_pos > INT64_MAX - offset) {
  ------------------
  |  Branch (2605:9): [True: 1, False: 18]
  ------------------
 2606|      1|      BLOSC_TRACE_ERROR("Lazy block offset overflows file position.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2607|      1|      if (fp != NULL) {
  ------------------
  |  Branch (2607:11): [True: 0, False: 1]
  ------------------
 2608|      0|        frame_reader_release(frame, io_cb, fp);
 2609|      0|      }
 2610|      1|      return BLOSC2_ERROR_INVALID_HEADER;
 2611|      1|    }
 2612|     18|    io_pos += offset;
 2613|     18|  }
 2614|     18|  if (fp == NULL) {
  ------------------
  |  Branch (2614:7): [True: 18, False: 0]
  ------------------
 2615|     18|    BLOSC_TRACE_ERROR("%s", open_error);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2616|     18|    return BLOSC2_ERROR_FILE_OPEN;
 2617|     18|  }
 2618|       |
 2619|      0|  uint8_t* read_buffer = buffer;
 2620|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 2621|      0|  frame_reader_release(frame, io_cb, fp);
 2622|      0|  if (read_buffer != buffer) {
  ------------------
  |  Branch (2622:7): [True: 0, False: 0]
  ------------------
 2623|      0|    memcpy(buffer, read_buffer, (size_t)nbytes);
 2624|      0|    free(read_buffer);
 2625|      0|  }
 2626|      0|  if (rbytes != nbytes) {
  ------------------
  |  Branch (2626:7): [True: 0, False: 0]
  ------------------
 2627|      0|    BLOSC_TRACE_ERROR("%s", read_error);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2628|      0|    return BLOSC2_ERROR_FILE_READ;
 2629|      0|  }
 2630|       |
 2631|      0|  return 0;
 2632|      0|}
blosc2.c:do_job:
 2349|  65.8k|static int do_job(blosc2_context* context) {
 2350|  65.8k|  int32_t ntbytes;
 2351|       |
 2352|       |  /* Set sentinels */
 2353|  65.8k|  context->dref_not_init = 1;
 2354|       |
 2355|       |  /* Check whether we need to restart threads.  If the thread backend could
 2356|       |     not be set up (e.g. shared-pool creation failed under thread/resource
 2357|       |     exhaustion), rc < 0 and context->thread_pool stays NULL; fall back to the
 2358|       |     serial path below instead of dereferencing a NULL pool in parallel_blosc.
 2359|       |     The failed pool creation already emitted a TRACE_ERROR, and the next
 2360|       |     do_job() re-attempts the attach, so the fallback is self-healing. */
 2361|  65.8k|  int rc = check_nthreads(context);
 2362|       |
 2363|       |  /* Run the serial version when nthreads is 1, when the buffers are not larger
 2364|       |     than blocksize, or when the parallel backend failed to start */
 2365|  65.8k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1 || rc < 0) {
  ------------------
  |  Branch (2365:7): [True: 65.8k, False: 0]
  |  Branch (2365:33): [True: 0, False: 0]
  |  Branch (2365:84): [True: 0, False: 0]
  ------------------
 2366|       |    /* The context for this 'thread' has no been initialized yet */
 2367|  65.8k|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2367:9): [True: 11.9k, False: 53.9k]
  ------------------
 2368|  11.9k|      context->serial_context = create_thread_context(context, 0);
 2369|  11.9k|    }
 2370|  53.9k|    else if (context->blocksize != context->serial_context->tmp_blocksize) {
  ------------------
  |  Branch (2370:14): [True: 52, False: 53.8k]
  ------------------
 2371|     52|      free_thread_context(context->serial_context);
 2372|     52|      context->serial_context = create_thread_context(context, 0);
 2373|     52|    }
 2374|  65.8k|    BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  65.8k|    do {                                            \
  |  |  105|  65.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 65.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|  65.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 65.8k]
  |  |  ------------------
  ------------------
 2375|  65.8k|    ntbytes = serial_blosc(context->serial_context);
 2376|  65.8k|  }
 2377|      0|  else {
 2378|      0|    ntbytes = parallel_blosc(context);
 2379|      0|  }
 2380|       |
 2381|  65.8k|  return ntbytes;
 2382|  65.8k|}
blosc2.c:serial_blosc:
 2161|  65.8k|static int serial_blosc(struct thread_context* thread_context) {
 2162|  65.8k|  blosc2_context* context = thread_context->parent_context;
 2163|  65.8k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2164|  65.8k|  int32_t j, bsize, leftoverblock;
 2165|  65.8k|  int32_t cbytes;
 2166|  65.8k|  int32_t ntbytes = context->output_bytes;
 2167|  65.8k|  int32_t* bstarts = context->bstarts;
 2168|  65.8k|  uint8_t* tmp = thread_context->tmp;
 2169|  65.8k|  uint8_t* tmp2 = thread_context->tmp2;
 2170|  65.8k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2170:23): [True: 8.08k, False: 57.7k]
  |  Branch (2170:44): [True: 8.08k, False: 0]
  ------------------
 2171|  65.8k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2172|  65.8k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2172:7): [True: 65.8k, False: 0]
  |  Branch (2172:32): [True: 15.8k, False: 50.0k]
  ------------------
 2173|       |    // Fake a runlen as if it was a memcpyed chunk
 2174|  15.8k|    memcpyed = true;
 2175|  15.8k|  }
 2176|       |
 2177|  84.9M|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2177:15): [True: 84.8M, False: 56.2k]
  ------------------
 2178|  84.8M|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2178:9): [True: 0, False: 84.8M]
  |  Branch (2178:33): [True: 0, False: 0]
  |  Branch (2178:46): [True: 0, False: 0]
  ------------------
 2179|      0|      _sw32(bstarts + j, ntbytes);
 2180|      0|    }
 2181|  84.8M|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2181:13): [True: 13, False: 84.8M]
  ------------------
 2182|  84.8M|    leftoverblock = 0;
 2183|  84.8M|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2183:9): [True: 84.8M, False: 13]
  |  Branch (2183:22): [True: 50.9k, False: 84.8M]
  |  Branch (2183:53): [True: 38.5k, False: 12.4k]
  ------------------
 2184|  38.5k|      bsize = context->leftover;
 2185|  38.5k|      leftoverblock = 1;
 2186|  38.5k|    }
 2187|  84.8M|    if (context->do_compress) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 84.8M]
  ------------------
 2188|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2188:11): [True: 0, False: 0]
  |  Branch (2188:23): [True: 0, False: 0]
  ------------------
 2189|       |        /* We want to memcpy only */
 2190|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2191|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2192|      0|        cbytes = (int32_t)bsize;
 2193|      0|      }
 2194|      0|      else {
 2195|       |        /* Regular compression */
 2196|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2197|      0|                         context->destsize,
 2198|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2198:26): [True: 0, False: 0]
  ------------------
 2199|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2199:26): [True: 0, False: 0]
  ------------------
 2200|      0|                         context->dest + ntbytes, tmp, tmp2);
 2201|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2201:13): [True: 0, False: 0]
  ------------------
 2202|      0|          ntbytes = 0;              /* incompressible data */
 2203|      0|          break;
 2204|      0|        }
 2205|      0|      }
 2206|      0|    }
 2207|  84.8M|    else {
 2208|       |      /* Regular decompression */
 2209|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2210|  84.8M|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2210:28): [True: 84.7M, False: 83.9k]
  ------------------
 2211|  84.7M|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2212|  84.8M|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2212:30): [True: 13, False: 84.8M]
  |  Branch (2212:42): [True: 0, False: 13]
  ------------------
 2213|  84.8M|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2213:30): [True: 13, False: 84.8M]
  |  Branch (2213:42): [True: 0, False: 13]
  ------------------
 2214|  84.8M|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2214:30): [True: 13, False: 84.8M]
  ------------------
 2215|  84.8M|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2216|  84.8M|                       context->src, context->srcsize, src_offset, j,
 2217|  84.8M|                       dest_block, dest_offset, tmp, tmp2);
 2218|  84.8M|    }
 2219|       |
 2220|  84.8M|    if (cbytes < 0) {
  ------------------
  |  Branch (2220:9): [True: 9.66k, False: 84.8M]
  ------------------
 2221|  9.66k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2222|  9.66k|      break;
 2223|  9.66k|    }
 2224|  84.8M|    ntbytes += cbytes;
 2225|  84.8M|  }
 2226|       |
 2227|  65.8k|  return ntbytes;
 2228|  65.8k|}
blosc2.c:set_values:
 1644|  50.0M|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 1645|       |#if defined(BLOSC_STRICT_ALIGN)
 1646|       |  if (destsize % typesize != 0) {
 1647|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 1648|       |  }
 1649|       |  int32_t nitems = destsize / typesize;
 1650|       |  if (nitems == 0) {
 1651|       |    return 0;
 1652|       |  }
 1653|       |  for (int i = 0; i < nitems; i++) {
 1654|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1655|       |  }
 1656|       |#else
 1657|  50.0M|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1657:7): [True: 41, False: 50.0M]
  ------------------
 1658|     41|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|     41|    do {                                            \
  |  |  112|     41|        int rc_ = (rc);                             \
  |  |  113|     41|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 41, False: 0]
  |  |  ------------------
  |  |  114|     41|            char *error_msg = print_error(rc_);     \
  |  |  115|     41|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|     41|            return rc_;                             \
  |  |  117|     41|        }                                           \
  |  |  118|     41|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1659|     41|  }
 1660|  50.0M|  int32_t nitems = destsize / typesize;
 1661|  50.0M|  if (nitems == 0) {
  ------------------
  |  Branch (1661:7): [True: 0, False: 50.0M]
  ------------------
 1662|      0|    return 0;
 1663|      0|  }
 1664|       |
 1665|  50.0M|  switch (typesize) {
 1666|  43.8M|    case 8: {
  ------------------
  |  Branch (1666:5): [True: 43.8M, False: 6.18M]
  ------------------
 1667|  43.8M|      int64_t val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1668|  43.8M|      int64_t* dest8 = (int64_t*)dest;
 1669|  1.15G|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1669:23): [True: 1.11G, False: 43.8M]
  ------------------
 1670|  1.11G|        dest8[i] = val8;
 1671|  1.11G|      }
 1672|  43.8M|      break;
 1673|      0|    }
 1674|   114k|    case 4: {
  ------------------
  |  Branch (1674:5): [True: 114k, False: 49.9M]
  ------------------
 1675|   114k|      int32_t val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1676|   114k|      int32_t* dest4 = (int32_t*)dest;
 1677|  4.90G|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1677:23): [True: 4.90G, False: 114k]
  ------------------
 1678|  4.90G|        dest4[i] = val4;
 1679|  4.90G|      }
 1680|   114k|      break;
 1681|      0|    }
 1682|  4.21M|    case 2: {
  ------------------
  |  Branch (1682:5): [True: 4.21M, False: 45.8M]
  ------------------
 1683|  4.21M|      int16_t val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1684|  4.21M|      int16_t* dest2 = (int16_t*)dest;
 1685|  7.71G|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1685:23): [True: 7.71G, False: 4.21M]
  ------------------
 1686|  7.71G|        dest2[i] = val2;
 1687|  7.71G|      }
 1688|  4.21M|      break;
 1689|      0|    }
 1690|    412|    case 1: {
  ------------------
  |  Branch (1690:5): [True: 412, False: 50.0M]
  ------------------
 1691|    412|      int8_t val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1692|    412|      int8_t* dest1 = (int8_t*)dest;
 1693|  6.08G|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1693:23): [True: 6.08G, False: 412]
  ------------------
 1694|  6.08G|        dest1[i] = val1;
 1695|  6.08G|      }
 1696|    412|      break;
 1697|      0|    }
 1698|  1.84M|    default:
  ------------------
  |  Branch (1698:5): [True: 1.84M, False: 48.1M]
  ------------------
 1699|   793M|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1699:23): [True: 791M, False: 1.84M]
  ------------------
 1700|   791M|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1701|   791M|      }
 1702|  50.0M|  }
 1703|  50.0M|#endif
 1704|       |
 1705|  50.0M|  return nitems;
 1706|  50.0M|}
blosc2.c:set_nans:
 1612|  15.0M|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1613|  15.0M|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1613:7): [True: 4, False: 15.0M]
  ------------------
 1614|      4|    BLOSC_TRACE_ERROR("destsize can only be a multiple of typesize");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|      4|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1616|      4|  }
 1617|  15.0M|  int32_t nitems = destsize / typesize;
 1618|  15.0M|  if (nitems == 0) {
  ------------------
  |  Branch (1618:7): [True: 0, False: 15.0M]
  ------------------
 1619|      0|    return 0;
 1620|      0|  }
 1621|       |
 1622|  15.0M|  if (typesize == 4) {
  ------------------
  |  Branch (1622:7): [True: 3.32M, False: 11.7M]
  ------------------
 1623|  3.32M|    float* dest_ = (float*)dest;
 1624|  3.32M|    float val = nanf("");
 1625|  4.90G|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1625:21): [True: 4.90G, False: 3.32M]
  ------------------
 1626|  4.90G|      dest_[i] = val;
 1627|  4.90G|    }
 1628|  3.32M|    return nitems;
 1629|  3.32M|  }
 1630|  11.7M|  else if (typesize == 8) {
  ------------------
  |  Branch (1630:12): [True: 11.7M, False: 17]
  ------------------
 1631|  11.7M|    double* dest_ = (double*)dest;
 1632|  11.7M|    double val = nan("");
 1633|   992M|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1633:21): [True: 980M, False: 11.7M]
  ------------------
 1634|   980M|      dest_[i] = val;
 1635|   980M|    }
 1636|  11.7M|    return nitems;
 1637|  11.7M|  }
 1638|       |
 1639|     17|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1640|     17|  return BLOSC2_ERROR_DATA;
 1641|  15.0M|}
blosc2.c:my_malloc:
  243|   199k|static uint8_t* my_malloc(size_t size) {
  244|   199k|  void* block = NULL;
  245|   199k|  int res = 0;
  246|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  247|   199k|  if (size == 0) {
  ------------------
  |  Branch (247:7): [True: 0, False: 199k]
  ------------------
  248|      0|    size = 1;
  249|      0|  }
  250|       |
  251|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  252|       |#if defined(_WIN32)
  253|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  254|       |  block = (void *)_aligned_malloc(size, 32);
  255|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  256|       |  /* Platform does have an implementation of posix_memalign */
  257|   199k|  res = posix_memalign(&block, 32, size);
  258|       |#else
  259|       |  block = malloc(size);
  260|       |#endif  /* _WIN32 */
  261|       |
  262|   199k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (262:7): [True: 0, False: 199k]
  |  Branch (262:24): [True: 0, False: 199k]
  ------------------
  263|      0|    BLOSC_TRACE_ERROR("Error allocating memory!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|      0|    return NULL;
  265|      0|  }
  266|       |
  267|   199k|  return (uint8_t*)block;
  268|   199k|}
blosc2.c:blosc_d:
 1713|  84.9M|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1714|  84.9M|  blosc2_context* context = thread_context->parent_context;
 1715|  84.9M|  uint8_t* filters = context->filters;
 1716|  84.9M|  uint8_t *tmp3 = thread_context->tmp4;
 1717|  84.9M|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1718|  84.9M|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1719|  84.9M|  int dont_split = (context->header_flags & 0x10) >> 4;
 1720|  84.9M|  int32_t chunk_nbytes;
 1721|  84.9M|  int32_t chunk_cbytes;
 1722|  84.9M|  int nstreams;
 1723|  84.9M|  int32_t neblock;
 1724|  84.9M|  int32_t nbytes;                /* number of decompressed bytes in split */
 1725|  84.9M|  int32_t cbytes;                /* number of compressed bytes in split */
 1726|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1727|  84.9M|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1728|  84.9M|  uint8_t* _dest;
 1729|  84.9M|  int32_t typesize = context->typesize;
 1730|  84.9M|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1731|  84.9M|  const char* compname;
 1732|  84.9M|  int rc;
 1733|       |
 1734|  84.9M|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1734:7): [True: 0, False: 84.9M]
  |  Branch (1734:41): [True: 0, False: 0]
  ------------------
 1735|       |    // Do not decompress, but act as if we successfully decompressed everything
 1736|      0|    return bsize;
 1737|      0|  }
 1738|       |
 1739|  84.9M|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1740|  84.9M|  if (rc < 0) {
  ------------------
  |  Branch (1740:7): [True: 0, False: 84.9M]
  ------------------
 1741|      0|    return rc;
 1742|      0|  }
 1743|  84.9M|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1743:7): [True: 50.0M, False: 34.8M]
  ------------------
 1744|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1745|  50.0M|    typesize = chunk_cbytes - context->header_overhead;
 1746|  50.0M|  }
 1747|       |
 1748|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1749|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1750|  84.9M|  if (context->src == NULL) {
  ------------------
  |  Branch (1750:7): [True: 0, False: 84.9M]
  ------------------
 1751|      0|    context->src = src;
 1752|      0|  }
 1753|       |
 1754|       |  // Chunks with special values cannot be lazy
 1755|  84.9M|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1755:19): [True: 84.9M, False: 1.17k]
  ------------------
 1756|  84.9M|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1756:11): [True: 18.1M, False: 66.7M]
  |  Branch (1756:46): [True: 15, False: 18.1M]
  ------------------
 1757|  84.9M|  if (is_lazy) {
  ------------------
  |  Branch (1757:7): [True: 15, False: 84.9M]
  ------------------
 1758|       |    // The chunk is on disk, so just lazily load the block
 1759|     15|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1759:9): [True: 10, False: 5]
  ------------------
 1760|     10|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1761|     10|      return BLOSC2_ERROR_INVALID_PARAM;
 1762|     10|    }
 1763|      5|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1763:9): [True: 0, False: 5]
  ------------------
 1764|      0|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1765|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1766|      0|    }
 1767|      5|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1768|      5|    size_t bstarts_nbytes;
 1769|      5|    size_t trailer_offset;
 1770|      5|    size_t block_csizes_nbytes;
 1771|      5|    size_t trailer_meta_nbytes;
 1772|      5|    size_t lazy_trailer_end;
 1773|      5|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1773:9): [True: 0, False: 5]
  |  Branch (1773:24): [True: 0, False: 5]
  ------------------
 1774|      5|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1774:9): [True: 0, False: 5]
  ------------------
 1775|      5|        !checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1775:9): [True: 0, False: 5]
  ------------------
 1776|      5|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1776:9): [True: 0, False: 5]
  ------------------
 1777|      5|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1777:9): [True: 0, False: 5]
  ------------------
 1778|      5|        !checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1778:9): [True: 0, False: 5]
  ------------------
 1779|      5|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1779:9): [True: 1, False: 4]
  ------------------
 1780|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1781|      1|      return BLOSC2_ERROR_READ_BUFFER;
 1782|      1|    }
 1783|      4|    int32_t nchunk;
 1784|      4|    int64_t chunk_offset;
 1785|       |    // The nchunk and the offset of the current chunk are in the trailer
 1786|      4|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1787|      4|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1788|       |    // Get the csize of the nblock
 1789|      4|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1789:9): [True: 0, False: 4]
  |  Branch (1789:23): [True: 0, False: 4]
  ------------------
 1790|      0|      BLOSC_TRACE_ERROR("Invalid block index in lazy trailer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1791|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1792|      0|    }
 1793|      4|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1794|      4|    int32_t block_csize = block_csizes[nblock];
 1795|      4|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1796|      4|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1796:9): [True: 0, False: 4]
  |  Branch (1796:29): [True: 4, False: 0]
  ------------------
 1797|      4|      BLOSC_TRACE_ERROR("Invalid lazy block size in trailer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1798|      4|      return BLOSC2_ERROR_INVALID_HEADER;
 1799|      4|    }
 1800|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1800:9): [True: 0, False: 0]
  |  Branch (1800:21): [True: 0, False: 0]
  ------------------
 1801|      0|      BLOSC_TRACE_ERROR("Lazy VL block compressed size is too small.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1802|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1803|      0|    }
 1804|       |    // Read the lazy block on disk
 1805|      0|    void* fp = NULL;
 1806|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1807|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1807:9): [True: 0, False: 0]
  ------------------
 1808|      0|      BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1809|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1810|      0|    }
 1811|       |
 1812|      0|    int64_t io_pos = 0;
 1813|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1813:9): [True: 0, False: 0]
  ------------------
 1814|       |      // The chunk is not in the frame
 1815|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1816|      0|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1817|       |      // The offset of the block is src_offset
 1818|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1818:11): [True: 0, False: 0]
  ------------------
 1819|      0|        frame_reader_release(frame, io_cb, fp);
 1820|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1821|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1822|      0|      }
 1823|      0|      io_pos = src_offset;
 1824|      0|    }
 1825|      0|    else {
 1826|      0|      fp = frame_reader_acquire(frame, context->schunk->storage->io);
 1827|      0|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1828|       |      // The offset of the block is src_offset
 1829|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1829:11): [True: 0, False: 0]
  ------------------
 1830|      0|        frame_reader_release(frame, io_cb, fp);
 1831|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1832|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1833|      0|      }
 1834|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1834:11): [True: 0, False: 0]
  ------------------
 1835|      0|        frame_reader_release(frame, io_cb, fp);
 1836|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1837|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1838|      0|      }
 1839|      0|      if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (1839:11): [True: 0, False: 0]
  ------------------
 1840|      0|        frame_reader_release(frame, io_cb, fp);
 1841|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1842|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1843|      0|      }
 1844|      0|      io_pos = frame->file_offset + chunk_offset;
 1845|      0|      if (io_pos > INT64_MAX - src_offset) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 0]
  ------------------
 1846|      0|        frame_reader_release(frame, io_cb, fp);
 1847|      0|        BLOSC_TRACE_ERROR("Lazy block offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1848|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1849|      0|      }
 1850|      0|      io_pos += src_offset;
 1851|      0|    }
 1852|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1853|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1854|      0|    frame_reader_release(frame, io_cb, fp);
 1855|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 0]
  ------------------
 1856|      0|      BLOSC_TRACE_ERROR("Cannot read the (lazy) block out of the fileframe.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1858|      0|    }
 1859|      0|    src = tmp3;
 1860|      0|    src_offset = 0;
 1861|      0|    srcsize = block_csize;
 1862|      0|  }
 1863|       |
 1864|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1865|  84.9M|  if (memcpyed) {
  ------------------
  |  Branch (1865:7): [True: 84.7M, False: 133k]
  ------------------
 1866|  84.7M|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1866:18): [True: 4.34k, False: 84.7M]
  ------------------
 1867|  84.7M|    if (!context->special_type) {
  ------------------
  |  Branch (1867:9): [True: 589, False: 84.7M]
  ------------------
 1868|    589|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1868:11): [True: 0, False: 589]
  ------------------
 1869|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1870|      0|      }
 1871|    589|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1871:11): [True: 0, False: 589]
  ------------------
 1872|       |        /* Not enough input to copy block */
 1873|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1874|      0|      }
 1875|    589|    }
 1876|  84.7M|    if (!is_lazy) {
  ------------------
  |  Branch (1876:9): [True: 84.7M, False: 0]
  ------------------
 1877|  84.7M|      src += context->header_overhead + nblock * context->blocksize;
 1878|  84.7M|    }
 1879|  84.7M|    _dest = dest + dest_offset;
 1880|  84.7M|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1880:9): [True: 0, False: 84.7M]
  ------------------
 1881|       |      // We are making use of a postfilter, so use a temp for destination
 1882|      0|      _dest = tmp;
 1883|      0|    }
 1884|  84.7M|    rc = 0;
 1885|  84.7M|    switch (context->special_type) {
 1886|  50.0M|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1886:7): [True: 50.0M, False: 34.7M]
  ------------------
 1887|       |        // All repeated values
 1888|  50.0M|        rc = set_values(typesize, context->src, _dest, bsize_);
 1889|  50.0M|        if (rc < 0) {
  ------------------
  |  Branch (1889:13): [True: 12, False: 50.0M]
  ------------------
 1890|     12|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1891|     12|          return BLOSC2_ERROR_DATA;
 1892|     12|        }
 1893|  50.0M|        break;
 1894|  50.0M|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1894:7): [True: 15.0M, False: 69.7M]
  ------------------
 1895|  15.0M|        rc = set_nans(context->typesize, _dest, bsize_);
 1896|  15.0M|        if (rc < 0) {
  ------------------
  |  Branch (1896:13): [True: 21, False: 15.0M]
  ------------------
 1897|     21|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   93|     21|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     21|    do {                                            \
  |  |  |  |   98|     21|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     21|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     21|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1898|     21|          return BLOSC2_ERROR_DATA;
 1899|     21|        }
 1900|  15.0M|        break;
 1901|  19.6M|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1901:7): [True: 19.6M, False: 65.0M]
  ------------------
 1902|  19.6M|        memset(_dest, 0, bsize_);
 1903|  19.6M|        break;
 1904|  6.42k|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1904:7): [True: 6.42k, False: 84.7M]
  ------------------
 1905|       |        // We do nothing here
 1906|  6.42k|        break;
 1907|    589|      default:
  ------------------
  |  Branch (1907:7): [True: 589, False: 84.7M]
  ------------------
 1908|    589|        memcpy(_dest, src, bsize_);
 1909|  84.7M|    }
 1910|  84.7M|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1910:9): [True: 0, False: 84.7M]
  ------------------
 1911|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1912|      0|      blosc2_postfilter_params postparams;
 1913|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1914|      0|      postparams.input = tmp;
 1915|      0|      postparams.output = dest + dest_offset;
 1916|      0|      postparams.size = bsize;
 1917|      0|      postparams.typesize = typesize;
 1918|      0|      postparams.offset = nblock * context->blocksize;
 1919|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1919:27): [True: 0, False: 0]
  ------------------
 1920|      0|      postparams.nblock = nblock;
 1921|      0|      postparams.tid = thread_context->tid;
 1922|      0|      postparams.ttmp = thread_context->tmp;
 1923|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1924|      0|      postparams.ctx = context;
 1925|       |
 1926|       |      // Execute the postfilter (the processed block will be copied to dest)
 1927|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1927:11): [True: 0, False: 0]
  ------------------
 1928|      0|        BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1929|      0|        return BLOSC2_ERROR_POSTFILTER;
 1930|      0|      }
 1931|      0|    }
 1932|  84.7M|    thread_context->zfp_cell_nitems = 0;
 1933|       |
 1934|  84.7M|    return bsize_;
 1935|  84.7M|  }
 1936|       |
 1937|   133k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1937:7): [True: 133k, False: 0]
  |  Branch (1937:20): [True: 58, False: 133k]
  |  Branch (1937:39): [True: 125, False: 132k]
  ------------------
 1938|       |    /* Invalid block src offset encountered */
 1939|    183|    return BLOSC2_ERROR_DATA;
 1940|    183|  }
 1941|       |
 1942|   132k|  src += src_offset;
 1943|   132k|  if (vlblocks) {
  ------------------
  |  Branch (1943:7): [True: 4, False: 132k]
  ------------------
 1944|      4|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1944:9): [True: 0, False: 4]
  |  Branch (1944:41): [True: 0, False: 4]
  ------------------
 1945|      4|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1945:9): [True: 1, False: 3]
  ------------------
 1946|      3|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1946:9): [True: 0, False: 3]
  ------------------
 1947|      1|      return BLOSC2_ERROR_DATA;
 1948|      1|    }
 1949|      3|    srcsize = context->blockcbytes[nblock];
 1950|      3|  }
 1951|   132k|  else {
 1952|   132k|    srcsize -= src_offset;
 1953|   132k|  }
 1954|       |
 1955|   132k|  int last_filter_index = last_filter(filters, 'd');
 1956|   132k|  if (instr_codec) {
  ------------------
  |  Branch (1956:7): [True: 1.45k, False: 131k]
  ------------------
 1957|       |    // If instrumented, we don't want to run the filters
 1958|  1.45k|    _dest = dest + dest_offset;
 1959|  1.45k|  }
 1960|   131k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1960:13): [True: 125k, False: 5.75k]
  ------------------
 1961|   125k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1961:8): [True: 98.7k, False: 27.0k]
  ------------------
 1962|  98.7k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1962:5): [True: 0, False: 32.7k]
  ------------------
 1963|       |    // We are making use of some filter, so use a temp for destination
 1964|  98.7k|    _dest = tmp;
 1965|  98.7k|  }
 1966|  32.7k|  else {
 1967|       |    // If no filters, or only DELTA in pipeline
 1968|  32.7k|    _dest = dest + dest_offset;
 1969|  32.7k|  }
 1970|       |
 1971|       |  /* The number of compressed data streams for this block */
 1972|   132k|  if (vlblocks) {
  ------------------
  |  Branch (1972:7): [True: 3, False: 132k]
  ------------------
 1973|      3|    nstreams = 1;
 1974|      3|  }
 1975|   132k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1975:12): [True: 1.50k, False: 131k]
  |  Branch (1975:27): [True: 1.49k, False: 19]
  ------------------
 1976|  1.49k|    nstreams = context->typesize;
 1977|  1.49k|  }
 1978|   131k|  else {
 1979|   131k|    nstreams = 1;
 1980|   131k|  }
 1981|       |
 1982|   132k|  neblock = bsize / nstreams;
 1983|   132k|  if (neblock == 0) {
  ------------------
  |  Branch (1983:7): [True: 1, False: 132k]
  ------------------
 1984|       |    /* Not enough space to output bytes */
 1985|      1|    BLOSC_ERROR(BLOSC2_ERROR_WRITE_BUFFER);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1986|      1|  }
 1987|   256k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (1987:19): [True: 133k, False: 123k]
  ------------------
 1988|   133k|    if (vlblocks) {
  ------------------
  |  Branch (1988:9): [True: 3, False: 133k]
  ------------------
 1989|      3|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1989:11): [True: 0, False: 3]
  ------------------
 1990|       |        /* Not enough input to read compressed bytes */
 1991|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1992|      0|      }
 1993|      3|      neblock = sw32_(src);
 1994|      3|      if (neblock != bsize) {
  ------------------
  |  Branch (1994:11): [True: 0, False: 3]
  ------------------
 1995|      0|        return BLOSC2_ERROR_DATA;
 1996|      0|      }
 1997|      3|      src += sizeof(int32_t);
 1998|      3|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 1999|      3|      srcsize = 0;
 2000|      3|    }
 2001|   133k|    else {
 2002|   133k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2002:11): [True: 3, False: 133k]
  ------------------
 2003|       |        /* Not enough input to read compressed size */
 2004|      3|        return BLOSC2_ERROR_READ_BUFFER;
 2005|      3|      }
 2006|   133k|      srcsize -= sizeof(int32_t);
 2007|   133k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2008|   133k|      if (cbytes > 0) {
  ------------------
  |  Branch (2008:11): [True: 10.7k, False: 122k]
  ------------------
 2009|  10.7k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2009:13): [True: 29, False: 10.7k]
  ------------------
 2010|       |          /* Not enough input to read compressed bytes */
 2011|     29|          return BLOSC2_ERROR_READ_BUFFER;
 2012|     29|        }
 2013|  10.7k|        srcsize -= cbytes;
 2014|  10.7k|      }
 2015|   133k|      src += sizeof(int32_t);
 2016|   133k|    }
 2017|       |    // ctbytes += (signed)sizeof(int32_t);
 2018|       |
 2019|       |    /* Uncompress */
 2020|   133k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2020:9): [True: 133k, False: 3]
  |  Branch (2020:22): [True: 87.5k, False: 45.6k]
  ------------------
 2021|       |      // A run of 0's
 2022|  87.5k|      memset(_dest, 0, (unsigned int)neblock);
 2023|  87.5k|      nbytes = neblock;
 2024|  87.5k|    }
 2025|  45.6k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2025:14): [True: 45.6k, False: 3]
  |  Branch (2025:27): [True: 34.8k, False: 10.7k]
  ------------------
 2026|       |      // A negative number means some encoding depending on the token that comes next
 2027|  34.8k|      uint8_t token;
 2028|       |
 2029|  34.8k|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2029:11): [True: 2, False: 34.8k]
  ------------------
 2030|       |        // Not enough input to read token */
 2031|      2|        return BLOSC2_ERROR_READ_BUFFER;
 2032|      2|      }
 2033|  34.8k|      srcsize -= sizeof(uint8_t);
 2034|       |
 2035|  34.8k|      token = src[0];
 2036|  34.8k|      src += 1;
 2037|       |      // ctbytes += 1;
 2038|       |
 2039|  34.8k|      if (token & 0x1) {
  ------------------
  |  Branch (2039:11): [True: 34.8k, False: 8]
  ------------------
 2040|       |        // A run of bytes that are different than 0
 2041|  34.8k|        if (cbytes < -255) {
  ------------------
  |  Branch (2041:13): [True: 29, False: 34.8k]
  ------------------
 2042|       |          // Runs can only encode a byte
 2043|     29|          return BLOSC2_ERROR_RUN_LENGTH;
 2044|     29|        }
 2045|  34.8k|        uint8_t value = -cbytes;
 2046|  34.8k|        memset(_dest, value, (unsigned int)neblock);
 2047|  34.8k|      } else {
 2048|      8|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2049|      8|        return BLOSC2_ERROR_RUN_LENGTH;
 2050|      8|      }
 2051|  34.8k|      nbytes = neblock;
 2052|  34.8k|      cbytes = 0;  // everything is encoded in the cbytes token
 2053|  34.8k|    }
 2054|  10.7k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2054:14): [True: 1.30k, False: 9.44k]
  ------------------
 2055|  1.30k|      memcpy(_dest, src, (unsigned int)neblock);
 2056|  1.30k|      nbytes = (int32_t)neblock;
 2057|  1.30k|    }
 2058|  9.44k|    else {
 2059|  9.44k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2059:11): [True: 232, False: 9.21k]
  ------------------
 2060|    232|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2061|    232|      }
 2062|  9.21k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2062:16): [True: 748, False: 8.46k]
  ------------------
 2063|    748|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2064|    748|                                     (char*)_dest, (size_t)neblock,
 2065|    748|                                     thread_context);
 2066|    748|      }
 2067|  8.46k|  #if defined(HAVE_ZLIB)
 2068|  8.46k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2068:16): [True: 686, False: 7.77k]
  ------------------
 2069|    686|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2070|    686|                                      (char*)_dest, (size_t)neblock);
 2071|    686|      }
 2072|  7.77k|  #endif /*  HAVE_ZLIB */
 2073|  7.77k|  #if defined(HAVE_ZSTD)
 2074|  7.77k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2074:16): [True: 7.22k, False: 549]
  ------------------
 2075|  7.22k|        nbytes = zstd_wrap_decompress(thread_context,
 2076|  7.22k|                                      (char*)src, (size_t)cbytes,
 2077|  7.22k|                                      (char*)_dest, (size_t)neblock);
 2078|  7.22k|      }
 2079|    549|  #endif /*  HAVE_ZSTD */
 2080|    549|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2080:16): [True: 546, False: 3]
  ------------------
 2081|    546|        bool getcell = false;
 2082|       |
 2083|    546|#if defined(HAVE_ZFP)
 2084|    546|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2084:13): [True: 1, False: 545]
  ------------------
 2085|      1|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2085:13): [True: 0, False: 1]
  ------------------
 2086|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2087|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2087:15): [True: 0, False: 0]
  ------------------
 2088|      0|            return BLOSC2_ERROR_DATA;
 2089|      0|          }
 2090|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2090:15): [True: 0, False: 0]
  ------------------
 2091|      0|            getcell = true;
 2092|      0|          }
 2093|      0|        }
 2094|    546|#endif /* HAVE_ZFP */
 2095|    546|        if (!getcell) {
  ------------------
  |  Branch (2095:13): [True: 546, False: 0]
  ------------------
 2096|    546|          thread_context->zfp_cell_nitems = 0;
 2097|    672|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2097:27): [True: 662, False: 10]
  ------------------
 2098|    662|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2098:17): [True: 536, False: 126]
  ------------------
 2099|    536|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2099:19): [True: 5, False: 531]
  ------------------
 2100|       |                // Dynamically load codec plugin
 2101|      5|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2101:21): [True: 5, False: 0]
  ------------------
 2102|      5|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2103|      5|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2104|      5|                }
 2105|      5|              }
 2106|    531|              blosc2_dparams dparams;
 2107|    531|              blosc2_ctx_get_dparams(context, &dparams);
 2108|    531|              nbytes = g_codecs[i].decoder(src,
 2109|    531|                                           cbytes,
 2110|    531|                                           _dest,
 2111|    531|                                           neblock,
 2112|    531|                                           context->compcode_meta,
 2113|    531|                                           &dparams,
 2114|    531|                                           context->src);
 2115|    531|              goto urcodecsuccess;
 2116|    536|            }
 2117|    662|          }
 2118|     10|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2119|     10|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2120|    546|        }
 2121|    531|      urcodecsuccess:
 2122|    531|        ;
 2123|    531|      }
 2124|      3|      else {
 2125|      3|        compname = clibcode_to_clibname(compformat);
 2126|      3|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2127|      3|                "Blosc has not been compiled with decompression "
 2128|      3|                "support for '%s' format.  "
 2129|      3|                "Please recompile for adding this support.", compname);
 2130|      3|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2131|      3|      }
 2132|       |
 2133|       |      /* Check that decompressed bytes number is correct */
 2134|  9.42k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2134:11): [True: 9.09k, False: 327]
  |  Branch (2134:34): [True: 9.09k, False: 0]
  ------------------
 2135|  9.09k|        return BLOSC2_ERROR_DATA;
 2136|  9.09k|      }
 2137|       |
 2138|  9.42k|    }
 2139|   123k|    src += cbytes;
 2140|       |    // ctbytes += cbytes;
 2141|   123k|    _dest += nbytes;
 2142|   123k|    ntbytes += nbytes;
 2143|   123k|  } /* Closes j < nstreams */
 2144|       |
 2145|   123k|  if (!instr_codec) {
  ------------------
  |  Branch (2145:7): [True: 123k, False: 18]
  ------------------
 2146|   123k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2146:9): [True: 118k, False: 5.66k]
  |  Branch (2146:35): [True: 0, False: 5.66k]
  ------------------
 2147|       |      /* Apply regular filter pipeline */
 2148|   118k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2149|   118k|                                      last_filter_index, nblock);
 2150|   118k|      if (errcode < 0)
  ------------------
  |  Branch (2150:11): [True: 245, False: 117k]
  ------------------
 2151|    245|        return errcode;
 2152|   118k|    }
 2153|   123k|  }
 2154|       |
 2155|       |  /* Return the number of uncompressed bytes */
 2156|   123k|  return (int)ntbytes;
 2157|   123k|}
blosc2.c:lz4_wrap_decompress:
  501|    748|                               struct thread_context* thread_context) {
  502|    748|  int nbytes;
  503|    748|  blosc2_context* context = thread_context->parent_context;
  504|    748|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (504:7): [True: 358, False: 390]
  |  Branch (504:28): [True: 358, False: 0]
  |  Branch (504:60): [True: 358, False: 0]
  ------------------
  505|    358|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  506|    358|                                           (int)compressed_length, (int)maxout,
  507|    358|                                           (const char*)context->dict_buffer,
  508|    358|                                           (int)context->dict_size);
  509|    390|  } else {
  510|    390|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  511|    390|  }
  512|    748|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (512:7): [True: 653, False: 95]
  ------------------
  513|    653|    return 0;
  514|    653|  }
  515|     95|  return (int)maxout;
  516|    748|}
blosc2.c:zlib_wrap_decompress:
  540|    686|                                char* output, size_t maxout) {
  541|    686|  int status;
  542|    686|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  543|    686|  size_t ul = maxout;
  544|    686|  status = zng_uncompress(
  545|    686|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  546|       |#else
  547|       |  uLongf ul = (uLongf)maxout;
  548|       |  status = uncompress(
  549|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  550|       |#endif
  551|    686|  if (status != Z_OK) {
  ------------------
  |  |  180|    686|#define Z_OK            0
  ------------------
  |  Branch (551:7): [True: 619, False: 67]
  ------------------
  552|    619|    return 0;
  553|    619|  }
  554|     67|  return (int)ul;
  555|    686|}
blosc2.c:zstd_wrap_decompress:
  592|  7.22k|                                char* output, size_t maxout) {
  593|  7.22k|  size_t code;
  594|  7.22k|  blosc2_context* context = thread_context->parent_context;
  595|       |
  596|  7.22k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (596:7): [True: 7.15k, False: 68]
  ------------------
  597|  7.15k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  598|  7.15k|  }
  599|       |
  600|  7.22k|  if (context->use_dict) {
  ------------------
  |  Branch (600:7): [True: 2.49k, False: 4.73k]
  ------------------
  601|  2.49k|    assert(context->dict_ddict != NULL);
  602|  2.49k|    code = ZSTD_decompress_usingDDict(
  603|  2.49k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  604|  2.49k|            compressed_length, context->dict_ddict);
  605|  4.73k|  } else {
  606|  4.73k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  607|  4.73k|        (void*)output, maxout, (void*)input, compressed_length);
  608|  4.73k|  }
  609|  7.22k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (609:7): [True: 7.09k, False: 131]
  ------------------
  610|  7.09k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  7.09k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  7.09k|    do {                                            \
  |  |  |  |   98|  7.09k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  7.09k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7.09k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  7.09k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  611|  7.09k|                      ZDICT_getErrorName(code));
  612|  7.09k|    return 0;
  613|  7.09k|  }
  614|    131|  return (int)code;
  615|  7.22k|}
blosc2.c:getitem_read_header:
 4505|  56.5k|static int getitem_read_header(const void* src, int32_t srcsize, blosc_header* header) {
 4506|  56.5k|  int result = read_chunk_header((uint8_t *) src, srcsize, true, header);
 4507|  56.5k|  if (result < 0) {
  ------------------
  |  Branch (4507:7): [True: 0, False: 56.5k]
  ------------------
 4508|      0|    return result;
 4509|      0|  }
 4510|  56.5k|  if (header->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (4510:7): [True: 0, False: 56.5k]
  ------------------
 4511|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4512|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4513|      0|  }
 4514|  56.5k|  return 0;
 4515|  56.5k|}
blosc2.c:getitem_with_header:
 4521|  56.5k|                               int start, int nitems, void* dest, int32_t destsize) {
 4522|       |  /* Minimally populate the context */
 4523|  56.5k|  context->src = src;
 4524|  56.5k|  context->srcsize = srcsize;
 4525|  56.5k|  context->dest = dest;
 4526|  56.5k|  context->destsize = destsize;
 4527|       |
 4528|  56.5k|  int result = blosc2_initialize_context_from_header(context, header);
 4529|  56.5k|  if (result < 0) {
  ------------------
  |  Branch (4529:7): [True: 0, False: 56.5k]
  ------------------
 4530|      0|    return result;
 4531|      0|  }
 4532|       |
 4533|  56.5k|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (4533:7): [True: 56.5k, False: 0]
  ------------------
 4534|  56.5k|    context->serial_context = create_thread_context(context, 0);
 4535|  56.5k|  }
 4536|  56.5k|  BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  56.5k|    do {                                            \
  |  |  105|  56.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 56.5k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  56.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 56.5k]
  |  |  ------------------
  ------------------
 4537|       |  /* Call the actual getitem function */
 4538|  56.5k|  return _blosc_getitem(context, header, src, srcsize, start, nitems, dest, destsize);
 4539|  56.5k|}
blosc2.c:blosc2_initialize_context_from_header:
  862|   123k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  863|   123k|  context->header_flags = header->flags;
  864|   123k|  context->typesize = header->typesize;
  865|   123k|  context->sourcesize = header->nbytes;
  866|   123k|  context->header_blocksize = header->blocksize;
  867|   123k|  context->blocksize = header->blocksize;
  868|   123k|  context->blosc2_flags2 = header->blosc2_flags2;
  869|   123k|  context->blosc2_flags = header->blosc2_flags;
  870|   123k|  context->compcode = header->flags >> 5;
  871|   123k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (871:7): [True: 83.6k, False: 39.6k]
  ------------------
  872|  83.6k|    context->compcode = header->udcompcode;
  873|  83.6k|  }
  874|   123k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (874:7): [True: 309, False: 122k]
  ------------------
  875|    309|    context->nblocks = header->blocksize;
  876|    309|    context->leftover = 0;
  877|    309|    context->blocksize = 0;
  878|    309|  }
  879|   122k|  else {
  880|   122k|    blosc2_calculate_blocks(context);
  881|   122k|  }
  882|       |
  883|   123k|  bool is_lazy = false;
  884|   123k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (884:7): [True: 122k, False: 741]
  ------------------
  885|   122k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (885:7): [True: 122k, False: 470]
  ------------------
  886|       |    /* Extended header */
  887|   122k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  888|       |
  889|   122k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  890|   122k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  891|   122k|    context->compcode_meta = header->compcode_meta;
  892|       |
  893|   122k|    context->filter_flags = filters_to_flags(header->filters);
  894|   122k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  895|       |
  896|   122k|    is_lazy = (context->blosc2_flags & 0x08u);
  897|   122k|  }
  898|  1.21k|  else {
  899|  1.21k|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  900|  1.21k|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  901|  1.21k|    flags_to_filters(context->header_flags, context->filters);
  902|  1.21k|  }
  903|       |
  904|       |  // Some checks for malformed headers
  905|   123k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (905:7): [True: 121k, False: 2.00k]
  |  Branch (905:19): [True: 0, False: 121k]
  ------------------
  906|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  907|      0|  }
  908|       |
  909|   123k|  return 0;
  910|   123k|}
blosc2.c:get_filter_flags:
  702|  1.21k|                                const int32_t typesize) {
  703|  1.21k|  uint8_t flags = 0;
  704|       |
  705|  1.21k|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (705:7): [True: 470, False: 741]
  |  Branch (705:43): [True: 436, False: 34]
  ------------------
  706|    436|    flags |= BLOSC_DOSHUFFLE;
  707|    436|  }
  708|  1.21k|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (708:7): [True: 352, False: 859]
  ------------------
  709|    352|    flags |= BLOSC_DOBITSHUFFLE;
  710|    352|  }
  711|  1.21k|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (711:7): [True: 472, False: 739]
  ------------------
  712|    472|    flags |= BLOSC_DODELTA;
  713|    472|  }
  714|  1.21k|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (714:7): [True: 35, False: 1.17k]
  ------------------
  715|     35|    flags |= BLOSC_MEMCPYED;
  716|     35|  }
  717|  1.21k|  return flags;
  718|  1.21k|}
blosc2.c:clear_context_decompression_dict:
 2550|  66.7k|static void clear_context_decompression_dict(blosc2_context* context) {
 2551|  66.7k|  context->use_dict = 0;
 2552|  66.7k|  release_context_dict_buffer(context);
 2553|  66.7k|#if defined(HAVE_ZSTD)
 2554|  66.7k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2554:7): [True: 4.32k, False: 62.4k]
  ------------------
 2555|  4.32k|    ZSTD_freeDDict(context->dict_ddict);
 2556|  4.32k|    context->dict_ddict = NULL;
 2557|  4.32k|  }
 2558|       |#else
 2559|       |  context->dict_ddict = NULL;
 2560|       |#endif
 2561|  66.7k|}
blosc2.c:checked_mul_size:
  152|  50.2k|static inline bool checked_mul_size(size_t a, size_t b, size_t* out) {
  153|  50.2k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (153:7): [True: 50.2k, False: 22]
  |  Branch (153:17): [True: 0, False: 50.2k]
  ------------------
  154|      0|    return false;
  155|      0|  }
  156|  50.2k|  *out = a * b;
  157|       |  return true;
  158|  50.2k|}
blosc2.c:checked_add_size:
  160|  50.3k|static inline bool checked_add_size(size_t a, size_t b, size_t* out) {
  161|  50.3k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (161:7): [True: 0, False: 50.3k]
  ------------------
  162|      0|    return false;
  163|      0|  }
  164|  50.3k|  *out = a + b;
  165|       |  return true;
  166|  50.3k|}
blosc2.c:create_thread_context:
 2264|  68.5k|create_thread_context(blosc2_context* context, int32_t tid) {
 2265|  68.5k|  struct thread_context* thread_context;
 2266|  68.5k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2267|  68.5k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  68.5k|    do {                                            \
  |  |  105|  68.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 68.5k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  68.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 68.5k]
  |  |  ------------------
  ------------------
 2268|  68.5k|  int rc = init_thread_context(thread_context, context, tid);
 2269|  68.5k|  if (rc < 0) {
  ------------------
  |  Branch (2269:7): [True: 0, False: 68.5k]
  ------------------
 2270|      0|    return NULL;
 2271|      0|  }
 2272|  68.5k|  return thread_context;
 2273|  68.5k|}
blosc2.c:init_thread_context:
 2234|  68.5k|{
 2235|  68.5k|  int32_t ebsize;
 2236|       |
 2237|  68.5k|  thread_context->parent_context = context;
 2238|  68.5k|  thread_context->owner_pool = NULL;
 2239|  68.5k|  thread_context->tid = tid;
 2240|       |
 2241|  68.5k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2241:23): [True: 68.5k, False: 0]
  ------------------
 2242|  68.5k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2242:22): [True: 68.5k, False: 0]
  ------------------
 2243|  68.5k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2244|  68.5k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2245|  68.5k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2246|  68.5k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  68.5k|    do {                                            \
  |  |  105|  68.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 68.5k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  68.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 68.5k]
  |  |  ------------------
  ------------------
 2247|  68.5k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2248|  68.5k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2249|  68.5k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2250|  68.5k|  thread_context->tmp_blocksize = blocksize;
 2251|  68.5k|  thread_context->zfp_cell_nitems = 0;
 2252|  68.5k|  thread_context->zfp_cell_start = 0;
 2253|  68.5k|  #if defined(HAVE_ZSTD)
 2254|  68.5k|  thread_context->zstd_cctx = NULL;
 2255|  68.5k|  thread_context->zstd_dctx = NULL;
 2256|  68.5k|  #endif
 2257|  68.5k|  thread_context->lz4_cstream = NULL;
 2258|  68.5k|  thread_context->lz4hc_cstream = NULL;
 2259|       |
 2260|  68.5k|  return 0;
 2261|  68.5k|}
blosc2.c:release_thread_backend:
 5416|  61.8k|static int release_thread_backend(blosc2_context *context) {
 5417|  61.8k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|   123k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5417:7): [True: 0, False: 61.8k]
  |  Branch (5417:60): [True: 0, False: 0]
  ------------------
 5418|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5418:25): [True: 0, False: 0]
  ------------------
 5419|      0|      destroy_thread_context(context->thread_contexts + t);
 5420|      0|    }
 5421|      0|    my_free(context->thread_contexts);
 5422|      0|    context->thread_contexts = NULL;
 5423|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5424|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5425|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5426|      0|  }
 5427|       |#if defined(_WIN32)
 5428|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5429|       |    /* Signal all workers to exit. */
 5430|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5431|       |    context->end_threads = 1;
 5432|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5433|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5434|       |
 5435|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5436|       |      blosc2_pthread_join(context->threads[t], NULL);
 5437|       |    }
 5438|       |    my_free(context->threads);
 5439|       |    context->threads = NULL;
 5440|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5441|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5442|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5443|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5444|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5445|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5446|       |  }
 5447|       |#endif  /* _WIN32 */
 5448|  61.8k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|   123k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5448:12): [True: 0, False: 61.8k]
  |  Branch (5448:68): [True: 0, False: 0]
  ------------------
 5449|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5450|      0|    struct blosc_shared_pool **prev;
 5451|      0|    bool destroy_pool = false;
 5452|       |
 5453|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5453:9): [True: 0, False: 0]
  ------------------
 5454|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5455|       |       * Just clear the dangling pointer; nothing else to do. */
 5456|      0|      context->thread_pool = NULL;
 5457|      0|      context->threads_started = 0;
 5458|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5459|      0|      return 0;
 5460|      0|    }
 5461|       |
 5462|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5463|      0|    pool->context_refs--;
 5464|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5464:9): [True: 0, False: 0]
  ------------------
 5465|       |      /* Check pool-internal state under the pool's own mutex */
 5466|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5467|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5467:20): [True: 0, False: 0]
  |  Branch (5467:46): [True: 0, False: 0]
  ------------------
 5468|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5469|      0|      if (idle) {
  ------------------
  |  Branch (5469:11): [True: 0, False: 0]
  ------------------
 5470|      0|        prev = &shared_pools;
 5471|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5471:16): [True: 0, False: 0]
  |  Branch (5471:33): [True: 0, False: 0]
  ------------------
 5472|      0|          prev = &(*prev)->next;
 5473|      0|        }
 5474|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5474:13): [True: 0, False: 0]
  ------------------
 5475|      0|          *prev = pool->next;
 5476|      0|        }
 5477|      0|        destroy_pool = true;
 5478|      0|      }
 5479|      0|    }
 5480|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5481|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5481:9): [True: 0, False: 0]
  ------------------
 5482|      0|      destroy_shared_pool(pool);
 5483|      0|    }
 5484|      0|    context->thread_pool = NULL;
 5485|      0|  }
 5486|       |
 5487|  61.8k|  context->threads_started = 0;
 5488|  61.8k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  61.8k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5489|  61.8k|  return 0;
 5490|  61.8k|}
blosc2.c:release_context_dict_buffer:
 2540|   128k|static void release_context_dict_buffer(blosc2_context* context) {
 2541|   128k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2541:7): [True: 0, False: 128k]
  |  Branch (2541:37): [True: 0, False: 0]
  ------------------
 2542|      0|    free(context->dict_buffer);
 2543|      0|  }
 2544|   128k|  context->dict_buffer = NULL;
 2545|       |  context->dict_buffer_owned = false;
 2546|   128k|  context->dict_size = 0;
 2547|   128k|}

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

delta_decoder:
   97|   164k|                   int32_t typesize, uint8_t* dest) {
   98|   164k|  int32_t i;
   99|       |
  100|   164k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 115k, False: 49.6k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|   115k|    switch (typesize) {
  103|  50.8k|      case 1:
  ------------------
  |  Branch (103:7): [True: 50.8k, False: 64.2k]
  ------------------
  104|  7.42G|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 7.42G, False: 50.8k]
  ------------------
  105|  7.42G|          dest[i] ^= dref[i-1];
  106|  7.42G|        }
  107|  50.8k|        break;
  108|    297|      case 2:
  ------------------
  |  Branch (108:7): [True: 297, False: 114k]
  ------------------
  109|   741M|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 741M, False: 297]
  ------------------
  110|   741M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|   741M|        }
  112|    297|        break;
  113|    274|      case 4:
  ------------------
  |  Branch (113:7): [True: 274, False: 114k]
  ------------------
  114|   451M|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 451M, False: 274]
  ------------------
  115|   451M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|   451M|        }
  117|    274|        break;
  118|  12.9k|      case 8:
  ------------------
  |  Branch (118:7): [True: 12.9k, False: 102k]
  ------------------
  119|   996M|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 996M, False: 12.9k]
  ------------------
  120|   996M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   996M|        }
  122|  12.9k|        break;
  123|  50.7k|      default:
  ------------------
  |  Branch (123:7): [True: 50.7k, False: 64.3k]
  ------------------
  124|  50.7k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 146, False: 50.6k]
  ------------------
  125|    146|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|  50.6k|        } else {
  127|  50.6k|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|  50.6k|        }
  129|   115k|    }
  130|   115k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  49.6k|    switch (typesize) {
  133|  21.5k|      case 1:
  ------------------
  |  Branch (133:7): [True: 21.5k, False: 28.0k]
  ------------------
  134|   783M|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 783M, False: 21.5k]
  ------------------
  135|   783M|          dest[i] ^= dref[i];
  136|   783M|        }
  137|  21.5k|        break;
  138|    108|      case 2:
  ------------------
  |  Branch (138:7): [True: 108, False: 49.5k]
  ------------------
  139|  33.7M|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 33.7M, False: 108]
  ------------------
  140|  33.7M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  33.7M|        }
  142|    108|        break;
  143|    101|      case 4:
  ------------------
  |  Branch (143:7): [True: 101, False: 49.5k]
  ------------------
  144|   115M|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 115M, False: 101]
  ------------------
  145|   115M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   115M|        }
  147|    101|        break;
  148|  6.29k|      case 8:
  ------------------
  |  Branch (148:7): [True: 6.29k, False: 43.3k]
  ------------------
  149|   383M|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 383M, False: 6.29k]
  ------------------
  150|   383M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   383M|        }
  152|  6.29k|        break;
  153|  21.5k|      default:
  ------------------
  |  Branch (153:7): [True: 21.5k, False: 28.0k]
  ------------------
  154|  21.5k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 91, False: 21.4k]
  ------------------
  155|     91|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  21.4k|        } else {
  157|  21.4k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  21.4k|        }
  159|  49.6k|    }
  160|  49.6k|  }
  161|   164k|}

fastcopy:
  504|     87|unsigned char *fastcopy(unsigned char *out, const unsigned char *from, unsigned len) {
  505|     87|  switch (len) {
  506|      1|    case 32:
  ------------------
  |  Branch (506:5): [True: 1, False: 86]
  ------------------
  507|      1|      return copy_32_bytes(out, from);
  508|      1|    case 16:
  ------------------
  |  Branch (508:5): [True: 1, False: 86]
  ------------------
  509|      1|      return copy_16_bytes(out, from);
  510|      1|    case 8:
  ------------------
  |  Branch (510:5): [True: 1, False: 86]
  ------------------
  511|      1|      return copy_8_bytes(out, from);
  512|     84|    default: {
  ------------------
  |  Branch (512:5): [True: 84, False: 3]
  ------------------
  513|     84|    }
  514|     87|  }
  515|     84|  if (len < 8) {
  ------------------
  |  Branch (515:7): [True: 28, False: 56]
  ------------------
  516|     28|    return copy_bytes(out, from, len);
  517|     28|  }
  518|     56|#if defined(__SSE2__)
  519|     56|  if (len < 16) {
  ------------------
  |  Branch (519:7): [True: 1, False: 55]
  ------------------
  520|      1|    return chunk_memcpy(out, from, len);
  521|      1|  }
  522|     55|#if !defined(__AVX2__)
  523|     55|  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|     56|}
copy_match:
  537|  1.38k|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.38k|  unsigned overlap_dist = (unsigned) (out - from);
  556|  1.38k|  if (overlap_dist > sz) {
  ------------------
  |  Branch (556:7): [True: 87, False: 1.29k]
  ------------------
  557|     87|    return fastcopy(out, from, len);
  558|     87|  }
  559|       |
  560|       |  // Otherwise we need to be more careful so as not to overwrite destination
  561|  1.29k|  switch (overlap_dist) {
  562|      0|    case 32:
  ------------------
  |  Branch (562:5): [True: 0, False: 1.29k]
  ------------------
  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.29k]
  ------------------
  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.29k]
  ------------------
  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.29k]
  ------------------
  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.29k]
  ------------------
  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.29k]
  ------------------
  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.29k]
  ------------------
  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.29k]
  ------------------
  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|      3|    case 16:
  ------------------
  |  Branch (614:5): [True: 3, False: 1.29k]
  ------------------
  615|    293|      for (; len >= 16; len -= 16) {
  ------------------
  |  Branch (615:14): [True: 290, False: 3]
  ------------------
  616|    290|        out = copy_16_bytes(out, from);
  617|    290|      }
  618|      3|      break;
  619|      4|    case 8:
  ------------------
  |  Branch (619:5): [True: 4, False: 1.29k]
  ------------------
  620|  2.19k|      for (; len >= 8; len -= 8) {
  ------------------
  |  Branch (620:14): [True: 2.19k, False: 4]
  ------------------
  621|  2.19k|        out = copy_8_bytes(out, from);
  622|  2.19k|      }
  623|      4|      break;
  624|    405|    case 4:
  ------------------
  |  Branch (624:5): [True: 405, False: 890]
  ------------------
  625|   132k|      for (; len >= 4; len -= 4) {
  ------------------
  |  Branch (625:14): [True: 132k, False: 405]
  ------------------
  626|   132k|        out = copy_4_bytes(out, from);
  627|   132k|      }
  628|    405|      break;
  629|    559|    case 2:
  ------------------
  |  Branch (629:5): [True: 559, False: 736]
  ------------------
  630|   110k|      for (; len >= 2; len -= 2) {
  ------------------
  |  Branch (630:14): [True: 110k, False: 559]
  ------------------
  631|   110k|        out = copy_2_bytes(out, from);
  632|   110k|      }
  633|    559|      break;
  634|    324|    default:
  ------------------
  |  Branch (634:5): [True: 324, False: 971]
  ------------------
  635|   178k|      for (; len > 0; len--) {
  ------------------
  |  Branch (635:14): [True: 178k, False: 324]
  ------------------
  636|   178k|        *out++ = *from++;
  637|   178k|      }
  638|  1.29k|  }
  639|       |
  640|       |  // Copy the leftovers
  641|  2.09k|  for (; len > 0; len--) {
  ------------------
  |  Branch (641:10): [True: 802, False: 1.29k]
  ------------------
  642|    802|    *out++ = *from++;
  643|    802|  }
  644|       |
  645|  1.29k|  return out;
  646|  1.29k|}
fastcopy.c:copy_32_bytes:
  118|      1|static inline unsigned char *copy_32_bytes(unsigned char *out, const unsigned char *from) {
  119|       |#if defined(__AVX2__)
  120|       |  __m256i chunk;
  121|       |  chunk = _mm256_loadu_si256((__m256i*)from);
  122|       |  _mm256_storeu_si256((__m256i*)out, chunk);
  123|       |  out += 32;
  124|       |#elif defined(__SSE2__)
  125|       |  __m128i chunk;
  126|      1|  chunk = _mm_loadu_si128((__m128i*)from);
  127|      1|  _mm_storeu_si128((__m128i*)out, chunk);
  128|      1|  from += 16; out += 16;
  129|      1|  chunk = _mm_loadu_si128((__m128i*)from);
  130|      1|  _mm_storeu_si128((__m128i*)out, chunk);
  131|      1|  out += 16;
  132|       |#elif !defined(BLOSC_STRICT_ALIGN)
  133|       |  *(uint64_t*)out = *(uint64_t*)from;
  134|       |  from += 8; out += 8;
  135|       |  *(uint64_t*)out = *(uint64_t*)from;
  136|       |  from += 8; out += 8;
  137|       |  *(uint64_t*)out = *(uint64_t*)from;
  138|       |  from += 8; out += 8;
  139|       |  *(uint64_t*)out = *(uint64_t*)from;
  140|       |  from += 8; out += 8;
  141|       |#else
  142|       |  int i;
  143|       |  for (i = 0; i < 32; i++) {
  144|       |    *out++ = *from++;
  145|       |  }
  146|       |#endif
  147|      1|  return out;
  148|      1|}
fastcopy.c:copy_16_bytes:
   98|  93.8k|static inline unsigned char *copy_16_bytes(unsigned char *out, const unsigned char *from) {
   99|  93.8k|#if defined(__SSE2__)
  100|  93.8k|  __m128i chunk;
  101|  93.8k|  chunk = _mm_loadu_si128((__m128i*)from);
  102|  93.8k|  _mm_storeu_si128((__m128i*)out, chunk);
  103|  93.8k|  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|  93.8k|  return out;
  116|  93.8k|}
fastcopy.c:copy_8_bytes:
   86|  2.19k|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|  2.19k|  *(uint64_t *) out = *(uint64_t *) from;
   93|  2.19k|#endif
   94|  2.19k|  return out + 8;
   95|  2.19k|}
fastcopy.c:copy_bytes:
  161|     28|static inline unsigned char *copy_bytes(unsigned char *out, const unsigned char *from, unsigned len) {
  162|     28|  assert(len < 8);
  163|       |
  164|       |#ifdef BLOSC_STRICT_ALIGN
  165|       |  while (len--) {
  166|       |    *out++ = *from++;
  167|       |  }
  168|       |#else
  169|     28|  switch (len) {
  170|      3|    case 7:
  ------------------
  |  Branch (170:5): [True: 3, False: 25]
  ------------------
  171|      3|      return copy_7_bytes(out, from);
  172|      6|    case 6:
  ------------------
  |  Branch (172:5): [True: 6, False: 22]
  ------------------
  173|      6|      return copy_6_bytes(out, from);
  174|      5|    case 5:
  ------------------
  |  Branch (174:5): [True: 5, False: 23]
  ------------------
  175|      5|      return copy_5_bytes(out, from);
  176|      3|    case 4:
  ------------------
  |  Branch (176:5): [True: 3, False: 25]
  ------------------
  177|      3|      return copy_4_bytes(out, from);
  178|     11|    case 3:
  ------------------
  |  Branch (178:5): [True: 11, False: 17]
  ------------------
  179|     11|      return copy_3_bytes(out, from);
  180|      0|    case 2:
  ------------------
  |  Branch (180:5): [True: 0, False: 28]
  ------------------
  181|      0|      return copy_2_bytes(out, from);
  182|      0|    case 1:
  ------------------
  |  Branch (182:5): [True: 0, False: 28]
  ------------------
  183|      0|      return copy_1_bytes(out, from);
  184|      0|    case 0:
  ------------------
  |  Branch (184:5): [True: 0, False: 28]
  ------------------
  185|      0|      return out;
  186|      0|    default:
  ------------------
  |  Branch (186:5): [True: 0, False: 28]
  ------------------
  187|      0|      assert(0);
  188|     28|  }
  189|      0|#endif /* BLOSC_STRICT_ALIGN */
  190|      0|  return out;
  191|     28|}
fastcopy.c:copy_7_bytes:
   80|      3|static inline unsigned char *copy_7_bytes(unsigned char *out, const unsigned char *from) {
   81|      3|  out = copy_3_bytes(out, from);
   82|      3|  return copy_4_bytes(out, from + 3);
   83|      3|}
fastcopy.c:copy_6_bytes:
   75|      6|static inline unsigned char *copy_6_bytes(unsigned char *out, const unsigned char *from) {
   76|      6|  out = copy_2_bytes(out, from);
   77|      6|  return copy_4_bytes(out, from + 2);
   78|      6|}
fastcopy.c:copy_5_bytes:
   70|      5|static inline unsigned char *copy_5_bytes(unsigned char *out, const unsigned char *from) {
   71|      5|  out = copy_1_bytes(out, from);
   72|      5|  return copy_4_bytes(out, from + 1);
   73|      5|}
fastcopy.c:copy_3_bytes:
   65|     14|static inline unsigned char *copy_3_bytes(unsigned char *out, const unsigned char *from) {
   66|     14|  out = copy_1_bytes(out, from);
   67|     14|  return copy_2_bytes(out, from + 1);
   68|     14|}
fastcopy.c:copy_1_bytes:
   60|     19|static inline unsigned char *copy_1_bytes(unsigned char *out, const unsigned char *from) {
   61|     19|  *out++ = *from;
   62|     19|  return out;
   63|     19|}
fastcopy.c:chunk_memcpy:
  200|      1|static inline unsigned char *chunk_memcpy(unsigned char *out, const unsigned char *from, unsigned len) {
  201|      1|  unsigned sz = sizeof(uint64_t);
  202|      1|  unsigned rem = len % sz;
  203|      1|  unsigned by8;
  204|       |
  205|      1|  assert(len >= sz);
  206|       |
  207|       |  /* Copy a few bytes to make sure the loop below has a multiple of SZ bytes to be copied. */
  208|      1|  copy_8_bytes(out, from);
  209|       |
  210|      1|  len /= sz;
  211|      1|  out += rem;
  212|      1|  from += rem;
  213|       |
  214|      1|  by8 = len % 8;
  215|      1|  len -= by8;
  216|      1|  switch (by8) {
  217|      0|    case 7:
  ------------------
  |  Branch (217:5): [True: 0, False: 1]
  ------------------
  218|      0|      out = copy_8_bytes(out, from);
  219|      0|      from += sz;
  220|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  221|       |      __attribute__ ((fallthrough));  // Shut-up -Wimplicit-fallthrough warning in GCC
  222|       |      #endif
  223|      0|    case 6:
  ------------------
  |  Branch (223:5): [True: 0, False: 1]
  ------------------
  224|      0|      out = copy_8_bytes(out, from);
  225|      0|      from += sz;
  226|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  227|       |      __attribute__ ((fallthrough));
  228|       |      #endif
  229|      0|    case 5:
  ------------------
  |  Branch (229:5): [True: 0, False: 1]
  ------------------
  230|      0|      out = copy_8_bytes(out, from);
  231|      0|      from += sz;
  232|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  233|       |      __attribute__ ((fallthrough));
  234|       |      #endif
  235|      0|    case 4:
  ------------------
  |  Branch (235:5): [True: 0, False: 1]
  ------------------
  236|      0|      out = copy_8_bytes(out, from);
  237|      0|      from += sz;
  238|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  239|       |      __attribute__ ((fallthrough));
  240|       |      #endif
  241|      0|    case 3:
  ------------------
  |  Branch (241:5): [True: 0, False: 1]
  ------------------
  242|      0|      out = copy_8_bytes(out, from);
  243|      0|      from += sz;
  244|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  245|       |      __attribute__ ((fallthrough));
  246|       |      #endif
  247|      0|    case 2:
  ------------------
  |  Branch (247:5): [True: 0, False: 1]
  ------------------
  248|      0|      out = copy_8_bytes(out, from);
  249|      0|      from += sz;
  250|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  251|       |      __attribute__ ((fallthrough));
  252|       |      #endif
  253|      1|    case 1:
  ------------------
  |  Branch (253:5): [True: 1, False: 0]
  ------------------
  254|      1|      out = copy_8_bytes(out, from);
  255|      1|      from += sz;
  256|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  257|       |      __attribute__ ((fallthrough));
  258|       |      #endif
  259|      1|    default:
  ------------------
  |  Branch (259:5): [True: 0, False: 1]
  ------------------
  260|      1|      break;
  261|      1|  }
  262|       |
  263|      1|  while (len) {
  ------------------
  |  Branch (263:10): [True: 0, False: 1]
  ------------------
  264|      0|    out = copy_8_bytes(out, from);
  265|      0|    from += sz;
  266|      0|    out = copy_8_bytes(out, from);
  267|      0|    from += sz;
  268|      0|    out = copy_8_bytes(out, from);
  269|      0|    from += sz;
  270|      0|    out = copy_8_bytes(out, from);
  271|      0|    from += sz;
  272|      0|    out = copy_8_bytes(out, from);
  273|      0|    from += sz;
  274|      0|    out = copy_8_bytes(out, from);
  275|      0|    from += sz;
  276|      0|    out = copy_8_bytes(out, from);
  277|      0|    from += sz;
  278|      0|    out = copy_8_bytes(out, from);
  279|      0|    from += sz;
  280|       |
  281|      0|    len -= 8;
  282|      0|  }
  283|       |
  284|      1|  return out;
  285|      1|}
fastcopy.c:chunk_memcpy_unaligned:
  410|     55|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|     55|#endif
  416|     55|  unsigned rem = len % sz;
  417|     55|  unsigned ilen;
  418|       |
  419|     55|  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|     55|#endif
  427|       |
  428|     55|  len /= sz;
  429|     55|  out += rem;
  430|     55|  from += rem;
  431|       |
  432|  93.5k|  for (ilen = 0; ilen < len; ilen++) {
  ------------------
  |  Branch (432:18): [True: 93.4k, False: 55]
  ------------------
  433|       |#if defined(__AVX2__)
  434|       |    copy_32_bytes(out, from);
  435|       |#elif defined(__SSE2__)
  436|       |    copy_16_bytes(out, from);
  437|  93.4k|#endif
  438|  93.4k|    out += sz;
  439|  93.4k|    from += sz;
  440|  93.4k|  }
  441|       |
  442|     55|  return out;
  443|     55|}
fastcopy.c:copy_4_bytes:
   48|   132k|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|   132k|  *(uint32_t *) out = *(uint32_t *) from;
   55|   132k|#endif
   56|   132k|  return out + 4;
   57|   132k|}
fastcopy.c:copy_2_bytes:
   37|   110k|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|   110k|  *(uint16_t *) out = *(uint16_t *) from;
   44|   110k|#endif
   45|   110k|  return out + 2;
   46|   110k|}

frame_reader_acquire:
  157|     19|void* frame_reader_acquire(blosc2_frame_s* frame, const blosc2_io* io) {
  158|     19|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
  159|     19|  if (io_cb == NULL) {
  ------------------
  |  Branch (159:7): [True: 0, False: 19]
  ------------------
  160|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|      0|    return NULL;
  162|      0|  }
  163|     19|  if (io->id != BLOSC2_IO_FILESYSTEM) {
  ------------------
  |  Branch (163:7): [True: 0, False: 19]
  ------------------
  164|       |    // Third-party backends keep the documented one-handle-per-reader contract
  165|       |    // (and the mmap one already makes open() a cheap pointer return).
  166|      0|    return io_cb->open(frame->urlpath, "rb", io->params);
  167|      0|  }
  168|       |#if defined(_WIN32)
  169|       |  // No handle caching on Windows.  The CRT opens files without
  170|       |  // FILE_SHARE_DELETE, so a cached handle turns every unlink or rename of the
  171|       |  // frame file into a sharing violation.  Callers that replace a frame rather
  172|       |  // than rewrite it in place -- python-blosc2 does, both via os.replace and via
  173|       |  // remove-then-recreate for mode="w" -- would get hard errors instead of the
  174|       |  // stale read that frame_reader_revalidate() handles elsewhere.  Caching here
  175|       |  // needs CreateFileW(..., FILE_SHARE_DELETE) plus POSIX-semantics deletion
  176|       |  // (Win10 1709+), which is only worth its cost once measured on Windows.
  177|       |  return io_cb->open(frame->urlpath, "rb", io->params);
  178|       |#else
  179|       |  // The cached handle pins the inode it was opened on, so a frame file that is
  180|       |  // replaced instead of rewritten in place would keep serving the old bytes.
  181|       |  // frame_reader_revalidate() catches that ahead of each header read.
  182|       |  //
  183|       |  // No unlocked fast path on read_fp: reading it outside the mutex races the
  184|       |  // store below (C11 data race, and TSan says so).  An uncontended lock is a
  185|       |  // handful of ns against the ~600 ns pread this hands a handle to.
  186|     19|  blosc2_pthread_mutex_lock(&frame->read_fp_mutex);
  ------------------
  |  |   92|     19|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  187|     19|  if (frame->read_fp == NULL && !frame->read_fp_nocache) {
  ------------------
  |  Branch (187:7): [True: 19, False: 0]
  |  Branch (187:33): [True: 19, False: 0]
  ------------------
  188|     19|    if (reader_cache_claim()) {
  ------------------
  |  Branch (188:9): [True: 19, False: 0]
  ------------------
  189|     19|      frame->read_fp = io_cb->open(frame->urlpath, "rb", io->params);
  190|     19|      if (frame->read_fp == NULL) {
  ------------------
  |  Branch (190:11): [True: 19, False: 0]
  ------------------
  191|     19|        reader_cache_return();
  192|     19|      }
  193|     19|    }
  194|      0|    else {
  195|       |      // Remember that this frame goes uncached, so the process-wide cache mutex
  196|       |      // is asked once rather than on every read for the rest of its life
  197|      0|      frame->read_fp_nocache = true;
  198|      0|    }
  199|     19|  }
  200|     19|  void* fp = frame->read_fp;
  201|     19|  if (fp != NULL) {
  ------------------
  |  Branch (201:7): [True: 0, False: 19]
  ------------------
  202|       |    // Held until the matching release, so nothing can close it underneath a
  203|       |    // caller that keeps it across several reads (frame_to_schunk does)
  204|      0|    frame->read_fp_refs++;
  205|      0|  }
  206|     19|  blosc2_pthread_mutex_unlock(&frame->read_fp_mutex);
  ------------------
  |  |   93|     19|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  207|     19|  if (fp == NULL) {
  ------------------
  |  Branch (207:7): [True: 19, False: 0]
  ------------------
  208|       |    // Cache full (or the cached open failed): hand out a private handle, which
  209|       |    // the matching frame_reader_release() closes since it is not frame->read_fp
  210|     19|    fp = io_cb->open(frame->urlpath, "rb", io->params);
  211|     19|  }
  212|     19|  return fp;
  213|     19|#endif
  214|     19|}
frame_reader_invalidate:
  265|  13.6k|void frame_reader_invalidate(blosc2_frame_s* frame) {
  266|  13.6k|  blosc2_pthread_mutex_lock(&frame->read_fp_mutex);
  ------------------
  |  |   92|  13.6k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  267|  13.6k|  frame_reader_close_locked(frame, true);
  268|  13.6k|  blosc2_pthread_mutex_unlock(&frame->read_fp_mutex);
  ------------------
  |  |   93|  13.6k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  269|  13.6k|}
frame_lock:
  481|  54.8k|int frame_lock(blosc2_frame_s* frame, bool exclusive) {
  482|  54.8k|  if (frame == NULL || !frame->locking) {
  ------------------
  |  Branch (482:7): [True: 0, False: 54.8k]
  |  Branch (482:24): [True: 54.8k, False: 0]
  ------------------
  483|  54.8k|    return BLOSC2_ERROR_SUCCESS;
  484|  54.8k|  }
  485|      0|  if (frame->lock_depth > 0) {
  ------------------
  |  Branch (485:7): [True: 0, False: 0]
  ------------------
  486|       |    // Already held by this handle (a nested call); the outer lock covers us
  487|      0|    frame->lock_depth++;
  488|      0|    return BLOSC2_ERROR_SUCCESS;
  489|      0|  }
  490|      0|  if (frame->lock_fd == -1) {
  ------------------
  |  Branch (490:7): [True: 0, False: 0]
  ------------------
  491|       |    // Lazily open the sidecar, kept for the frame's lifetime
  492|      0|    char* path = frame_lock_path(frame);
  493|      0|    if (path == NULL) {
  ------------------
  |  Branch (493:9): [True: 0, False: 0]
  ------------------
  494|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
  495|      0|    }
  496|       |#if defined(_WIN32)
  497|       |    HANDLE h = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
  498|       |                           FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
  499|       |                           NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
  500|       |    if (h == INVALID_HANDLE_VALUE) {
  501|       |      BLOSC_TRACE_ERROR("Cannot open the lock file in: %s", path);
  502|       |      free(path);
  503|       |      return BLOSC2_ERROR_LOCK;
  504|       |    }
  505|       |    frame->lock_fd = (intptr_t)h;
  506|       |#else
  507|      0|    int fd = open(path, O_CREAT | O_RDWR | O_CLOEXEC, 0666);
  508|      0|    if (fd < 0) {
  ------------------
  |  Branch (508:9): [True: 0, False: 0]
  ------------------
  509|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  510|      0|      free(path);
  511|      0|      return BLOSC2_ERROR_LOCK;
  512|      0|    }
  513|      0|    frame->lock_fd = fd;
  514|      0|#endif
  515|      0|    free(path);
  516|      0|  }
  517|      0|  if (frame_os_lock(frame, exclusive) < 0) {
  ------------------
  |  Branch (517:7): [True: 0, False: 0]
  ------------------
  518|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  519|      0|    return BLOSC2_ERROR_LOCK;
  520|      0|  }
  521|       |  // Generation counter: writers bump it, everyone compares it with the last
  522|       |  // value it saw.  This detects mutations by other handles exactly, even when
  523|       |  // the frame length on disk ends up unchanged (which the length-based
  524|       |  // staleness check in frame_refresh_if_stale() cannot see).
  525|      0|  uint64_t seq;
  526|      0|  if (frame_lock_read_seq(frame, &seq) < 0 ||
  ------------------
  |  Branch (526:7): [True: 0, False: 0]
  ------------------
  527|      0|      (exclusive && frame_lock_write_seq(frame, seq + 1) < 0)) {
  ------------------
  |  Branch (527:8): [True: 0, False: 0]
  |  Branch (527:21): [True: 0, False: 0]
  ------------------
  528|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|      0|    frame_os_unlock(frame);
  530|      0|    return BLOSC2_ERROR_LOCK;
  531|      0|  }
  532|      0|  if (seq != frame->lock_seq) {
  ------------------
  |  Branch (532:7): [True: 0, False: 0]
  ------------------
  533|      0|    frame->force_refresh = true;
  534|      0|  }
  535|      0|  if (exclusive) {
  ------------------
  |  Branch (535:7): [True: 0, False: 0]
  ------------------
  536|      0|    seq++;
  537|      0|  }
  538|      0|  frame->lock_seq = seq;
  539|      0|  frame->lock_depth = 1;
  540|      0|  return BLOSC2_ERROR_SUCCESS;
  541|      0|}
frame_unlock:
  544|  54.8k|int frame_unlock(blosc2_frame_s* frame) {
  545|  54.8k|  if (frame == NULL || !frame->locking || frame->lock_depth == 0) {
  ------------------
  |  Branch (545:7): [True: 0, False: 54.8k]
  |  Branch (545:24): [True: 54.8k, False: 0]
  |  Branch (545:43): [True: 0, False: 0]
  ------------------
  546|  54.8k|    return BLOSC2_ERROR_SUCCESS;
  547|  54.8k|  }
  548|      0|  if (--frame->lock_depth > 0) {
  ------------------
  |  Branch (548:7): [True: 0, False: 0]
  ------------------
  549|      0|    return BLOSC2_ERROR_SUCCESS;
  550|      0|  }
  551|      0|  if (frame_os_unlock(frame) < 0) {
  ------------------
  |  Branch (551:7): [True: 0, False: 0]
  ------------------
  552|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  553|      0|    return BLOSC2_ERROR_LOCK;
  554|      0|  }
  555|      0|  return BLOSC2_ERROR_SUCCESS;
  556|      0|}
frame_free:
  560|  13.6k|int frame_free(blosc2_frame_s* frame) {
  561|       |
  562|  13.6k|  frame_reader_invalidate(frame);
  563|  13.6k|  blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|  13.6k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
  564|       |
  565|  13.6k|  if (frame->locking && frame->lock_fd != -1) {
  ------------------
  |  Branch (565:7): [True: 0, False: 13.6k]
  |  Branch (565:25): [True: 0, False: 0]
  ------------------
  566|       |#if defined(_WIN32)
  567|       |    CloseHandle((HANDLE)frame->lock_fd);
  568|       |#else
  569|      0|    close((int)frame->lock_fd);
  570|      0|#endif
  571|      0|  }
  572|       |
  573|  13.6k|  if (frame->cframe != NULL && !frame->avoid_cframe_free) {
  ------------------
  |  Branch (573:7): [True: 13.6k, False: 0]
  |  Branch (573:32): [True: 0, False: 13.6k]
  ------------------
  574|      0|    free(frame->cframe);
  575|      0|  }
  576|       |
  577|  13.6k|  if (frame->coffsets != NULL && frame->coffsets_needs_free) {
  ------------------
  |  Branch (577:7): [True: 0, False: 13.6k]
  |  Branch (577:34): [True: 0, False: 0]
  ------------------
  578|      0|    free(frame->coffsets);
  579|      0|  }
  580|       |
  581|  13.6k|  if (frame->urlpath != NULL) {
  ------------------
  |  Branch (581:7): [True: 0, False: 13.6k]
  ------------------
  582|      0|    free(frame->urlpath);
  583|      0|  }
  584|       |
  585|  13.6k|  free(frame);
  586|       |
  587|  13.6k|  return 0;
  588|  13.6k|}
get_header_info:
  898|  72.0k|                    uint8_t *splitmode, uint8_t *use_dict, const blosc2_io *io) {
  899|  72.0k|  uint8_t* framep = frame->cframe;
  900|  72.0k|  uint8_t* header_ptr;
  901|  72.0k|  uint8_t header[FRAME_HEADER_MINLEN];
  902|       |
  903|  72.0k|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
  904|  72.0k|  if (io_cb == NULL) {
  ------------------
  |  Branch (904:7): [True: 0, False: 72.0k]
  ------------------
  905|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  906|      0|    return BLOSC2_ERROR_PLUGIN_IO;
  907|      0|  }
  908|       |
  909|  72.0k|  if (frame->len <= 0) {
  ------------------
  |  Branch (909:7): [True: 0, False: 72.0k]
  ------------------
  910|      0|    return BLOSC2_ERROR_READ_BUFFER;
  911|      0|  }
  912|       |
  913|  72.0k|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (913:7): [True: 0, False: 72.0k]
  ------------------
  914|      0|    int64_t rbytes = 0;
  915|      0|    void* fp = NULL;
  916|      0|    int64_t io_pos = 0;
  917|      0|    if (frame->sframe) {
  ------------------
  |  Branch (917:9): [True: 0, False: 0]
  ------------------
  918|      0|      fp = sframe_open_index(frame->urlpath, "rb", io);
  919|      0|      if (fp == NULL) {
  ------------------
  |  Branch (919:11): [True: 0, False: 0]
  ------------------
  920|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  921|      0|        return BLOSC2_ERROR_FILE_OPEN;
  922|      0|      }
  923|      0|    }
  924|      0|    else {
  925|       |      /* Ahead of the header read, not after it: everything downstream (and
  926|       |         frame_refresh_if_stale in particular) trusts the length this read
  927|       |         returns, so a stale handle here would pair old metadata with the
  928|       |         replacement's bytes. */
  929|      0|      frame_reader_revalidate(frame);
  930|      0|      fp = frame_reader_acquire(frame, io);
  931|      0|      if (fp == NULL) {
  ------------------
  |  Branch (931:11): [True: 0, False: 0]
  ------------------
  932|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  933|      0|        return BLOSC2_ERROR_FILE_OPEN;
  934|      0|      }
  935|      0|      io_pos = frame->file_offset;
  936|      0|    }
  937|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (937:9): [True: 0, False: 0]
  ------------------
  938|      0|      header_ptr = header;
  939|      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
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|      0|    frame_reader_release(frame, io_cb, fp);
  941|      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 (941:9): [True: 0, False: 0]
  ------------------
  942|      0|      return BLOSC2_ERROR_FILE_READ;
  943|      0|    }
  944|      0|    framep = header_ptr;
  945|      0|  }
  946|       |
  947|       |  // Consistency check for frame type
  948|  72.0k|  uint8_t frame_type = framep[FRAME_TYPE];
  ------------------
  |  |   33|  72.0k|#define FRAME_TYPE (FRAME_FLAGS + 1)  // 26
  |  |  ------------------
  |  |  |  |   32|  72.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  72.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  72.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  72.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  949|  72.0k|  uint8_t frame_version = framep[FRAME_FLAGS] & 0x0fu;
  ------------------
  |  |   32|  72.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  ------------------
  |  |  |  |   31|  72.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  72.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   29|  72.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  950|  72.0k|  if (frame_version > BLOSC2_VERSION_FRAME_FORMAT) {
  ------------------
  |  Branch (950:7): [True: 2, False: 72.0k]
  ------------------
  951|      2|    BLOSC_TRACE_ERROR("Unsupported cframe version: %u", frame_version);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  952|      2|    return BLOSC2_ERROR_VERSION_SUPPORT;
  953|      2|  }
  954|  72.0k|  if (frame->sframe) {
  ------------------
  |  Branch (954:7): [True: 0, False: 72.0k]
  ------------------
  955|      0|    if (frame_type != FRAME_DIRECTORY_TYPE) {
  ------------------
  |  |   22|      0|#define FRAME_DIRECTORY_TYPE 1
  ------------------
  |  Branch (955:9): [True: 0, False: 0]
  ------------------
  956|      0|      return BLOSC2_ERROR_FRAME_TYPE;
  957|      0|    }
  958|  72.0k|  } else {
  959|  72.0k|    if (frame_type != FRAME_CONTIGUOUS_TYPE) {
  ------------------
  |  |   21|  72.0k|#define FRAME_CONTIGUOUS_TYPE 0
  ------------------
  |  Branch (959:9): [True: 8, False: 72.0k]
  ------------------
  960|      8|      return BLOSC2_ERROR_FRAME_TYPE;
  961|      8|    }
  962|  72.0k|  }
  963|       |
  964|       |  // Fetch some internal lengths
  965|  72.0k|  from_big(header_len, framep + FRAME_HEADER_LEN, sizeof(*header_len));
  ------------------
  |  |   38|  72.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  966|  72.0k|  if (*header_len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  72.0k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  72.0k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  72.0k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  72.0k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  72.0k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  72.0k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  72.0k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  72.0k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  72.0k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  72.0k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  72.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  72.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  72.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  72.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (966:7): [True: 18, False: 72.0k]
  ------------------
  967|     18|    BLOSC_TRACE_ERROR("Header length is zero or smaller than min allowed.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  968|     18|    return BLOSC2_ERROR_INVALID_HEADER;
  969|     18|  }
  970|  72.0k|  from_big(frame_len, framep + FRAME_LEN, sizeof(*frame_len));
  ------------------
  |  |   38|  72.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  971|  72.0k|  if (*header_len > *frame_len) {
  ------------------
  |  Branch (971:7): [True: 25, False: 72.0k]
  ------------------
  972|     25|    BLOSC_TRACE_ERROR("Header length exceeds length of the frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|     25|    return BLOSC2_ERROR_INVALID_HEADER;
  974|     25|  }
  975|  72.0k|  from_big(nbytes, framep + FRAME_NBYTES, sizeof(*nbytes));
  ------------------
  |  |   38|  72.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  976|  72.0k|  from_big(cbytes, framep + FRAME_CBYTES, sizeof(*cbytes));
  ------------------
  |  |   38|  72.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  977|  72.0k|  from_big(blocksize, framep + FRAME_BLOCKSIZE, sizeof(*blocksize));
  ------------------
  |  |   38|  72.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  978|  72.0k|  if (chunksize != NULL) {
  ------------------
  |  Branch (978:7): [True: 72.0k, False: 0]
  ------------------
  979|  72.0k|    from_big(chunksize, framep + FRAME_CHUNKSIZE, sizeof(*chunksize));
  ------------------
  |  |   38|  72.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  980|  72.0k|  }
  981|  72.0k|  if (typesize != NULL) {
  ------------------
  |  Branch (981:7): [True: 70.0k, False: 1.93k]
  ------------------
  982|  70.0k|    from_big(typesize, framep + FRAME_TYPESIZE, sizeof(*typesize));
  ------------------
  |  |   38|  70.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  983|  70.0k|    if (*typesize <= 0) {
  ------------------
  |  Branch (983:9): [True: 34, False: 70.0k]
  ------------------
  984|     34|      BLOSC_TRACE_ERROR("`typesize` cannot be zero or negative.");
  ------------------
  |  |   93|     34|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     34|    do {                                            \
  |  |  |  |   98|     34|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     34|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 34, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     34|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  985|     34|      return BLOSC2_ERROR_INVALID_HEADER;
  986|     34|    }
  987|  70.0k|  }
  988|       |
  989|       |  // Codecs
  990|  71.9k|  uint8_t frame_codecs = framep[FRAME_CODECS];
  ------------------
  |  |   34|  71.9k|#define FRAME_CODECS (FRAME_FLAGS + 2)  // 27
  |  |  ------------------
  |  |  |  |   32|  71.9k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  71.9k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  71.9k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  71.9k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  991|  71.9k|  if (clevel != NULL) {
  ------------------
  |  Branch (991:7): [True: 13.5k, False: 58.4k]
  ------------------
  992|  13.5k|    *clevel = frame_codecs >> 4u;
  993|  13.5k|  }
  994|  71.9k|  if (compcode != NULL) {
  ------------------
  |  Branch (994:7): [True: 13.5k, False: 58.4k]
  ------------------
  995|  13.5k|    *compcode = frame_codecs & 0xFu;
  996|  13.5k|    if (*compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (996:9): [True: 554, False: 12.9k]
  ------------------
  997|    554|      from_big(compcode, framep + FRAME_UDCODEC, sizeof(*compcode));
  ------------------
  |  |   38|    554|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  998|    554|    }
  999|  13.5k|  }
 1000|       |
 1001|       |  // Other flags
 1002|  71.9k|  uint8_t other_flags = framep[FRAME_OTHER_FLAGS];
  ------------------
  |  |   35|  71.9k|#define FRAME_OTHER_FLAGS (FRAME_FLAGS + 3)  // 28
  |  |  ------------------
  |  |  |  |   32|  71.9k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  71.9k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  71.9k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  71.9k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1003|  71.9k|  if (splitmode != NULL) {
  ------------------
  |  Branch (1003:7): [True: 13.5k, False: 58.4k]
  ------------------
 1004|  13.5k|    *splitmode = (other_flags & 0x03u) + 1;
 1005|  13.5k|  }
 1006|       |
 1007|       |  // Other flags 2: bit 0 = use_dict
 1008|  71.9k|  if (use_dict != NULL) {
  ------------------
  |  Branch (1008:7): [True: 13.5k, False: 58.4k]
  ------------------
 1009|  13.5k|    *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   47|  13.5k|#define FRAME_OTHER_FLAGS2 (FRAME_FILTER_PIPELINE + 1 + 14)  // 85
  |  |  ------------------
  |  |  |  |   44|  13.5k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  13.5k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  13.5k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  13.5k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  13.5k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  13.5k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  13.5k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  13.5k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  13.5k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  13.5k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  13.5k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  13.5k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  13.5k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   48|  13.5k|#define FRAME_USE_DICT (1U << 0)   //!< bit 0 of other_flags2: use dictionary compression
  ------------------
  |  Branch (1009:17): [True: 5.23k, False: 8.29k]
  ------------------
 1010|  13.5k|  }
 1011|       |
 1012|  71.9k|  if (compcode_meta != NULL) {
  ------------------
  |  Branch (1012:7): [True: 13.5k, False: 58.4k]
  ------------------
 1013|  13.5k|    from_big(compcode_meta, framep + FRAME_CODEC_META, sizeof(*compcode_meta));
  ------------------
  |  |   38|  13.5k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1014|  13.5k|  }
 1015|       |
 1016|       |  // Filters
 1017|  71.9k|  if (filters != NULL && filters_meta != NULL) {
  ------------------
  |  Branch (1017:7): [True: 13.5k, False: 58.4k]
  |  Branch (1017:26): [True: 13.5k, False: 0]
  ------------------
 1018|  13.5k|    uint8_t nfilters = framep[FRAME_FILTER_PIPELINE];
  ------------------
  |  |   44|  13.5k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  13.5k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  13.5k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  13.5k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  13.5k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  13.5k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  13.5k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  13.5k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  13.5k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  13.5k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  13.5k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  13.5k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  13.5k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1019|  13.5k|    if (nfilters > BLOSC2_MAX_FILTERS) {
  ------------------
  |  Branch (1019:9): [True: 4, False: 13.5k]
  ------------------
 1020|      4|      BLOSC_TRACE_ERROR("The number of filters in frame header are too large for Blosc2.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1021|      4|      return BLOSC2_ERROR_INVALID_HEADER;
 1022|      4|    }
 1023|  13.5k|    uint8_t *filters_ = framep + FRAME_FILTER_PIPELINE + 1;
  ------------------
  |  |   44|  13.5k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  13.5k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  13.5k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  13.5k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  13.5k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  13.5k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  13.5k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  13.5k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  13.5k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  13.5k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  13.5k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  13.5k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  13.5k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1024|  13.5k|    uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   44|  13.5k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  13.5k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  13.5k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  13.5k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  13.5k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  13.5k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  13.5k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  13.5k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  13.5k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  13.5k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  13.5k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  13.5k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  13.5k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   53|  13.5k|#define FRAME_FILTER_PIPELINE_MAX (8)  // the maximum number of filters that can be stored in header
  ------------------
 1025|  20.1k|    for (int i = 0; i < nfilters; i++) {
  ------------------
  |  Branch (1025:21): [True: 6.57k, False: 13.5k]
  ------------------
 1026|  6.57k|      filters[i] = filters_[i];
 1027|  6.57k|      filters_meta[i] = filters_meta_[i];
 1028|  6.57k|    }
 1029|  13.5k|  }
 1030|       |
 1031|  71.9k|  if (*nbytes > 0) {
  ------------------
  |  Branch (1031:7): [True: 71.3k, False: 626]
  ------------------
 1032|  71.3k|    if (*chunksize > 0) {
  ------------------
  |  Branch (1032:9): [True: 56.4k, False: 14.9k]
  ------------------
 1033|       |      // We can compute the number of chunks directly when there is a fixed chunk size.
 1034|  56.4k|      *nchunks = *nbytes / *chunksize;
 1035|  56.4k|      if (*nbytes % *chunksize > 0) {
  ------------------
  |  Branch (1035:11): [True: 52.0k, False: 4.36k]
  ------------------
 1036|  52.0k|        *nchunks += 1;
 1037|  52.0k|      }
 1038|       |
 1039|       |      // Sanity check for compressed sizes
 1040|  56.4k|      if ((*cbytes < 0) || ((int64_t)*nchunks * *chunksize < *nbytes)) {
  ------------------
  |  Branch (1040:11): [True: 62, False: 56.3k]
  |  Branch (1040:28): [True: 6, False: 56.3k]
  ------------------
 1041|     68|        BLOSC_TRACE_ERROR("Invalid compressed size in frame header.");
  ------------------
  |  |   93|     68|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     68|    do {                                            \
  |  |  |  |   98|     68|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     68|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 68, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     68|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1042|     68|        return BLOSC2_ERROR_INVALID_HEADER;
 1043|     68|      }
 1044|  56.4k|    }
 1045|  14.9k|    else if (*chunksize == 0) {
  ------------------
  |  Branch (1045:14): [True: 14.9k, False: 43]
  ------------------
 1046|  14.9k|      int32_t coffsets_nbytes;
 1047|  14.9k|      int rc2 = get_coffsets_nbytes(frame, *header_len, *cbytes, &coffsets_nbytes, io);
 1048|  14.9k|      if (rc2 < 0) {
  ------------------
  |  Branch (1048:11): [True: 398, False: 14.5k]
  ------------------
 1049|    398|        return rc2;
 1050|    398|      }
 1051|  14.5k|      if (coffsets_nbytes < 0 || coffsets_nbytes % (int32_t)sizeof(int64_t) != 0) {
  ------------------
  |  Branch (1051:11): [True: 34, False: 14.4k]
  |  Branch (1051:34): [True: 5, False: 14.4k]
  ------------------
 1052|     39|        BLOSC_TRACE_ERROR("Invalid offsets chunk in frame header.");
  ------------------
  |  |   93|     39|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     39|    do {                                            \
  |  |  |  |   98|     39|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     39|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 39, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     39|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1053|     39|        return BLOSC2_ERROR_INVALID_HEADER;
 1054|     39|      }
 1055|  14.4k|      *nchunks = coffsets_nbytes / (int32_t)sizeof(int64_t);
 1056|  14.4k|    }
 1057|     43|    else {
 1058|     43|      BLOSC_TRACE_ERROR("Invalid chunk size in frame header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1059|     43|      return BLOSC2_ERROR_INVALID_HEADER;
 1060|     43|    }
 1061|  71.3k|  } else {
 1062|    626|    *nchunks = 0;
 1063|    626|  }
 1064|       |
 1065|  71.4k|  if (*nchunks > 0) {
  ------------------
  |  Branch (1065:7): [True: 70.8k, False: 644]
  ------------------
 1066|  70.8k|    int32_t off_nbytes;
 1067|  70.8k|    if (!blosc2_nchunks_to_offsets_nbytes(*nchunks, &off_nbytes)) {
  ------------------
  |  Branch (1067:9): [True: 79, False: 70.7k]
  ------------------
 1068|     79|      BLOSC_TRACE_ERROR("Invalid number of chunks in frame header.");
  ------------------
  |  |   93|     79|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     79|    do {                                            \
  |  |  |  |   98|     79|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     79|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 79, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     79|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1069|     79|      return BLOSC2_ERROR_INVALID_HEADER;
 1070|     79|    }
 1071|  70.8k|  }
 1072|       |
 1073|  71.3k|  return 0;
 1074|  71.4k|}
get_trailer_offset:
 1077|    885|int64_t get_trailer_offset(blosc2_frame_s *frame, int32_t header_len, bool has_coffsets) {
 1078|    885|  if (!has_coffsets) {
  ------------------
  |  Branch (1078:7): [True: 126, False: 759]
  ------------------
 1079|       |    // No data chunks yet
 1080|    126|    return header_len;
 1081|    126|  }
 1082|    759|  return frame->len - frame->trailer_len;
 1083|    885|}
frame_from_cframe:
 1873|  13.8k|blosc2_frame_s* frame_from_cframe(uint8_t *cframe, int64_t len, bool copy) {
 1874|       |  // Get the length of the frame
 1875|  13.8k|  const uint8_t* header = cframe;
 1876|  13.8k|  int64_t frame_len;
 1877|  13.8k|  if (len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  13.8k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  13.8k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  13.8k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  13.8k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  13.8k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  13.8k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  13.8k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  13.8k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  13.8k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  13.8k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  13.8k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  13.8k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  13.8k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  13.8k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1877:7): [True: 0, False: 13.8k]
  ------------------
 1878|      0|    return NULL;
 1879|      0|  }
 1880|       |
 1881|  13.8k|  from_big(&frame_len, header + FRAME_LEN, sizeof(frame_len));
  ------------------
  |  |   38|  13.8k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1882|  13.8k|  if (frame_len != len) {   // sanity check
  ------------------
  |  Branch (1882:7): [True: 107, False: 13.7k]
  ------------------
 1883|    107|    return NULL;
 1884|    107|  }
 1885|       |
 1886|  13.7k|  blosc2_frame_s* frame = frame_alloc();
 1887|  13.7k|  if (frame == NULL) {
  ------------------
  |  Branch (1887:7): [True: 0, False: 13.7k]
  ------------------
 1888|      0|    return NULL;
 1889|      0|  }
 1890|  13.7k|  frame->len = frame_len;
 1891|  13.7k|  frame->file_offset = 0;
 1892|       |
 1893|       |  // Now, the trailer length
 1894|  13.7k|  const uint8_t* trailer = cframe + frame_len - FRAME_TRAILER_MINLEN;
  ------------------
  |  |   58|  13.7k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 1895|  13.7k|  int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   58|  13.7k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
                int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   59|  13.7k|#define FRAME_TRAILER_LEN_OFFSET (22)  // offset to trailer length (counting from the end)
  ------------------
 1896|  13.7k|  if (trailer[trailer_offset - 1] != 0xce) {
  ------------------
  |  Branch (1896:7): [True: 12, False: 13.7k]
  ------------------
 1897|     12|    blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|     12|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 1898|     12|    free(frame);
 1899|     12|    return NULL;
 1900|     12|  }
 1901|  13.7k|  uint32_t trailer_len;
 1902|  13.7k|  from_big(&trailer_len, trailer + trailer_offset, sizeof(trailer_len));
  ------------------
  |  |   38|  13.7k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1903|  13.7k|  if (trailer_len < FRAME_TRAILER_MINLEN || trailer_len > INT32_MAX ||
  ------------------
  |  |   58|  27.4k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1903:7): [True: 7, False: 13.6k]
  |  Branch (1903:45): [True: 33, False: 13.6k]
  ------------------
 1904|  13.6k|      (int64_t)trailer_len > frame_len ||
  ------------------
  |  Branch (1904:7): [True: 35, False: 13.6k]
  ------------------
 1905|  13.6k|      (int64_t)trailer_len > frame_len - FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  13.6k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  13.6k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  13.6k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  13.6k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  13.6k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  13.6k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  13.6k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  13.6k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  13.6k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  13.6k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  13.6k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  13.6k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  13.6k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  13.6k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1905:7): [True: 14, False: 13.6k]
  ------------------
 1906|     89|    blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|     89|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 1907|     89|    free(frame);
 1908|     89|    return NULL;
 1909|     89|  }
 1910|  13.6k|  frame->trailer_len = trailer_len;
 1911|       |
 1912|  13.6k|  if (copy) {
  ------------------
  |  Branch (1912:7): [True: 0, False: 13.6k]
  ------------------
 1913|      0|    frame->cframe = malloc((size_t)len);
 1914|      0|    memcpy(frame->cframe, cframe, (size_t)len);
 1915|      0|  }
 1916|  13.6k|  else {
 1917|  13.6k|    frame->cframe = cframe;
 1918|  13.6k|    frame->avoid_cframe_free = true;
 1919|  13.6k|  }
 1920|       |
 1921|  13.6k|  return frame;
 1922|  13.7k|}
get_coffsets:
 2103|  69.1k|                      int64_t nchunks, int32_t *off_cbytes) {
 2104|  69.1k|  int32_t chunk_cbytes;
 2105|  69.1k|  int rc;
 2106|       |
 2107|  69.1k|  if (frame->coffsets != NULL) {
  ------------------
  |  Branch (2107:7): [True: 0, False: 69.1k]
  ------------------
 2108|      0|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (2108:9): [True: 0, False: 0]
  ------------------
 2109|      0|      rc = blosc2_cbuffer_sizes(frame->coffsets, NULL, &chunk_cbytes, NULL);
 2110|      0|      if (rc < 0) {
  ------------------
  |  Branch (2110:11): [True: 0, False: 0]
  ------------------
 2111|      0|        return NULL;
 2112|      0|      }
 2113|      0|      *off_cbytes = (int32_t)chunk_cbytes;
 2114|      0|    }
 2115|      0|    return frame->coffsets;
 2116|      0|  }
 2117|  69.1k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2117:7): [True: 69.1k, False: 0]
  ------------------
 2118|  69.1k|    int64_t off_pos = header_len;
 2119|  69.1k|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (2119:9): [True: 2.27k, False: 66.8k]
  ------------------
 2120|  2.27k|      off_pos += cbytes;
 2121|  2.27k|    }
 2122|       |    // Check that there is enough room to read Blosc header
 2123|  69.1k|    if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2123:9): [True: 0, False: 69.1k]
  |  Branch (2123:24): [True: 1, False: 69.1k]
  ------------------
 2124|  69.1k|        off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (2124:9): [True: 207, False: 68.9k]
  ------------------
 2125|    208|      BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   93|    208|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    208|    do {                                            \
  |  |  |  |   98|    208|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    208|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 208, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    208|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2126|    208|      return NULL;
 2127|    208|    }
 2128|       |    // For in-memory frames, the coffset is just one pointer away
 2129|  68.9k|    uint8_t* off_start = frame->cframe + off_pos;
 2130|  68.9k|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (2130:9): [True: 68.9k, False: 0]
  ------------------
 2131|  68.9k|      int32_t chunk_nbytes;
 2132|  68.9k|      int32_t chunk_blocksize;
 2133|  68.9k|      rc = blosc2_cbuffer_sizes(off_start, &chunk_nbytes, &chunk_cbytes, &chunk_blocksize);
 2134|  68.9k|      if (rc < 0) {
  ------------------
  |  Branch (2134:11): [True: 21, False: 68.8k]
  ------------------
 2135|     21|        return NULL;
 2136|     21|      }
 2137|  68.8k|      *off_cbytes = (int32_t)chunk_cbytes;
 2138|  68.8k|      if (*off_cbytes < 0 || off_pos + *off_cbytes > frame->len) {
  ------------------
  |  Branch (2138:11): [True: 0, False: 68.8k]
  |  Branch (2138:30): [True: 46, False: 68.8k]
  ------------------
 2139|     46|        BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   93|     46|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     46|    do {                                            \
  |  |  |  |   98|     46|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     46|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 46, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     46|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2140|     46|        return NULL;
 2141|     46|      }
 2142|  68.8k|      int32_t expected_off_nbytes;
 2143|  68.8k|      if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &expected_off_nbytes)) {
  ------------------
  |  Branch (2143:11): [True: 0, False: 68.8k]
  ------------------
 2144|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2145|      0|        return NULL;
 2146|      0|      }
 2147|  68.8k|      if (chunk_nbytes != expected_off_nbytes) {
  ------------------
  |  Branch (2147:11): [True: 61, False: 68.7k]
  ------------------
 2148|     61|        BLOSC_TRACE_ERROR("The number of chunks in offset idx "
  ------------------
  |  |   93|     61|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     61|    do {                                            \
  |  |  |  |   98|     61|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     61|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 61, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     61|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2149|     61|                          "does not match the ones in the header frame.");
 2150|     61|        return NULL;
 2151|     61|      }
 2152|       |
 2153|  68.8k|    }
 2154|  68.7k|    return off_start;
 2155|  68.9k|  }
 2156|       |
 2157|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
 2158|       |
 2159|      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 (2159:7): [True: 0, False: 0]
  |  Branch (2159:56): [True: 0, False: 0]
  ------------------
 2160|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2161|      0|    return NULL;
 2162|      0|  }
 2163|       |
 2164|      0|  int64_t coffsets_cbytes64;
 2165|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2165:7): [True: 0, False: 0]
  ------------------
 2166|      0|    coffsets_cbytes64 = trailer_offset - header_len;
 2167|      0|  }
 2168|      0|  else {
 2169|      0|    coffsets_cbytes64 = trailer_offset - (header_len + cbytes);
 2170|      0|  }
 2171|      0|  if (coffsets_cbytes64 <= 0 || coffsets_cbytes64 > INT32_MAX) {
  ------------------
  |  Branch (2171:7): [True: 0, False: 0]
  |  Branch (2171:33): [True: 0, False: 0]
  ------------------
 2172|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2173|      0|    return NULL;
 2174|      0|  }
 2175|      0|  int32_t coffsets_cbytes = (int32_t)coffsets_cbytes64;
 2176|       |
 2177|      0|  if (off_cbytes != NULL) {
  ------------------
  |  Branch (2177:7): [True: 0, False: 0]
  ------------------
 2178|      0|    *off_cbytes = coffsets_cbytes;
 2179|      0|  }
 2180|       |
 2181|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2182|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (2182:7): [True: 0, False: 0]
  ------------------
 2183|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2184|      0|    return NULL;
 2185|      0|  }
 2186|       |
 2187|      0|  void* fp = NULL;
 2188|      0|  uint8_t* coffsets;
 2189|      0|  if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2189:7): [True: 0, False: 0]
  ------------------
 2190|      0|    coffsets = malloc((size_t)coffsets_cbytes);
 2191|      0|    frame->coffsets_needs_free = true;
 2192|      0|  }
 2193|      0|  else {
 2194|      0|    frame->coffsets_needs_free = false;
 2195|      0|  }
 2196|       |
 2197|      0|  int64_t io_pos = 0;
 2198|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2198:7): [True: 0, False: 0]
  ------------------
 2199|      0|    fp = sframe_open_index(frame->urlpath, "rb",
 2200|      0|                           frame->schunk->storage->io);
 2201|      0|    if (fp == NULL) {
  ------------------
  |  Branch (2201:9): [True: 0, False: 0]
  ------------------
 2202|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|      0|      return NULL;
 2204|      0|    }
 2205|      0|    io_pos = header_len + 0;
 2206|      0|  }
 2207|      0|  else {
 2208|      0|    fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2209|      0|    if (fp == NULL) {
  ------------------
  |  Branch (2209:9): [True: 0, False: 0]
  ------------------
 2210|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2211|      0|      return NULL;
 2212|      0|    }
 2213|      0|    io_pos = frame->file_offset + header_len + cbytes;
 2214|      0|  }
 2215|      0|  int64_t rbytes = io_cb->read((void**)&coffsets, 1, coffsets_cbytes, io_pos, fp);
 2216|      0|  frame_reader_release(frame, io_cb, fp);
 2217|      0|  if (rbytes != coffsets_cbytes) {
  ------------------
  |  Branch (2217:7): [True: 0, False: 0]
  ------------------
 2218|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2219|      0|    if (frame->coffsets_needs_free)
  ------------------
  |  Branch (2219:9): [True: 0, False: 0]
  ------------------
 2220|      0|      free(coffsets);
 2221|      0|    return NULL;
 2222|      0|  }
 2223|      0|  frame->coffsets = coffsets;
 2224|      0|  return coffsets;
 2225|      0|}
frame_get_metalayers:
 2514|  1.04k|int frame_get_metalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 2515|  1.04k|  int32_t header_len;
 2516|  1.04k|  int64_t frame_len;
 2517|  1.04k|  int64_t nbytes;
 2518|  1.04k|  int64_t cbytes;
 2519|  1.04k|  int32_t blocksize;
 2520|  1.04k|  int32_t chunksize;
 2521|  1.04k|  int64_t nchunks;
 2522|  1.04k|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 2523|  1.04k|                            &blocksize, &chunksize, &nchunks,
 2524|  1.04k|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 2525|  1.04k|                            schunk->storage->io);
 2526|  1.04k|  if (ret < 0) {
  ------------------
  |  Branch (2526:7): [True: 0, False: 1.04k]
  ------------------
 2527|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2528|      0|    return ret;
 2529|      0|  }
 2530|       |
 2531|       |  // Get the header
 2532|  1.04k|  uint8_t* header = NULL;
 2533|  1.04k|  bool needs_free = false;
 2534|  1.04k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2534:7): [True: 1.04k, False: 0]
  ------------------
 2535|  1.04k|    header = frame->cframe;
 2536|  1.04k|  } else {
 2537|      0|    int64_t rbytes = 0;
 2538|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2539|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2539:9): [True: 0, False: 0]
  ------------------
 2540|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2541|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2542|      0|    }
 2543|       |
 2544|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 0]
  ------------------
 2545|      0|      header = malloc(header_len);
 2546|      0|      needs_free = true;
 2547|      0|    }
 2548|      0|    else {
 2549|      0|      needs_free = false;
 2550|      0|    }
 2551|       |
 2552|      0|    void* fp = NULL;
 2553|      0|    int64_t io_pos = 0;
 2554|      0|    if (frame->sframe) {
  ------------------
  |  Branch (2554:9): [True: 0, False: 0]
  ------------------
 2555|      0|      fp = sframe_open_index(frame->urlpath, "rb",
 2556|      0|                             frame->schunk->storage->io);
 2557|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2557:11): [True: 0, False: 0]
  ------------------
 2558|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2559|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2560|      0|      }
 2561|      0|    }
 2562|      0|    else {
 2563|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2564|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2564:11): [True: 0, False: 0]
  ------------------
 2565|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2566|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2567|      0|      }
 2568|      0|      io_pos = frame->file_offset;
 2569|      0|    }
 2570|      0|    if (fp != NULL) {
  ------------------
  |  Branch (2570:9): [True: 0, False: 0]
  ------------------
 2571|      0|      rbytes = io_cb->read((void**)&header, 1, header_len, io_pos, fp);
 2572|      0|      frame_reader_release(frame, io_cb, fp);
 2573|      0|    }
 2574|      0|    if (rbytes != header_len) {
  ------------------
  |  Branch (2574:9): [True: 0, False: 0]
  ------------------
 2575|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2576|      0|      if (needs_free)
  ------------------
  |  Branch (2576:11): [True: 0, False: 0]
  ------------------
 2577|      0|        free(header);
 2578|      0|      return BLOSC2_ERROR_FILE_READ;
 2579|      0|    }
 2580|      0|  }
 2581|       |
 2582|  1.04k|  ret = get_meta_from_header(frame, schunk, header, header_len);
 2583|       |
 2584|  1.04k|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (2584:7): [True: 0, False: 1.04k]
  |  Branch (2584:32): [True: 0, False: 0]
  ------------------
 2585|      0|    free(header);
 2586|      0|  }
 2587|       |
 2588|  1.04k|  return ret;
 2589|  1.04k|}
frame_get_vlmetalayers:
 2725|    885|int frame_get_vlmetalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 2726|    885|  int32_t header_len;
 2727|    885|  int64_t frame_len;
 2728|    885|  int64_t nbytes;
 2729|    885|  int64_t cbytes;
 2730|    885|  int32_t blocksize;
 2731|    885|  int32_t chunksize;
 2732|    885|  int64_t nchunks;
 2733|    885|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 2734|    885|                            &blocksize, &chunksize, &nchunks,
 2735|    885|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 2736|    885|                            schunk->storage->io);
 2737|    885|  if (ret < 0) {
  ------------------
  |  Branch (2737:7): [True: 0, False: 885]
  ------------------
 2738|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2739|      0|    return ret;
 2740|      0|  }
 2741|       |
 2742|    885|  int64_t trailer_offset = get_trailer_offset(frame, header_len, nbytes > 0);
 2743|    885|  int32_t trailer_len = (int32_t) frame->trailer_len;
 2744|       |
 2745|    885|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + trailer_len > frame->len) {
  ------------------
  |  Branch (2745:7): [True: 0, False: 885]
  |  Branch (2745:56): [True: 15, False: 870]
  ------------------
 2746|     15|    BLOSC_TRACE_ERROR("Cannot access the trailer out of the frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2747|     15|    return BLOSC2_ERROR_READ_BUFFER;
 2748|     15|  }
 2749|       |
 2750|       |  // Get the trailer
 2751|    870|  uint8_t* trailer = NULL;
 2752|    870|  bool needs_free = false;
 2753|    870|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2753:7): [True: 870, False: 0]
  ------------------
 2754|    870|    trailer = frame->cframe + trailer_offset;
 2755|    870|  } else {
 2756|      0|    int64_t rbytes = 0;
 2757|       |
 2758|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2759|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2759:9): [True: 0, False: 0]
  ------------------
 2760|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2761|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2762|      0|    }
 2763|       |
 2764|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2764:9): [True: 0, False: 0]
  ------------------
 2765|      0|      trailer = malloc(trailer_len);
 2766|      0|      needs_free = true;
 2767|      0|    }
 2768|      0|    else {
 2769|      0|      needs_free = false;
 2770|      0|    }
 2771|       |
 2772|      0|    void* fp = NULL;
 2773|      0|    int64_t io_pos = 0;
 2774|      0|    if (frame->sframe) {
  ------------------
  |  Branch (2774:9): [True: 0, False: 0]
  ------------------
 2775|       |      // Check for overflow before calculating length
 2776|      0|      if (strlen(frame->urlpath) > SIZE_MAX - strlen("/chunks.b2frame") - 1) {
  ------------------
  |  Branch (2776:11): [True: 0, False: 0]
  ------------------
 2777|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2778|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (2778:13): [True: 0, False: 0]
  ------------------
 2779|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 2780|      0|      }
 2781|      0|      size_t _len = strlen(frame->urlpath) + strlen("/chunks.b2frame") + 1;
 2782|      0|      char* eframe_name = malloc(_len);
 2783|      0|      if (eframe_name == NULL) {
  ------------------
  |  Branch (2783:11): [True: 0, False: 0]
  ------------------
 2784|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2785|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (2785:13): [True: 0, False: 0]
  ------------------
 2786|      0|        return BLOSC2_ERROR_MEMORY_ALLOC;
 2787|      0|      }
 2788|      0|      int _w = snprintf(eframe_name, _len, "%s/chunks.b2frame", frame->urlpath);
 2789|      0|      if (_w < 0 || (size_t)_w >= _len) {
  ------------------
  |  Branch (2789:11): [True: 0, False: 0]
  |  Branch (2789:21): [True: 0, False: 0]
  ------------------
 2790|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2791|      0|        free(eframe_name);
 2792|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (2792:13): [True: 0, False: 0]
  ------------------
 2793|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 2794|      0|      }
 2795|      0|      fp = io_cb->open(eframe_name, "rb", frame->schunk->storage->io->params);
 2796|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2796:11): [True: 0, False: 0]
  ------------------
 2797|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2798|      0|        free(eframe_name);
 2799|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2800|      0|      }
 2801|      0|      free(eframe_name);
 2802|      0|      io_pos = trailer_offset;
 2803|      0|    }
 2804|      0|    else {
 2805|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2806|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2806:11): [True: 0, False: 0]
  ------------------
 2807|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2808|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2809|      0|      }
 2810|      0|      io_pos = frame->file_offset + trailer_offset;
 2811|      0|    }
 2812|      0|    if (fp != NULL) {
  ------------------
  |  Branch (2812:9): [True: 0, False: 0]
  ------------------
 2813|      0|      rbytes = io_cb->read((void**)&trailer, 1, trailer_len, io_pos, fp);
 2814|      0|      frame_reader_release(frame, io_cb, fp);
 2815|      0|    }
 2816|      0|    if (rbytes != trailer_len) {
  ------------------
  |  Branch (2816:9): [True: 0, False: 0]
  ------------------
 2817|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2818|      0|      if (needs_free)
  ------------------
  |  Branch (2818:11): [True: 0, False: 0]
  ------------------
 2819|      0|        free(trailer);
 2820|      0|      return BLOSC2_ERROR_FILE_READ;
 2821|      0|    }
 2822|      0|  }
 2823|       |
 2824|    870|  ret = get_vlmeta_from_trailer(frame, schunk, trailer, trailer_len);
 2825|       |
 2826|    870|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (2826:7): [True: 0, False: 870]
  |  Branch (2826:32): [True: 0, False: 0]
  ------------------
 2827|      0|    free(trailer);
 2828|      0|  }
 2829|       |
 2830|    870|  return ret;
 2831|    870|}
get_new_storage:
 2837|  12.8k|                                const blosc2_io* iodefaults) {
 2838|       |
 2839|  12.8k|  blosc2_storage* new_storage = (blosc2_storage*)calloc(1, sizeof(blosc2_storage));
 2840|  12.8k|  memcpy(new_storage, storage, sizeof(blosc2_storage));
 2841|  12.8k|  if (storage->urlpath != NULL) {
  ------------------
  |  Branch (2841:7): [True: 0, False: 12.8k]
  ------------------
 2842|      0|    char* urlpath = normalize_urlpath(storage->urlpath);
 2843|      0|    new_storage->urlpath = malloc(strlen(urlpath) + 1);
 2844|      0|    strcpy(new_storage->urlpath, urlpath);
 2845|      0|  }
 2846|       |
 2847|       |  // cparams
 2848|  12.8k|  blosc2_cparams* cparams = malloc(sizeof(blosc2_cparams));
 2849|  12.8k|  if (storage->cparams != NULL) {
  ------------------
  |  Branch (2849:7): [True: 0, False: 12.8k]
  ------------------
 2850|      0|    memcpy(cparams, storage->cparams, sizeof(blosc2_cparams));
 2851|  12.8k|  } else {
 2852|  12.8k|    memcpy(cparams, cdefaults, sizeof(blosc2_cparams));
 2853|  12.8k|  }
 2854|  12.8k|  new_storage->cparams = cparams;
 2855|       |
 2856|       |  // dparams
 2857|  12.8k|  blosc2_dparams* dparams = malloc(sizeof(blosc2_dparams));
 2858|  12.8k|  if (storage->dparams != NULL) {
  ------------------
  |  Branch (2858:7): [True: 0, False: 12.8k]
  ------------------
 2859|      0|    memcpy(dparams, storage->dparams, sizeof(blosc2_dparams));
 2860|      0|  }
 2861|  12.8k|  else {
 2862|  12.8k|    memcpy(dparams, ddefaults, sizeof(blosc2_dparams));
 2863|  12.8k|  }
 2864|  12.8k|  new_storage->dparams = dparams;
 2865|       |
 2866|       |  // iodefaults
 2867|  12.8k|  blosc2_io* udio = malloc(sizeof(blosc2_io));
 2868|  12.8k|  if (storage->io != NULL) {
  ------------------
  |  Branch (2868:7): [True: 0, False: 12.8k]
  ------------------
 2869|      0|    memcpy(udio, storage->io, sizeof(blosc2_io));
 2870|      0|  }
 2871|  12.8k|  else {
 2872|  12.8k|    memcpy(udio, iodefaults, sizeof(blosc2_io));
 2873|  12.8k|  }
 2874|  12.8k|  new_storage->io = udio;
 2875|       |
 2876|  12.8k|  return new_storage;
 2877|  12.8k|}
frame_to_schunk:
 2941|  13.6k|blosc2_schunk* frame_to_schunk(blosc2_frame_s* frame, bool copy, const blosc2_io *udio) {
 2942|  13.6k|  int32_t header_len;
 2943|  13.6k|  int64_t frame_len;
 2944|  13.6k|  int rc;
 2945|  13.6k|  bool frame_attached = true;
 2946|  13.6k|  blosc2_schunk* schunk = calloc(1, sizeof(blosc2_schunk));
 2947|  13.6k|  blosc2_cparams *cparams = NULL;
 2948|  13.6k|  blosc2_dparams *dparams = NULL;
 2949|  13.6k|  int64_t *offsets = NULL;
 2950|  13.6k|  if (schunk == NULL) {
  ------------------
  |  Branch (2950:7): [True: 0, False: 13.6k]
  ------------------
 2951|      0|    return NULL;
 2952|      0|  }
 2953|  13.6k|  schunk->frame = (blosc2_frame*)frame;
 2954|  13.6k|  frame->schunk = schunk;
 2955|       |
 2956|  13.6k|  rc = get_header_info(frame, &header_len, &frame_len, &schunk->nbytes,
 2957|  13.6k|                       &schunk->cbytes, &schunk->blocksize,
 2958|  13.6k|                       &schunk->chunksize, &schunk->nchunks, &schunk->typesize,
 2959|  13.6k|                       &schunk->compcode, &schunk->compcode_meta, &schunk->clevel, schunk->filters,
 2960|  13.6k|                       schunk->filters_meta, &schunk->splitmode, &schunk->use_dict, udio);
 2961|  13.6k|  if (rc < 0) {
  ------------------
  |  Branch (2961:7): [True: 718, False: 12.8k]
  ------------------
 2962|    718|    BLOSC_TRACE_ERROR("Unable to get meta info from frame.");
  ------------------
  |  |   93|    718|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    718|    do {                                            \
  |  |  |  |   98|    718|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    718|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 718, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    718|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2963|    718|    goto error;
 2964|    718|  }
 2965|  12.8k|  int64_t nchunks = schunk->nchunks;
 2966|  12.8k|  int64_t nbytes = schunk->nbytes;
 2967|  12.8k|  (void) nbytes;
 2968|  12.8k|  int64_t cbytes = schunk->cbytes;
 2969|       |
 2970|       |  // Compression and decompression contexts
 2971|  12.8k|  blosc2_schunk_get_cparams(schunk, &cparams);
 2972|  12.8k|  schunk->cctx = blosc2_create_cctx(*cparams);
 2973|  12.8k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (2973:7): [True: 70, False: 12.8k]
  ------------------
 2974|     70|    BLOSC_TRACE_ERROR("Error while creating the compression context");
  ------------------
  |  |   93|     70|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     70|    do {                                            \
  |  |  |  |   98|     70|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     70|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 70, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     70|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2975|     70|    goto error;
 2976|     70|  }
 2977|  12.8k|  blosc2_schunk_get_dparams(schunk, &dparams);
 2978|  12.8k|  schunk->dctx = blosc2_create_dctx(*dparams);
 2979|  12.8k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (2979:7): [True: 0, False: 12.8k]
  ------------------
 2980|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2981|      0|    goto error;
 2982|      0|  }
 2983|  12.8k|  blosc2_storage storage = {.contiguous = copy ? false : true};
  ------------------
  |  Branch (2983:43): [True: 0, False: 12.8k]
  ------------------
 2984|  12.8k|  schunk->storage = get_new_storage(&storage, cparams, dparams, udio);
 2985|  12.8k|  free(cparams);
 2986|  12.8k|  cparams = NULL;
 2987|  12.8k|  free(dparams);
 2988|  12.8k|  dparams = NULL;
 2989|  12.8k|  if (nchunks > 0) {
  ------------------
  |  Branch (2989:7): [True: 12.5k, False: 240]
  ------------------
 2990|  12.5k|    rc = validate_offsets_chunk(frame, header_len, cbytes, nchunks);
 2991|  12.5k|    if (rc < 0) {
  ------------------
  |  Branch (2991:9): [True: 10.9k, False: 1.68k]
  ------------------
 2992|  10.9k|      BLOSC_TRACE_ERROR("Cannot validate frame offsets.");
  ------------------
  |  |   93|  10.9k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  10.9k|    do {                                            \
  |  |  |  |   98|  10.9k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  10.9k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10.9k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  10.9k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2993|  10.9k|      goto error;
 2994|  10.9k|    }
 2995|  12.5k|  }
 2996|  1.92k|  if (nchunks > 0) {
  ------------------
  |  Branch (2996:7): [True: 1.68k, False: 240]
  ------------------
 2997|  1.68k|    uint8_t *chunk;
 2998|  1.68k|    bool needs_free;
 2999|       |    // A lazy chunk is enough here: only the header is needed for the flags2 byte
 3000|  1.68k|    rc = frame_get_lazychunk(frame, 0, &chunk, &needs_free);
 3001|  1.68k|    if (rc < 0) {
  ------------------
  |  Branch (3001:9): [True: 876, False: 806]
  ------------------
 3002|    876|      BLOSC_TRACE_ERROR("Cannot inspect the first chunk in frame.");
  ------------------
  |  |   93|    876|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    876|    do {                                            \
  |  |  |  |   98|    876|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    876|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 876, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    876|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3003|    876|      goto error;
 3004|    876|    }
 3005|    806|    schunk->flags2 = chunk[BLOSC2_CHUNK_BLOSC2_FLAGS2];
 3006|    806|    if (needs_free) {
  ------------------
  |  Branch (3006:9): [True: 403, False: 403]
  ------------------
 3007|    403|      free(chunk);
 3008|    403|    }
 3009|    806|  }
 3010|  1.04k|  if (!copy) {
  ------------------
  |  Branch (3010:7): [True: 1.04k, False: 0]
  ------------------
 3011|  1.04k|    goto out;
 3012|  1.04k|  }
 3013|       |
 3014|       |  // We are not attached to a frame anymore
 3015|      0|  schunk->frame = NULL;
 3016|      0|  frame_attached = false;
 3017|       |
 3018|      0|  if (nchunks == 0) {
  ------------------
  |  Branch (3018:7): [True: 0, False: 0]
  ------------------
 3019|      0|    frame->schunk = NULL;
 3020|      0|    goto out;
 3021|      0|  }
 3022|       |
 3023|       |  // Get the compressed offsets
 3024|      0|  int32_t coffsets_cbytes = 0;
 3025|      0|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 3026|      0|  if (coffsets == NULL) {
  ------------------
  |  Branch (3026:7): [True: 0, False: 0]
  ------------------
 3027|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3028|      0|    goto error;
 3029|      0|  }
 3030|       |
 3031|       |  // Decompress offsets
 3032|      0|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 3033|      0|  blosc2_context *dctx = blosc2_create_dctx(off_dparams);
 3034|      0|  if (dctx == NULL) {
  ------------------
  |  Branch (3034:7): [True: 0, False: 0]
  ------------------
 3035|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3036|      0|    goto error;
 3037|      0|  }
 3038|      0|  int32_t offsets_nbytes;
 3039|      0|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (3039:7): [True: 0, False: 0]
  ------------------
 3040|      0|    blosc2_free_ctx(dctx);
 3041|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3042|      0|    goto error;
 3043|      0|  }
 3044|      0|  offsets = (int64_t *) malloc((size_t)offsets_nbytes);
 3045|      0|  if (offsets == NULL) {
  ------------------
  |  Branch (3045:7): [True: 0, False: 0]
  ------------------
 3046|      0|    blosc2_free_ctx(dctx);
 3047|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3048|      0|    goto error;
 3049|      0|  }
 3050|      0|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 3051|      0|                                             offsets, offsets_nbytes);
 3052|      0|  blosc2_free_ctx(dctx);
 3053|      0|  if (off_nbytes < 0) {
  ------------------
  |  Branch (3053:7): [True: 0, False: 0]
  ------------------
 3054|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3055|      0|    goto error;
 3056|      0|  }
 3057|       |
 3058|       |  // We want the contiguous schunk, so create the actual data chunks (and, while doing this,
 3059|       |  // get a guess at the blocksize used in this frame)
 3060|      0|  int64_t acc_nbytes = 0;
 3061|      0|  int64_t acc_cbytes = 0;
 3062|      0|  int32_t blocksize = 0;
 3063|      0|  int32_t chunk_nbytes;
 3064|      0|  int32_t chunk_cbytes;
 3065|      0|  int32_t chunk_blocksize;
 3066|      0|  size_t prev_alloc = BLOSC_EXTENDED_HEADER_LENGTH;
 3067|      0|  uint8_t* data_chunk = NULL;
 3068|      0|  bool needs_free = false;
 3069|      0|  const blosc2_io_cb *io_cb = blosc2_get_io_cb(udio->id);
 3070|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (3070:7): [True: 0, False: 0]
  ------------------
 3071|      0|    blosc2_schunk_free(schunk);
 3072|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3073|      0|    return NULL;
 3074|      0|  }
 3075|       |
 3076|      0|  void* fp = NULL;
 3077|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3077:7): [True: 0, False: 0]
  ------------------
 3078|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3078:9): [True: 0, False: 0]
  ------------------
 3079|      0|      data_chunk = malloc((size_t)prev_alloc);
 3080|      0|      needs_free = true;
 3081|      0|    }
 3082|      0|    else {
 3083|      0|      needs_free = false;
 3084|      0|    }
 3085|       |
 3086|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (3086:9): [True: 0, False: 0]
  ------------------
 3087|       |      // If not the chunks won't be in the frame
 3088|      0|      fp = frame_reader_acquire(frame, udio);
 3089|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3089:11): [True: 0, False: 0]
  ------------------
 3090|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3091|      0|        rc = BLOSC2_ERROR_FILE_OPEN;
 3092|      0|        goto end;
 3093|      0|      }
 3094|      0|    }
 3095|      0|  }
 3096|      0|  schunk->data = malloc(nchunks * sizeof(void*));
 3097|      0|  for (int64_t i = 0; i < nchunks; i++) {
  ------------------
  |  Branch (3097:23): [True: 0, False: 0]
  ------------------
 3098|      0|    if (frame->cframe != NULL) {
  ------------------
  |  Branch (3098:9): [True: 0, False: 0]
  ------------------
 3099|      0|      if (needs_free) {
  ------------------
  |  Branch (3099:11): [True: 0, False: 0]
  ------------------
 3100|      0|        free(data_chunk);
 3101|      0|      }
 3102|      0|      if (offsets[i] < 0) {
  ------------------
  |  Branch (3102:11): [True: 0, False: 0]
  ------------------
 3103|      0|        int64_t rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 3104|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (3104:13): [True: 0, False: 0]
  ------------------
 3105|      0|          break;
 3106|      0|        }
 3107|      0|      }
 3108|      0|      else {
 3109|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (3109:13): [True: 0, False: 0]
  ------------------
 3110|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3110:13): [True: 0, False: 0]
  ------------------
 3111|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3111:13): [True: 0, False: 0]
  ------------------
 3112|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3113|      0|          break;
 3114|      0|        }
 3115|      0|        data_chunk = frame->cframe + header_len + offsets[i];
 3116|      0|        needs_free = false;
 3117|      0|      }
 3118|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 3119|      0|      if (rc < 0) {
  ------------------
  |  Branch (3119:11): [True: 0, False: 0]
  ------------------
 3120|      0|        break;
 3121|      0|      }
 3122|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (3122:11): [True: 0, False: 0]
  ------------------
 3123|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3123:12): [True: 0, False: 0]
  ------------------
 3124|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3124:12): [True: 0, False: 0]
  ------------------
 3125|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (3125:12): [True: 0, False: 0]
  ------------------
 3126|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3127|      0|        break;
 3128|      0|      }
 3129|      0|    }
 3130|      0|    else {
 3131|      0|      int64_t rbytes;
 3132|      0|      if (offsets[i] < 0 || frame->sframe) {
  ------------------
  |  Branch (3132:11): [True: 0, False: 0]
  |  Branch (3132:29): [True: 0, False: 0]
  ------------------
 3133|      0|        if (needs_free) {
  ------------------
  |  Branch (3133:13): [True: 0, False: 0]
  ------------------
 3134|      0|          free(data_chunk);
 3135|      0|        }
 3136|      0|        rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 3137|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (3137:13): [True: 0, False: 0]
  ------------------
 3138|      0|          break;
 3139|      0|        }
 3140|      0|      }
 3141|      0|      else {
 3142|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (3142:13): [True: 0, False: 0]
  ------------------
 3143|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3143:13): [True: 0, False: 0]
  ------------------
 3144|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3144:13): [True: 0, False: 0]
  ------------------
 3145|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3146|      0|          break;
 3147|      0|        }
 3148|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 3149|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 3150|      0|      }
 3151|      0|      if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3151:11): [True: 0, False: 0]
  ------------------
 3152|      0|        rc = BLOSC2_ERROR_READ_BUFFER;
 3153|      0|        break;
 3154|      0|      }
 3155|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 3156|      0|      if (rc < 0) {
  ------------------
  |  Branch (3156:11): [True: 0, False: 0]
  ------------------
 3157|      0|        break;
 3158|      0|      }
 3159|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (3159:11): [True: 0, False: 0]
  ------------------
 3160|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3160:12): [True: 0, False: 0]
  ------------------
 3161|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3161:12): [True: 0, False: 0]
  ------------------
 3162|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (3162:12): [True: 0, False: 0]
  ------------------
 3163|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3164|      0|        break;
 3165|      0|      }
 3166|      0|      if (chunk_cbytes > (int32_t)prev_alloc) {
  ------------------
  |  Branch (3166:11): [True: 0, False: 0]
  ------------------
 3167|      0|        if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3167:13): [True: 0, False: 0]
  ------------------
 3168|      0|          data_chunk = realloc(data_chunk, chunk_cbytes);
 3169|      0|        if (data_chunk == NULL) {
  ------------------
  |  Branch (3169:13): [True: 0, False: 0]
  ------------------
 3170|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3171|      0|          rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3172|      0|          break;
 3173|      0|        }
 3174|      0|        prev_alloc = chunk_cbytes;
 3175|      0|      }
 3176|      0|      if (!frame->sframe) {
  ------------------
  |  Branch (3176:11): [True: 0, False: 0]
  ------------------
 3177|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 3178|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, chunk_cbytes, io_pos, fp);
 3179|      0|        if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (3179:13): [True: 0, False: 0]
  ------------------
 3180|      0|          rc = BLOSC2_ERROR_READ_BUFFER;
 3181|      0|          break;
 3182|      0|        }
 3183|      0|      }
 3184|      0|    }
 3185|      0|    uint8_t* new_chunk = malloc(chunk_cbytes);
 3186|      0|    memcpy(new_chunk, data_chunk, chunk_cbytes);
 3187|      0|    schunk->data[i] = new_chunk;
 3188|      0|    rc = blosc2_cbuffer_sizes(data_chunk, &chunk_nbytes, NULL, &chunk_blocksize);
 3189|      0|    if (rc < 0) {
  ------------------
  |  Branch (3189:9): [True: 0, False: 0]
  ------------------
 3190|      0|      break;
 3191|      0|    }
 3192|      0|    acc_nbytes += chunk_nbytes;
 3193|      0|    acc_cbytes += chunk_cbytes;
 3194|      0|    if (i == 0) {
  ------------------
  |  Branch (3194:9): [True: 0, False: 0]
  ------------------
 3195|      0|      blocksize = chunk_blocksize;
 3196|      0|    }
 3197|      0|    else if (blocksize != chunk_blocksize) {
  ------------------
  |  Branch (3197:14): [True: 0, False: 0]
  ------------------
 3198|       |      // Blocksize varies
 3199|      0|      blocksize = 0;
 3200|      0|    }
 3201|      0|  }
 3202|       |
 3203|       |  // We are not attached to a schunk anymore
 3204|      0|  frame->schunk = NULL;
 3205|       |
 3206|      0|  end:
 3207|      0|  if (needs_free) {
  ------------------
  |  Branch (3207:7): [True: 0, False: 0]
  ------------------
 3208|      0|    free(data_chunk);
 3209|      0|  }
 3210|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3210:7): [True: 0, False: 0]
  ------------------
 3211|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (3211:9): [True: 0, False: 0]
  ------------------
 3212|      0|      frame_reader_release(frame, io_cb, fp);
 3213|      0|    }
 3214|      0|  }
 3215|      0|  free(offsets);
 3216|       |  // Avoid a double-free in the `error:` cleanup below, which is reached
 3217|       |  // when frame_get_metalayers / frame_get_vlmetalayers reject a malformed
 3218|       |  // metalayer index after we've already freed `offsets` here.
 3219|      0|  offsets = NULL;
 3220|       |
 3221|       |  // cframes and sframes have different ways to store chunks with special values:
 3222|       |  // 1) cframes represent special chunks as negative offsets
 3223|       |  // 2) sframes does not have the concept of offsets, but rather of data pointers (.data)
 3224|       |  //    so they always have a pointer to a special chunk
 3225|       |  // This is why cframes and sframes have different cbytes and hence, we cannot enforce acc_bytes == schunk->cbytes
 3226|       |  // In the future, maybe we could provide special meanings for .data[i] > 0x7FFFFFFF, but not there yet
 3227|       |  // if (rc < 0 || acc_nbytes != nbytes || acc_cbytes != cbytes) {
 3228|      0|  if (rc < 0 || acc_nbytes != nbytes) {
  ------------------
  |  Branch (3228:7): [True: 0, False: 0]
  |  Branch (3228:17): [True: 0, False: 0]
  ------------------
 3229|      0|    goto error;
 3230|      0|  }
 3231|       |  // Update counters
 3232|      0|  schunk->cbytes = acc_cbytes;
 3233|      0|  schunk->blocksize = blocksize;
 3234|       |
 3235|  1.04k|  out:
 3236|  1.04k|  rc = frame_get_metalayers(frame, schunk);
 3237|  1.04k|  if (rc < 0) {
  ------------------
  |  Branch (3237:7): [True: 161, False: 885]
  ------------------
 3238|    161|    BLOSC_TRACE_ERROR("Cannot access the metalayers.");
  ------------------
  |  |   93|    161|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    161|    do {                                            \
  |  |  |  |   98|    161|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    161|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 161, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    161|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3239|    161|    goto error;
 3240|    161|  }
 3241|       |
 3242|    885|  rc = frame_get_vlmetalayers(frame, schunk);
 3243|    885|  if (rc < 0) {
  ------------------
  |  Branch (3243:7): [True: 195, False: 690]
  ------------------
 3244|    195|    BLOSC_TRACE_ERROR("Cannot access the vlmetalayers.");
  ------------------
  |  |   93|    195|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    195|    do {                                            \
  |  |  |  |   98|    195|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    195|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 195, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    195|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3245|    195|    goto error;
 3246|    195|  }
 3247|       |
 3248|    690|  return schunk;
 3249|       |
 3250|  12.9k|error:
 3251|  12.9k|  free(cparams);
 3252|  12.9k|  free(dparams);
 3253|  12.9k|  free(offsets);
 3254|  12.9k|  if (schunk != NULL) {
  ------------------
  |  Branch (3254:7): [True: 12.9k, False: 0]
  ------------------
 3255|  12.9k|    blosc2_schunk_free(schunk);
 3256|  12.9k|  }
 3257|  12.9k|  if (!frame_attached) {
  ------------------
  |  Branch (3257:7): [True: 0, False: 12.9k]
  ------------------
 3258|      0|    frame->schunk = NULL;
 3259|      0|    frame_free(frame);
 3260|      0|  }
 3261|       |  return NULL;
 3262|    885|}
get_coffset:
 3284|  56.5k|                int64_t nchunk, int64_t nchunks, int64_t *offset) {
 3285|  56.5k|  int32_t off_cbytes;
 3286|       |  // Get the offset to nchunk
 3287|  56.5k|  uint8_t *coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &off_cbytes);
 3288|  56.5k|  if (coffsets == NULL) {
  ------------------
  |  Branch (3288:7): [True: 0, False: 56.5k]
  ------------------
 3289|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3290|      0|    return BLOSC2_ERROR_DATA;
 3291|      0|  }
 3292|       |
 3293|       |  // Get the 64-bit offset
 3294|  56.5k|  int rc = blosc2_getitem(coffsets, off_cbytes, (int32_t)nchunk, 1, offset, (int32_t)sizeof(int64_t));
 3295|  56.5k|  if (rc < 0) {
  ------------------
  |  Branch (3295:7): [True: 214, False: 56.3k]
  ------------------
 3296|    214|    BLOSC_TRACE_ERROR("Problems retrieving a chunk offset.");
  ------------------
  |  |   93|    214|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    214|    do {                                            \
  |  |  |  |   98|    214|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    214|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 214, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    214|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3297|  56.3k|  } else if (!frame->sframe && *offset >= 0) {
  ------------------
  |  Branch (3297:14): [True: 56.3k, False: 0]
  |  Branch (3297:32): [True: 46.3k, False: 9.94k]
  ------------------
 3298|  46.3k|    if (cbytes < 0 || cbytes > INT64_MAX - header_len) {
  ------------------
  |  Branch (3298:9): [True: 0, False: 46.3k]
  |  Branch (3298:23): [True: 210, False: 46.1k]
  ------------------
 3299|    210|      BLOSC_TRACE_ERROR("Invalid compressed size in frame header.");
  ------------------
  |  |   93|    210|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    210|    do {                                            \
  |  |  |  |   98|    210|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    210|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 210, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    210|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3300|    210|      return BLOSC2_ERROR_INVALID_HEADER;
 3301|    210|    }
 3302|  46.1k|    if (*offset > INT64_MAX - header_len) {
  ------------------
  |  Branch (3302:9): [True: 0, False: 46.1k]
  ------------------
 3303|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3304|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3305|      0|    }
 3306|  46.1k|    int64_t chunk_pos = header_len + *offset;
 3307|  46.1k|    int64_t data_limit = header_len + cbytes;
 3308|  46.1k|    if (chunk_pos < header_len ||
  ------------------
  |  Branch (3308:9): [True: 0, False: 46.1k]
  ------------------
 3309|  46.1k|        chunk_pos > data_limit - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3309:9): [True: 68, False: 46.1k]
  ------------------
 3310|  46.1k|        chunk_pos > frame->len - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3310:9): [True: 513, False: 45.5k]
  ------------------
 3311|    581|      BLOSC_TRACE_ERROR("Cannot read chunk %" PRId64 " outside of frame boundary.", nchunk);
  ------------------
  |  |   93|    581|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    581|    do {                                            \
  |  |  |  |   98|    581|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    581|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 581, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    581|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3312|    581|      return BLOSC2_ERROR_INVALID_HEADER;
 3313|    581|    }
 3314|  46.1k|  }
 3315|       |
 3316|  55.7k|  return rc;
 3317|  56.5k|}
frame_special_chunk:
 3322|  9.94k|                        uint8_t** chunk, int32_t cbytes, bool *needs_free) {
 3323|  9.94k|  int rc = 0;
 3324|  9.94k|  *chunk = malloc(cbytes);
 3325|  9.94k|  *needs_free = true;
 3326|       |
 3327|       |  // Detect the kind of special value
 3328|  9.94k|  uint64_t zeros_mask = (uint64_t) BLOSC2_SPECIAL_ZERO << (8 * 7);  // chunk of zeros
 3329|  9.94k|  uint64_t nans_mask = (uint64_t) BLOSC2_SPECIAL_NAN << (8 * 7);  // chunk of NaNs
 3330|  9.94k|  uint64_t uninit_mask = (uint64_t) BLOSC2_SPECIAL_UNINIT << (8 * 7);  // chunk of uninit values
 3331|       |
 3332|  9.94k|  blosc2_cparams cparams = BLOSC2_CPARAMS_DEFAULTS;
 3333|  9.94k|  cparams.typesize = typesize;
 3334|  9.94k|  cparams.blocksize = blocksize;
 3335|  9.94k|  if (special_value & zeros_mask) {
  ------------------
  |  Branch (3335:7): [True: 8.57k, False: 1.36k]
  ------------------
 3336|  8.57k|    rc = blosc2_chunk_zeros(cparams, nbytes, *chunk, cbytes);
 3337|  8.57k|    if (rc < 0) {
  ------------------
  |  Branch (3337:9): [True: 21, False: 8.55k]
  ------------------
 3338|     21|      BLOSC_TRACE_ERROR("Error creating a zero chunk");
  ------------------
  |  |   93|     21|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     21|    do {                                            \
  |  |  |  |   98|     21|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     21|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     21|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3339|     21|    }
 3340|  8.57k|  }
 3341|  1.36k|  else if (special_value & uninit_mask) {
  ------------------
  |  Branch (3341:12): [True: 775, False: 590]
  ------------------
 3342|    775|    rc = blosc2_chunk_uninit(cparams, nbytes, *chunk, cbytes);
 3343|    775|    if (rc < 0) {
  ------------------
  |  Branch (3343:9): [True: 6, False: 769]
  ------------------
 3344|      6|      BLOSC_TRACE_ERROR("Error creating a non initialized chunk");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3345|      6|    }
 3346|    775|  }
 3347|    590|  else if (special_value & nans_mask) {
  ------------------
  |  Branch (3347:12): [True: 573, False: 17]
  ------------------
 3348|    573|    rc = blosc2_chunk_nans(cparams, nbytes, *chunk, cbytes);
 3349|    573|    if (rc < 0) {
  ------------------
  |  Branch (3349:9): [True: 3, False: 570]
  ------------------
 3350|      3|      BLOSC_TRACE_ERROR("Error creating a nan chunk");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3351|      3|    }
 3352|    573|  }
 3353|     17|  else {
 3354|     17|    BLOSC_TRACE_ERROR("Special value not recognized: %" PRId64 "", special_value);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3355|     17|    rc = BLOSC2_ERROR_DATA;
 3356|     17|  }
 3357|       |
 3358|  9.94k|  if (rc < 0) {
  ------------------
  |  Branch (3358:7): [True: 47, False: 9.89k]
  ------------------
 3359|     47|    free(*chunk);
 3360|     47|    *needs_free = false;
 3361|     47|    *chunk = NULL;
 3362|     47|  }
 3363|       |
 3364|  9.94k|  return rc;
 3365|  9.94k|}
frame_get_chunk:
 3378|  54.8k|int frame_get_chunk(blosc2_frame_s *frame, int64_t nchunk, uint8_t **chunk, bool *needs_free) {
 3379|  54.8k|  int32_t header_len;
 3380|  54.8k|  int64_t frame_len;
 3381|  54.8k|  int64_t nbytes;
 3382|  54.8k|  int64_t cbytes;
 3383|  54.8k|  int32_t blocksize;
 3384|  54.8k|  int32_t chunksize;
 3385|  54.8k|  int64_t nchunks;
 3386|  54.8k|  int32_t typesize;
 3387|  54.8k|  int64_t offset;
 3388|  54.8k|  int32_t chunk_cbytes;
 3389|  54.8k|  int rc;
 3390|       |
 3391|  54.8k|  *chunk = NULL;
 3392|  54.8k|  *needs_free = false;
 3393|  54.8k|  rc = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 3394|  54.8k|                       &blocksize, &chunksize, &nchunks,
 3395|  54.8k|                       &typesize, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 3396|  54.8k|                       frame->schunk->storage->io);
 3397|  54.8k|  if (rc < 0) {
  ------------------
  |  Branch (3397:7): [True: 0, False: 54.8k]
  ------------------
 3398|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3399|      0|    return rc;
 3400|      0|  }
 3401|  54.8k|  rc = frame_refresh_if_stale(frame, frame_len);
 3402|  54.8k|  if (rc < 0) {
  ------------------
  |  Branch (3402:7): [True: 0, False: 54.8k]
  ------------------
 3403|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3404|      0|    return rc;
 3405|      0|  }
 3406|  54.8k|  if (rc > 0) {
  ------------------
  |  Branch (3406:7): [True: 0, False: 54.8k]
  ------------------
 3407|       |    // Keep the schunk-level counters in sync with the refreshed on-disk state.
 3408|       |    // Mutating ops (update/delete) read a chunk before adjusting the counters,
 3409|       |    // so this also gives them a fresh base to apply their deltas on.
 3410|      0|    frame->schunk->nbytes = nbytes;
 3411|      0|    frame->schunk->cbytes = cbytes;
 3412|      0|    frame->schunk->nchunks = nchunks;
 3413|      0|  }
 3414|       |
 3415|  54.8k|  if ((nchunks > 0) && (nchunk >= nchunks)) {
  ------------------
  |  Branch (3415:7): [True: 54.8k, False: 0]
  |  Branch (3415:24): [True: 0, False: 54.8k]
  ------------------
 3416|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3417|      0|                    "('%" PRId64 "') in frame.", nchunk, nchunks);
 3418|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3419|      0|  }
 3420|       |
 3421|       |  // Get the offset to nchunk
 3422|  54.8k|  rc = get_coffset(frame, header_len, cbytes, nchunk, nchunks, &offset);
 3423|  54.8k|  if (rc < 0) {
  ------------------
  |  Branch (3423:7): [True: 190, False: 54.6k]
  ------------------
 3424|    190|    BLOSC_TRACE_ERROR("Unable to get offset to chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    190|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    190|    do {                                            \
  |  |  |  |   98|    190|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    190|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 190, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    190|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3425|    190|    return rc;
 3426|    190|  }
 3427|       |
 3428|  54.6k|  if (offset < 0) {
  ------------------
  |  Branch (3428:7): [True: 9.50k, False: 45.1k]
  ------------------
 3429|       |    // Special value
 3430|  9.50k|    chunk_cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 3431|  9.50k|    int32_t chunksize_ = chunksize;
 3432|  9.50k|    if ((nchunk == nchunks - 1) && (nbytes % chunksize)) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 9.50k]
  |  Branch (3432:36): [True: 0, False: 0]
  ------------------
 3433|       |      // Last chunk is incomplete.  Compute its actual size.
 3434|      0|      chunksize_ = (int32_t) (nbytes % chunksize);
 3435|      0|    }
 3436|  9.50k|    rc = frame_special_chunk(offset, chunksize_, typesize, blocksize, chunk, chunk_cbytes, needs_free);
 3437|  9.50k|    if (rc < 0) {
  ------------------
  |  Branch (3437:9): [True: 10, False: 9.49k]
  ------------------
 3438|     10|      return rc;
 3439|     10|    }
 3440|  9.49k|    goto end;
 3441|  9.50k|  }
 3442|       |
 3443|  45.1k|  if (frame->sframe) {
  ------------------
  |  Branch (3443:7): [True: 0, False: 45.1k]
  ------------------
 3444|       |    // Sparse on-disk
 3445|      0|    nchunk = offset;
 3446|      0|    return sframe_get_chunk(frame, nchunk, chunk, needs_free);
 3447|      0|  }
 3448|       |
 3449|  45.1k|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 3450|  45.1k|  if (io_cb == NULL) {
  ------------------
  |  Branch (3450:7): [True: 0, False: 45.1k]
  ------------------
 3451|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3452|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 3453|      0|  }
 3454|       |
 3455|  45.1k|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3455:7): [True: 0, False: 45.1k]
  ------------------
 3456|      0|    uint8_t* header_ptr;
 3457|      0|    uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 3458|      0|    void* fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 3459|      0|    if (fp == NULL) {
  ------------------
  |  Branch (3459:9): [True: 0, False: 0]
  ------------------
 3460|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3461|      0|      return BLOSC2_ERROR_FILE_OPEN;
 3462|      0|    }
 3463|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3463:9): [True: 0, False: 0]
  ------------------
 3464|      0|      header_ptr = header;
 3465|      0|    int64_t io_pos = frame->file_offset + header_len + offset;
 3466|      0|    int64_t rbytes = io_cb->read((void**)&header_ptr, 1, sizeof(header), io_pos, fp);
 3467|      0|    if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3467:9): [True: 0, False: 0]
  ------------------
 3468|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3469|      0|      frame_reader_release(frame, io_cb, fp);
 3470|      0|      return BLOSC2_ERROR_FILE_READ;
 3471|      0|    }
 3472|      0|    rc = blosc2_cbuffer_sizes(header_ptr, NULL, &chunk_cbytes, NULL);
 3473|      0|    if (rc < 0) {
  ------------------
  |  Branch (3473:9): [True: 0, False: 0]
  ------------------
 3474|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3475|      0|      frame_reader_release(frame, io_cb, fp);
 3476|      0|      return rc;
 3477|      0|    }
 3478|      0|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3478:9): [True: 0, False: 0]
  ------------------
 3479|      0|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3479:9): [True: 0, False: 0]
  ------------------
 3480|      0|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (3480:9): [True: 0, False: 0]
  ------------------
 3481|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3482|      0|      frame_reader_release(frame, io_cb, fp);
 3483|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3484|      0|    }
 3485|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3485:9): [True: 0, False: 0]
  ------------------
 3486|      0|      *chunk = malloc(chunk_cbytes);
 3487|      0|      *needs_free = true;
 3488|      0|    }
 3489|      0|    else {
 3490|      0|      *needs_free = false;
 3491|      0|    }
 3492|       |
 3493|      0|    io_pos = frame->file_offset + header_len + offset;
 3494|      0|    rbytes = io_cb->read((void**)chunk, 1, chunk_cbytes, io_pos, fp);
 3495|      0|    frame_reader_release(frame, io_cb, fp);
 3496|      0|    if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (3496:9): [True: 0, False: 0]
  ------------------
 3497|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3498|      0|      return BLOSC2_ERROR_FILE_READ;
 3499|      0|    }
 3500|       |
 3501|  45.1k|  } else {
 3502|       |    // The chunk is in memory and just one pointer away
 3503|  45.1k|    *chunk = frame->cframe + header_len + offset;
 3504|  45.1k|    rc = blosc2_cbuffer_sizes(*chunk, NULL, &chunk_cbytes, NULL);
 3505|  45.1k|    if (rc < 0) {
  ------------------
  |  Branch (3505:9): [True: 9, False: 45.1k]
  ------------------
 3506|      9|      return rc;
 3507|      9|    }
 3508|  45.1k|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3508:9): [True: 1, False: 45.1k]
  ------------------
 3509|  45.1k|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3509:9): [True: 0, False: 45.1k]
  ------------------
 3510|  45.1k|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (3510:9): [True: 43, False: 45.1k]
  ------------------
 3511|     44|      BLOSC_TRACE_ERROR("Invalid chunk size in frame for chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|     44|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     44|    do {                                            \
  |  |  |  |   98|     44|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     44|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     44|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3512|     44|      return BLOSC2_ERROR_INVALID_HEADER;
 3513|     44|    }
 3514|  45.1k|  }
 3515|       |
 3516|  54.6k|  end:
 3517|  54.6k|  return (int32_t)chunk_cbytes;
 3518|  45.1k|}
frame_get_lazychunk:
 3531|  1.68k|int frame_get_lazychunk(blosc2_frame_s *frame, int64_t nchunk, uint8_t **chunk, bool *needs_free) {
 3532|  1.68k|  int32_t header_len;
 3533|  1.68k|  int64_t frame_len;
 3534|  1.68k|  int64_t nbytes;
 3535|  1.68k|  int64_t cbytes;
 3536|  1.68k|  int32_t blocksize;
 3537|  1.68k|  int32_t chunksize;
 3538|  1.68k|  int64_t nchunks;
 3539|  1.68k|  int32_t typesize;
 3540|  1.68k|  int32_t lazychunk_cbytes;
 3541|  1.68k|  int64_t offset;
 3542|  1.68k|  void* fp = NULL;
 3543|  1.68k|  int32_t* block_csizes = NULL;
 3544|  1.68k|  struct csize_idx *csize_idx = NULL;
 3545|       |
 3546|  1.68k|  *chunk = NULL;
 3547|  1.68k|  *needs_free = false;
 3548|  1.68k|  int rc = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 3549|  1.68k|                           &blocksize, &chunksize, &nchunks,
 3550|  1.68k|                           &typesize, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 3551|  1.68k|                           frame->schunk->storage->io);
 3552|  1.68k|  if (rc < 0) {
  ------------------
  |  Branch (3552:7): [True: 0, False: 1.68k]
  ------------------
 3553|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3554|      0|    return rc;
 3555|      0|  }
 3556|  1.68k|  rc = frame_refresh_if_stale(frame, frame_len);
 3557|  1.68k|  if (rc < 0) {
  ------------------
  |  Branch (3557:7): [True: 0, False: 1.68k]
  ------------------
 3558|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3559|      0|    return rc;
 3560|      0|  }
 3561|  1.68k|  if (rc > 0) {
  ------------------
  |  Branch (3561:7): [True: 0, False: 1.68k]
  ------------------
 3562|       |    // Keep the schunk-level counters in sync with the refreshed on-disk state
 3563|       |    // (see frame_get_chunk).
 3564|      0|    frame->schunk->nbytes = nbytes;
 3565|      0|    frame->schunk->cbytes = cbytes;
 3566|      0|    frame->schunk->nchunks = nchunks;
 3567|      0|  }
 3568|       |
 3569|  1.68k|  if (nchunk >= nchunks) {
  ------------------
  |  Branch (3569:7): [True: 0, False: 1.68k]
  ------------------
 3570|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3571|      0|                      "('%" PRId64 "') in frame.", nchunk, nchunks);
 3572|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3573|      0|  }
 3574|       |
 3575|       |  // Get the offset to nchunk
 3576|  1.68k|  rc = get_coffset(frame, header_len, cbytes, nchunk, nchunks, &offset);
 3577|  1.68k|  if (rc < 0) {
  ------------------
  |  Branch (3577:7): [True: 815, False: 867]
  ------------------
 3578|    815|    BLOSC_TRACE_ERROR("Unable to get offset to chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    815|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    815|    do {                                            \
  |  |  |  |   98|    815|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    815|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 815, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    815|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3579|    815|    return rc;
 3580|    815|  }
 3581|       |
 3582|    867|  if (offset < 0) {
  ------------------
  |  Branch (3582:7): [True: 440, False: 427]
  ------------------
 3583|       |    // Special value
 3584|    440|    lazychunk_cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 3585|    440|    int32_t chunksize_ = chunksize;
 3586|    440|    if ((nchunk == nchunks - 1) && (nbytes % chunksize)) {
  ------------------
  |  Branch (3586:9): [True: 4, False: 436]
  |  Branch (3586:36): [True: 4, False: 0]
  ------------------
 3587|       |      // Last chunk is incomplete.  Compute its actual size.
 3588|      4|      chunksize_ = (int32_t) (nbytes % chunksize);
 3589|      4|    }
 3590|    440|    rc = frame_special_chunk(offset, chunksize_, typesize, blocksize, chunk,
 3591|    440|                             (int32_t)lazychunk_cbytes, needs_free);
 3592|    440|    goto end;
 3593|    440|  }
 3594|       |
 3595|    427|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 3596|    427|  if (io_cb == NULL) {
  ------------------
  |  Branch (3596:7): [True: 0, False: 427]
  ------------------
 3597|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3598|      0|    rc = BLOSC2_ERROR_PLUGIN_IO;
 3599|      0|    goto end;
 3600|      0|  }
 3601|       |
 3602|    427|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3602:7): [True: 0, False: 427]
  ------------------
 3603|       |    // TODO: make this portable across different endianness
 3604|       |    // Get info for building a lazy chunk
 3605|      0|    int32_t chunk_nbytes;
 3606|      0|    int32_t chunk_cbytes;
 3607|      0|    int32_t chunk_blocksize;
 3608|      0|    uint8_t* header_ptr;
 3609|      0|    uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 3610|      0|    int64_t io_pos = 0;
 3611|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3611:9): [True: 0, False: 0]
  ------------------
 3612|       |      // The chunk is not in the frame
 3613|      0|      fp = sframe_open_chunk(frame->urlpath, offset, "rb",
 3614|      0|                             frame->schunk->storage->io);
 3615|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3615:11): [True: 0, False: 0]
  ------------------
 3616|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3617|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3618|      0|      }
 3619|      0|    }
 3620|      0|    else {
 3621|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 3622|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3622:11): [True: 0, False: 0]
  ------------------
 3623|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3624|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3625|      0|      }
 3626|      0|      io_pos = frame->file_offset + header_len + offset;
 3627|      0|    }
 3628|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3628:9): [True: 0, False: 0]
  ------------------
 3629|      0|      header_ptr = header;
 3630|      0|    int64_t rbytes = io_cb->read((void**)&header_ptr, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 3631|      0|    if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3631:9): [True: 0, False: 0]
  ------------------
 3632|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3633|      0|      rc = BLOSC2_ERROR_FILE_READ;
 3634|      0|      goto end;
 3635|      0|    }
 3636|      0|    rc = blosc2_cbuffer_sizes(header_ptr, &chunk_nbytes, &chunk_cbytes, &chunk_blocksize);
 3637|      0|    if (rc < 0) {
  ------------------
  |  Branch (3637:9): [True: 0, False: 0]
  ------------------
 3638|      0|      goto end;
 3639|      0|    }
 3640|      0|    if (chunk_nbytes < 0 || chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH || chunk_blocksize <= 0) {
  ------------------
  |  Branch (3640:9): [True: 0, False: 0]
  |  Branch (3640:29): [True: 0, False: 0]
  |  Branch (3640:76): [True: 0, False: 0]
  ------------------
 3641|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3642|      0|      goto end;
 3643|      0|    }
 3644|      0|    bool vlblocks = (header_ptr[BLOSC2_CHUNK_BLOSC2_FLAGS2] & BLOSC2_VL_BLOCKS) != 0;
 3645|      0|    size_t nblocks;
 3646|      0|    size_t leftover_block = 0;
 3647|      0|    if (vlblocks) {
  ------------------
  |  Branch (3647:9): [True: 0, False: 0]
  ------------------
 3648|      0|      nblocks = (size_t)chunk_blocksize;
 3649|      0|    }
 3650|      0|    else {
 3651|      0|      nblocks = (size_t)chunk_nbytes / (size_t)chunk_blocksize;
 3652|      0|      leftover_block = (size_t)chunk_nbytes % (size_t)chunk_blocksize;
 3653|      0|      if (leftover_block) {
  ------------------
  |  Branch (3653:11): [True: 0, False: 0]
  ------------------
 3654|      0|        if (nblocks == SIZE_MAX) {
  ------------------
  |  Branch (3654:13): [True: 0, False: 0]
  ------------------
 3655|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3656|      0|          goto end;
 3657|      0|        }
 3658|      0|        nblocks += 1;
 3659|      0|      }
 3660|      0|    }
 3661|      0|    if (nblocks == 0 || nblocks > (size_t)INT_MAX) {
  ------------------
  |  Branch (3661:9): [True: 0, False: 0]
  |  Branch (3661:25): [True: 0, False: 0]
  ------------------
 3662|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3663|      0|      goto end;
 3664|      0|    }
 3665|       |    // Allocate space for the lazy chunk
 3666|      0|    int32_t special_type = (header_ptr[BLOSC2_CHUNK_BLOSC2_FLAGS] >> 4) & BLOSC2_SPECIAL_MASK;
 3667|      0|    int memcpyed = header_ptr[BLOSC2_CHUNK_FLAGS] & (uint8_t) BLOSC_MEMCPYED;
 3668|       |
 3669|      0|    int32_t trailer_offset;
 3670|      0|    size_t streams_offset = BLOSC_EXTENDED_HEADER_LENGTH;
 3671|      0|    size_t trailer_offset_sz = BLOSC_EXTENDED_HEADER_LENGTH;
 3672|      0|    size_t trailer_len_sz = 0;
 3673|      0|    size_t lazychunk_cbytes_sz = 0;
 3674|      0|    size_t bstarts_nbytes = 0;
 3675|      0|    if (special_type == 0) {
  ------------------
  |  Branch (3675:9): [True: 0, False: 0]
  ------------------
 3676|      0|      if (nblocks > SIZE_MAX / sizeof(int32_t)) {
  ------------------
  |  Branch (3676:11): [True: 0, False: 0]
  ------------------
 3677|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3678|      0|        goto end;
 3679|      0|      }
 3680|      0|      bstarts_nbytes = nblocks * sizeof(int32_t);
 3681|       |
 3682|      0|      if (!memcpyed) {
  ------------------
  |  Branch (3682:11): [True: 0, False: 0]
  ------------------
 3683|      0|        if ((size_t)chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3683:13): [True: 0, False: 0]
  ------------------
 3684|      0|            bstarts_nbytes > (size_t)chunk_cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3684:13): [True: 0, False: 0]
  ------------------
 3685|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3686|      0|          goto end;
 3687|      0|        }
 3688|      0|      }
 3689|       |
 3690|      0|      if (bstarts_nbytes > SIZE_MAX - trailer_offset_sz) {
  ------------------
  |  Branch (3690:11): [True: 0, False: 0]
  ------------------
 3691|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3692|      0|        goto end;
 3693|      0|      }
 3694|      0|      trailer_offset_sz += bstarts_nbytes;
 3695|       |      // Regular values have offsets for blocks
 3696|      0|      if (!memcpyed) {
  ------------------
  |  Branch (3696:11): [True: 0, False: 0]
  ------------------
 3697|      0|        if (bstarts_nbytes > SIZE_MAX - streams_offset) {
  ------------------
  |  Branch (3697:13): [True: 0, False: 0]
  ------------------
 3698|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3699|      0|          goto end;
 3700|      0|        }
 3701|      0|        streams_offset += bstarts_nbytes;
 3702|      0|      }
 3703|       |
 3704|      0|      if (bstarts_nbytes > SIZE_MAX - (sizeof(int32_t) + sizeof(int64_t))) {
  ------------------
  |  Branch (3704:11): [True: 0, False: 0]
  ------------------
 3705|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3706|      0|        goto end;
 3707|      0|      }
 3708|      0|      trailer_len_sz = sizeof(int32_t) + sizeof(int64_t) + bstarts_nbytes;
 3709|      0|      if (trailer_len_sz > SIZE_MAX - trailer_offset_sz) {
  ------------------
  |  Branch (3709:11): [True: 0, False: 0]
  ------------------
 3710|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3711|      0|        goto end;
 3712|      0|      }
 3713|      0|      lazychunk_cbytes_sz = trailer_offset_sz + trailer_len_sz;
 3714|      0|    }
 3715|      0|    else if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 0]
  ------------------
 3716|      0|      if (typesize <= 0) {
  ------------------
  |  Branch (3716:11): [True: 0, False: 0]
  ------------------
 3717|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3718|      0|        goto end;
 3719|      0|      }
 3720|      0|      if ((size_t)typesize > SIZE_MAX - trailer_offset_sz ||
  ------------------
  |  Branch (3720:11): [True: 0, False: 0]
  ------------------
 3721|      0|          (size_t)typesize > SIZE_MAX - streams_offset) {
  ------------------
  |  Branch (3721:11): [True: 0, False: 0]
  ------------------
 3722|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3723|      0|        goto end;
 3724|      0|      }
 3725|      0|      trailer_offset_sz += (size_t)typesize;
 3726|      0|      streams_offset += (size_t)typesize;
 3727|      0|      lazychunk_cbytes_sz = trailer_offset_sz;
 3728|      0|    }
 3729|      0|    else {
 3730|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3731|      0|      goto end;
 3732|      0|    }
 3733|       |
 3734|      0|    if (streams_offset > (size_t)chunk_cbytes ||
  ------------------
  |  Branch (3734:9): [True: 0, False: 0]
  ------------------
 3735|      0|        trailer_offset_sz > INT32_MAX ||
  ------------------
  |  Branch (3735:9): [True: 0, False: 0]
  ------------------
 3736|      0|        trailer_len_sz > INT32_MAX ||
  ------------------
  |  Branch (3736:9): [True: 0, False: 0]
  ------------------
 3737|      0|        lazychunk_cbytes_sz > INT32_MAX) {
  ------------------
  |  Branch (3737:9): [True: 0, False: 0]
  ------------------
 3738|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3739|      0|      goto end;
 3740|      0|    }
 3741|       |
 3742|      0|    trailer_offset = (int32_t)trailer_offset_sz;
 3743|      0|    lazychunk_cbytes = (int32_t)lazychunk_cbytes_sz;
 3744|       |
 3745|       |    // Read just the full header and bstarts section too (lazy partial length)
 3746|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3746:9): [True: 0, False: 0]
  ------------------
 3747|      0|      io_pos = 0;
 3748|      0|    }
 3749|      0|    else {
 3750|      0|      io_pos = frame->file_offset + header_len + offset;
 3751|      0|    }
 3752|       |
 3753|       |    // The case here is a bit special because more memory is allocated than read from the file
 3754|       |    // and the chunk is modified after reading. Due to the modification, we cannot directly use
 3755|       |    // the memory provided by the io
 3756|      0|    *chunk = malloc((size_t)lazychunk_cbytes);
 3757|      0|    if (*chunk == NULL) {
  ------------------
  |  Branch (3757:9): [True: 0, False: 0]
  ------------------
 3758|      0|      rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3759|      0|      goto end;
 3760|      0|    }
 3761|      0|    *needs_free = true;
 3762|       |
 3763|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3763:9): [True: 0, False: 0]
  ------------------
 3764|      0|      rbytes = io_cb->read((void**)chunk, 1, (int64_t)streams_offset, io_pos, fp);
 3765|      0|    }
 3766|      0|    else {
 3767|      0|      uint8_t* chunk_ptr;
 3768|      0|      rbytes = io_cb->read((void**)&chunk_ptr, 1, (int64_t)streams_offset, io_pos, fp);
 3769|      0|      memcpy(*chunk, chunk_ptr, streams_offset);
 3770|      0|    }
 3771|       |
 3772|      0|    if (rbytes != (int64_t)streams_offset) {
  ------------------
  |  Branch (3772:9): [True: 0, False: 0]
  ------------------
 3773|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3774|      0|      rc = BLOSC2_ERROR_FILE_READ;
 3775|      0|      goto end;
 3776|      0|    }
 3777|      0|    if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (3777:9): [True: 0, False: 0]
  ------------------
 3778|       |      // Value runlen is not returning a lazy chunk.  We are done.
 3779|      0|      goto end;
 3780|      0|    }
 3781|       |
 3782|       |    // Mark chunk as lazy
 3783|      0|    uint8_t* blosc2_flags = *chunk + BLOSC2_CHUNK_BLOSC2_FLAGS;
 3784|      0|    *blosc2_flags |= 0x08U;
 3785|       |
 3786|       |    // Add the trailer (currently, nchunk + offset + block_csizes)
 3787|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3787:9): [True: 0, False: 0]
  ------------------
 3788|      0|      *(int32_t*)(*chunk + trailer_offset) = (int32_t)offset;   // offset is nchunk for sframes
 3789|      0|      *(int64_t*)(*chunk + trailer_offset + sizeof(int32_t)) = offset;
 3790|      0|    }
 3791|      0|    else {
 3792|      0|      *(int32_t*)(*chunk + trailer_offset) = (int32_t)nchunk;
 3793|      0|      *(int64_t*)(*chunk + trailer_offset + sizeof(int32_t)) = header_len + offset;
 3794|      0|    }
 3795|       |
 3796|      0|    block_csizes = malloc(nblocks * sizeof(int32_t));
 3797|      0|    if (block_csizes == NULL) {
  ------------------
  |  Branch (3797:9): [True: 0, False: 0]
  ------------------
 3798|      0|      rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3799|      0|      goto end;
 3800|      0|    }
 3801|       |
 3802|      0|    if (memcpyed) {
  ------------------
  |  Branch (3802:9): [True: 0, False: 0]
  ------------------
 3803|       |      // When memcpyed the blocksizes are trivial to compute
 3804|      0|      for (size_t i = 0; i + 1 < nblocks; i++) {
  ------------------
  |  Branch (3804:26): [True: 0, False: 0]
  ------------------
 3805|      0|        block_csizes[i] = (int)chunk_blocksize;
 3806|      0|      }
 3807|       |      // The last block could be incomplete, mainly due to the fact that the block size is not divisible
 3808|       |      // by the typesize
 3809|      0|      block_csizes[nblocks - 1] = (int32_t)leftover_block ? (int32_t)leftover_block : chunk_blocksize;
  ------------------
  |  Branch (3809:35): [True: 0, False: 0]
  ------------------
 3810|      0|    }
 3811|      0|    else {
 3812|       |      // In regular, compressed chunks, we need to sort the bstarts (they can be out
 3813|       |      // of order because of multi-threading), and get a reverse index too.
 3814|      0|      memcpy(block_csizes, *chunk + BLOSC_EXTENDED_HEADER_LENGTH, nblocks * sizeof(int32_t));
 3815|       |      // Helper structure to keep track of original indexes
 3816|      0|      csize_idx = malloc(nblocks * sizeof(struct csize_idx));
 3817|      0|      if (csize_idx == NULL) {
  ------------------
  |  Branch (3817:11): [True: 0, False: 0]
  ------------------
 3818|      0|        rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3819|      0|        goto end;
 3820|      0|      }
 3821|      0|      for (size_t n = 0; n < nblocks; n++) {
  ------------------
  |  Branch (3821:26): [True: 0, False: 0]
  ------------------
 3822|      0|        csize_idx[n].val = block_csizes[n];
 3823|      0|        csize_idx[n].idx = (int)n;
 3824|      0|      }
 3825|      0|      qsort(csize_idx, nblocks, sizeof(struct csize_idx), &sort_offset);
 3826|       |      // Compute the actual csizes
 3827|      0|      int idx;
 3828|      0|      for (size_t n = 0; n + 1 < nblocks; n++) {
  ------------------
  |  Branch (3828:26): [True: 0, False: 0]
  ------------------
 3829|      0|        idx = csize_idx[n].idx;
 3830|      0|        block_csizes[idx] = csize_idx[n + 1].val - csize_idx[n].val;
 3831|      0|      }
 3832|      0|      idx = csize_idx[nblocks - 1].idx;
 3833|      0|      block_csizes[idx] = chunk_cbytes - csize_idx[nblocks - 1].val;
 3834|      0|      free(csize_idx);
 3835|      0|      csize_idx = NULL;
 3836|      0|    }
 3837|       |    // Copy the csizes at the end of the trailer
 3838|      0|    void *trailer_csizes = *chunk + lazychunk_cbytes - nblocks * sizeof(int32_t);
 3839|      0|    memcpy(trailer_csizes, block_csizes, nblocks * sizeof(int32_t));
 3840|      0|    free(block_csizes);
 3841|      0|    block_csizes = NULL;
 3842|    427|  } else {
 3843|       |    // The chunk is in memory and just one pointer away
 3844|    427|    int64_t chunk_header_offset = header_len + offset;
 3845|    427|    int64_t chunk_cbytes_offset = chunk_header_offset + BLOSC_MIN_HEADER_LENGTH;
 3846|       |
 3847|    427|    *chunk = frame->cframe + chunk_header_offset;
 3848|       |
 3849|    427|    if (chunk_header_offset < 0 ||
  ------------------
  |  Branch (3849:9): [True: 0, False: 427]
  ------------------
 3850|    427|        chunk_cbytes_offset < chunk_header_offset ||
  ------------------
  |  Branch (3850:9): [True: 0, False: 427]
  ------------------
 3851|    427|        chunk_cbytes_offset > frame->len) {
  ------------------
  |  Branch (3851:9): [True: 0, False: 427]
  ------------------
 3852|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3853|      0|      rc = BLOSC2_ERROR_READ_BUFFER;
 3854|    427|    } else {
 3855|    427|      rc = blosc2_cbuffer_sizes(*chunk, NULL, &lazychunk_cbytes, NULL);
 3856|    427|      if (rc < 0) {
  ------------------
  |  Branch (3856:11): [True: 1, False: 426]
  ------------------
 3857|      1|        BLOSC_TRACE_ERROR("Cannot read the chunk 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3858|      1|        rc = BLOSC2_ERROR_READ_BUFFER;
 3859|      1|      }
 3860|    426|      else if (lazychunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3860:16): [True: 1, False: 425]
  ------------------
 3861|    425|               chunk_header_offset > INT64_MAX - lazychunk_cbytes ||
  ------------------
  |  Branch (3861:16): [True: 0, False: 425]
  ------------------
 3862|    425|               chunk_header_offset + lazychunk_cbytes > frame_len) {
  ------------------
  |  Branch (3862:16): [True: 22, False: 403]
  ------------------
 3863|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3864|     23|        rc = BLOSC2_ERROR_READ_BUFFER;
 3865|     23|      }
 3866|    427|    }
 3867|    427|  }
 3868|       |
 3869|    867|  end:
 3870|    867|  if (csize_idx != NULL) {
  ------------------
  |  Branch (3870:7): [True: 0, False: 867]
  ------------------
 3871|      0|    free(csize_idx);
 3872|      0|  }
 3873|    867|  if (block_csizes != NULL) {
  ------------------
  |  Branch (3873:7): [True: 0, False: 867]
  ------------------
 3874|      0|    free(block_csizes);
 3875|      0|  }
 3876|    867|  if (fp != NULL) {
  ------------------
  |  Branch (3876:7): [True: 0, False: 867]
  ------------------
 3877|      0|    frame_reader_release(frame, io_cb, fp);
 3878|      0|  }
 3879|    867|  if (rc < 0) {
  ------------------
  |  Branch (3879:7): [True: 61, False: 806]
  ------------------
 3880|     61|    if (*needs_free) {
  ------------------
  |  Branch (3880:9): [True: 0, False: 61]
  ------------------
 3881|      0|      free(*chunk);
 3882|      0|      *chunk = NULL;
 3883|      0|      *needs_free = false;
 3884|      0|    }
 3885|     61|    return rc;
 3886|     61|  }
 3887|       |
 3888|    806|  return (int)lazychunk_cbytes;
 3889|    867|}
frame_decompress_chunk:
 5248|  54.8k|int frame_decompress_chunk(blosc2_context *dctx, blosc2_frame_s* frame, int64_t nchunk, void *dest, int32_t nbytes) {
 5249|  54.8k|  uint8_t* src;
 5250|  54.8k|  bool needs_free;
 5251|  54.8k|  int32_t chunk_nbytes;
 5252|  54.8k|  int32_t chunk_cbytes;
 5253|  54.8k|  int rc;
 5254|       |
 5255|  54.8k|  rc = frame_get_chunk(frame, nchunk, &src, &needs_free);
 5256|  54.8k|  if (rc < 0) {
  ------------------
  |  Branch (5256:7): [True: 253, False: 54.6k]
  ------------------
 5257|    253|    BLOSC_TRACE_ERROR("Cannot get the chunk in position %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    253|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    253|    do {                                            \
  |  |  |  |   98|    253|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    253|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 253, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    253|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5258|    253|    goto end;
 5259|    253|  }
 5260|  54.6k|  chunk_cbytes = rc;
 5261|  54.6k|  if (chunk_cbytes < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (5261:7): [True: 0, False: 54.6k]
  ------------------
 5262|       |    /* Not enough input to read `nbytes` */
 5263|      0|    rc = BLOSC2_ERROR_READ_BUFFER;
 5264|      0|  }
 5265|       |
 5266|  54.6k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 5267|  54.6k|  if (rc < 0) {
  ------------------
  |  Branch (5267:7): [True: 14, False: 54.5k]
  ------------------
 5268|     14|    goto end;
 5269|     14|  }
 5270|       |
 5271|       |  /* Create a buffer for destination */
 5272|  54.5k|  if (chunk_nbytes > nbytes) {
  ------------------
  |  Branch (5272:7): [True: 42, False: 54.5k]
  ------------------
 5273|     42|    BLOSC_TRACE_ERROR("Not enough space for decompressing in dest.");
  ------------------
  |  |   93|     42|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     42|    do {                                            \
  |  |  |  |   98|     42|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     42|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     42|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5274|     42|    rc = BLOSC2_ERROR_WRITE_BUFFER;
 5275|     42|    goto end;
 5276|     42|  }
 5277|       |  /* And decompress it */
 5278|  54.5k|  dctx->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
 5279|  54.5k|  int chunksize = rc = blosc2_decompress_ctx(dctx, src, chunk_cbytes, dest, nbytes);
 5280|  54.5k|  if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (5280:7): [True: 175, False: 54.3k]
  |  Branch (5280:24): [True: 27, False: 54.3k]
  ------------------
 5281|    202|    BLOSC_TRACE_ERROR("Error in decompressing chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5282|    202|    if (chunksize >= 0)
  ------------------
  |  Branch (5282:9): [True: 27, False: 175]
  ------------------
 5283|     27|      rc = BLOSC2_ERROR_FAILURE;
 5284|    202|  }
 5285|  54.8k|  end:
 5286|  54.8k|  if (needs_free) {
  ------------------
  |  Branch (5286:7): [True: 9.49k, False: 45.3k]
  ------------------
 5287|  9.49k|    free(src);
 5288|  9.49k|  }
 5289|  54.8k|  return rc;
 5290|  54.5k|}
frame.c:reader_cache_claim:
  125|     19|static bool reader_cache_claim(void) {
  126|     19|  bool claimed = false;
  127|     19|  blosc2_pthread_mutex_lock(&reader_cache_mutex);
  ------------------
  |  |   92|     19|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  128|     19|  if (reader_cache_count < reader_cache_max()) {
  ------------------
  |  Branch (128:7): [True: 19, False: 0]
  ------------------
  129|     19|    reader_cache_count++;
  130|     19|    claimed = true;
  131|     19|  }
  132|     19|  blosc2_pthread_mutex_unlock(&reader_cache_mutex);
  ------------------
  |  |   93|     19|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  133|     19|  return claimed;
  134|     19|}
frame.c:reader_cache_max:
   97|     19|static int reader_cache_max(void) {
   98|     19|  static int cached_max = -1;
   99|     19|  if (cached_max >= 0) {
  ------------------
  |  Branch (99:7): [True: 18, False: 1]
  ------------------
  100|     18|    return cached_max;
  101|     18|  }
  102|      1|  char* envvar = getenv("BLOSC_MAX_CACHED_READERS");
  103|      1|  if (envvar != NULL && envvar[0] != '\0') {
  ------------------
  |  Branch (103:7): [True: 0, False: 1]
  |  Branch (103:25): [True: 0, False: 0]
  ------------------
  104|      0|    long value = strtol(envvar, NULL, 10);
  105|      0|    if (value >= 0 && value <= INT_MAX) {
  ------------------
  |  Branch (105:9): [True: 0, False: 0]
  |  Branch (105:23): [True: 0, False: 0]
  ------------------
  106|      0|      cached_max = (int)value;
  107|      0|      return cached_max;
  108|      0|    }
  109|      0|  }
  110|      1|  cached_max = FRAME_READER_CACHE_MAX;
  ------------------
  |  |   86|      1|#define FRAME_READER_CACHE_MAX 96
  ------------------
  111|      1|  struct rlimit rl;
  112|      1|  if (getrlimit(RLIMIT_NOFILE, &rl) == 0 && rl.rlim_cur != RLIM_INFINITY) {
  ------------------
  |  Branch (112:7): [True: 1, False: 0]
  |  Branch (112:45): [True: 1, False: 0]
  ------------------
  113|      1|    rlim_t share = rl.rlim_cur / FRAME_READER_CACHE_SHARE;
  ------------------
  |  |   87|      1|#define FRAME_READER_CACHE_SHARE 16
  ------------------
  114|      1|    if (share < (rlim_t)cached_max) {
  ------------------
  |  Branch (114:9): [True: 1, False: 0]
  ------------------
  115|      1|      cached_max = (int)share;
  116|      1|    }
  117|      1|  }
  118|       |  /* A budget below FRAME_READER_CACHE_SHARE lands on 0, i.e. no caching at all;
  119|       |     that is the right answer there -- a descriptor held for a frame's lifetime
  120|       |     is exactly what such a process cannot spare. */
  121|      1|  return cached_max;
  122|      1|}
frame.c:reader_cache_return:
  136|     19|static void reader_cache_return(void) {
  137|     19|  blosc2_pthread_mutex_lock(&reader_cache_mutex);
  ------------------
  |  |   92|     19|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  138|     19|  if (reader_cache_count > 0) {
  ------------------
  |  Branch (138:7): [True: 19, False: 0]
  ------------------
  139|     19|    reader_cache_count--;
  140|     19|  }
  141|     19|  blosc2_pthread_mutex_unlock(&reader_cache_mutex);
  ------------------
  |  |   93|     19|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  142|     19|}
frame.c:frame_reader_close_locked:
  238|  13.6k|static bool frame_reader_close_locked(blosc2_frame_s* frame, bool force) {
  239|  13.6k|  if (frame->read_fp == NULL) {
  ------------------
  |  Branch (239:7): [True: 13.6k, False: 0]
  ------------------
  240|  13.6k|    return true;
  241|  13.6k|  }
  242|      0|  if (frame->read_fp_refs > 0 && !force) {
  ------------------
  |  Branch (242:7): [True: 0, False: 0]
  |  Branch (242:34): [True: 0, False: 0]
  ------------------
  243|       |    /* A caller up the stack is reading through it (frame_to_schunk holds it
  244|       |       across its whole chunk loop, and that loop re-enters get_header_info).
  245|       |       Closing it here would hand that caller a dangling handle, and its own
  246|       |       release would then close it a second time.  Leave it: the operation in
  247|       |       flight finishes on the file it started on, and the next revalidate --
  248|       |       past that release -- drops it. */
  249|      0|    return false;
  250|      0|  }
  251|       |  /* read_fp only ever comes from the filesystem backend, so close it directly:
  252|       |     blosc2_get_io_cb() would return NULL after a blosc2_destroy(), and then the
  253|       |     descriptor would leak while its cache slot got handed back anyway. */
  254|      0|  blosc2_stdio_close(frame->read_fp);
  255|      0|  frame->read_fp = NULL;
  256|      0|  frame->read_fp_refs = 0;
  257|      0|#if !defined(_WIN32)
  258|      0|  reader_cache_return();
  259|      0|#endif
  260|       |  return true;
  261|      0|}
frame.c:frame_alloc:
  147|  13.7k|static blosc2_frame_s* frame_alloc(void) {
  148|  13.7k|  blosc2_frame_s* frame = calloc(1, sizeof(blosc2_frame_s));
  149|  13.7k|  if (frame != NULL) {
  ------------------
  |  Branch (149:7): [True: 13.7k, False: 0]
  ------------------
  150|  13.7k|    blosc2_pthread_mutex_init(&frame->read_fp_mutex, NULL);
  ------------------
  |  |   90|  13.7k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
  151|  13.7k|  }
  152|  13.7k|  return frame;
  153|  13.7k|}
frame.c:frame_refresh_if_stale:
 1092|  56.5k|static int frame_refresh_if_stale(blosc2_frame_s *frame, int64_t frame_len_on_disk) {
 1093|  56.5k|  if (frame->cframe != NULL || frame->schunk == NULL ||
  ------------------
  |  Branch (1093:7): [True: 56.5k, False: 0]
  |  Branch (1093:32): [True: 0, False: 0]
  ------------------
 1094|  56.5k|      (!frame->force_refresh && frame_len_on_disk == frame->len)) {
  ------------------
  |  Branch (1094:8): [True: 0, False: 0]
  |  Branch (1094:33): [True: 0, False: 0]
  ------------------
 1095|  56.5k|    return 0;
 1096|  56.5k|  }
 1097|       |  // Saved so the metalayer-reload retry loop below can roll back to a fully
 1098|       |  // consistent state on exhaustion, rather than leaving frame->len/trailer_len
 1099|       |  // committed to the new value with no metalayers to match it.
 1100|      0|  int64_t old_len = frame->len;
 1101|      0|  uint32_t old_trailer_len = frame->trailer_len;
 1102|       |
 1103|      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 (1103:7): [True: 0, False: 0]
  ------------------
 1104|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1105|      0|    return BLOSC2_ERROR_FILE_READ;
 1106|      0|  }
 1107|       |
 1108|       |  // Read and validate the trailer *before* mutating any frame state below,
 1109|       |  // so a transient torn read (a writer without locking has no coordination
 1110|       |  // preventing a reader from landing mid-rewrite here -- the documented
 1111|       |  // SWMR-without-locking tradeoff) can be handled opportunistically: keep
 1112|       |  // the old cached view and let the next access retry, the same way
 1113|       |  // frame_check_stale()'s header read already does a few lines up in the
 1114|       |  // caller. Once frame->len/coffsets are overwritten below, a failure
 1115|       |  // partway through would leave the frame in a self-inconsistent state
 1116|       |  // (new length, stale trailer/offsets), so those mutations only happen
 1117|       |  // after the trailer is confirmed good.
 1118|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 1119|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (1119:7): [True: 0, False: 0]
  ------------------
 1120|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1121|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 1122|      0|  }
 1123|      0|  void* fp;
 1124|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1124:7): [True: 0, False: 0]
  ------------------
 1125|      0|    fp = sframe_open_index(frame->urlpath, "rb", frame->schunk->storage->io);
 1126|      0|  }
 1127|      0|  else {
 1128|      0|    fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 1129|      0|  }
 1130|      0|  if (fp == NULL) {
  ------------------
  |  Branch (1130:7): [True: 0, False: 0]
  ------------------
 1131|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1132|      0|    return BLOSC2_ERROR_FILE_OPEN;
 1133|      0|  }
 1134|      0|  uint8_t trailer[FRAME_TRAILER_MINLEN];
 1135|      0|  uint8_t* trailer_ptr = trailer;
 1136|      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)
  ------------------
 1137|      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)
  ------------------
 1138|      0|  frame_reader_release(frame, io_cb, fp);
 1139|      0|  if (rbytes != FRAME_TRAILER_MINLEN) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1139:7): [True: 0, False: 0]
  ------------------
 1140|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1141|      0|    return 0;  // opportunistic: transient, keep the cached view, retry later
 1142|      0|  }
 1143|      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)
  ------------------
 1144|      0|  if (trailer_ptr[trailer_offset - 1] != 0xce) {
  ------------------
  |  Branch (1144:7): [True: 0, False: 0]
  ------------------
 1145|       |    // Not a valid trailer; most likely we are reading a frame in the middle of
 1146|       |    // being rewritten by another handle without locking (locked handles
 1147|       |    // fully serialize, so this only happens under the no-locking contract).
 1148|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1149|      0|    return 0;  // opportunistic, same reasoning as above
 1150|      0|  }
 1151|      0|  uint32_t trailer_len;
 1152|      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)
  ------------------
 1153|      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 (1153:7): [True: 0, False: 0]
  |  Branch (1153:45): [True: 0, False: 0]
  ------------------
 1154|      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 (1154:7): [True: 0, False: 0]
  ------------------
 1155|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1156|      0|    return 0;  // opportunistic, same reasoning as above
 1157|      0|  }
 1158|       |
 1159|       |  // Trailer confirmed good: now safe to commit the new length. The lock
 1160|       |  // generation counter (see frame_lock) may have flagged a mutation that
 1161|       |  // left the frame length unchanged; only clear that flag here, once a
 1162|       |  // refresh has actually happened -- clearing it earlier and then bailing
 1163|       |  // out opportunistically above would permanently lose a same-length
 1164|       |  // mutation notification on a torn-read retry. The cached offsets index is
 1165|       |  // dropped further down, only once the metalayer/vlmetalayer reload below
 1166|       |  // has actually succeeded -- neither of those touches frame->coffsets, so
 1167|       |  // deferring this keeps the old view of it fully intact for the
 1168|       |  // opportunistic rollback path below, exactly as strong as the trailer
 1169|       |  // read's own bail-outs above.
 1170|      0|  frame->force_refresh = false;
 1171|      0|  frame->len = frame_len_on_disk;
 1172|      0|  frame->trailer_len = trailer_len;
 1173|       |
 1174|       |  // The header metalayers and trailer vlmetalayers were cached at open time;
 1175|       |  // reload them so metadata changes made by another handle (e.g. a b2nd shape
 1176|       |  // update) become visible too.  The guard protects against re-entering from
 1177|       |  // the reload path itself (get_header_info does not refresh, but cheap
 1178|       |  // insurance against future changes there).
 1179|       |  //
 1180|       |  // frame_get_metalayers()/frame_get_vlmetalayers() each do their own fully
 1181|       |  // independent header/trailer re-read (separate from the trailer read
 1182|       |  // above), so without locking they can hit the same transient torn-read
 1183|       |  // window. Unlike that trailer read, there's no way to validate first and
 1184|       |  // commit after: schunk_free_metalayers()/schunk_free_vlmetalayers() must
 1185|       |  // run before a reload attempt (the parsers write straight into
 1186|       |  // schunk->metalayers[]/vlmetalayers[] as they go), so a single failed
 1187|       |  // attempt already discards the old cached set. Retry a bounded number of
 1188|       |  // times -- both free helpers are NULL-safe and re-run cleanly against a
 1189|       |  // partial prior attempt, and each attempt is a fresh independent read, so
 1190|       |  // this self-heals once the writer's rewrite stabilizes.
 1191|       |  //
 1192|       |  // This reasoning only holds without locking, though: frame_check_stale()
 1193|       |  // (the only caller) holds the shared frame lock across this entire call
 1194|       |  // when frame->locking is set, which fully excludes writers for its
 1195|       |  // duration -- so under locking a reload failure here cannot be a torn
 1196|       |  // read, it is a genuine problem (corruption or a real I/O error), and
 1197|       |  // retrying 50 times would just waste ~50ms holding that shared lock
 1198|       |  // before silently masking it. Retry once (i.e. don't retry) and propagate
 1199|       |  // the error under locking; keep the opportunistic bounded retry + silent
 1200|       |  // rollback for the no-locking case only.
 1201|       |  //
 1202|       |  // On exhaustion in the no-locking case, roll back frame->len/trailer_len
 1203|       |  // to what they were before this call and force a full retry on the next
 1204|       |  // poll (frame->force_refresh = true) -- otherwise frame_len_on_disk ==
 1205|       |  // frame->len would short-circuit every subsequent call at the top of this
 1206|       |  // function, permanently stranding this handle with an empty metalayer set.
 1207|      0|  if (!frame->refreshing) {
  ------------------
  |  Branch (1207:7): [True: 0, False: 0]
  ------------------
 1208|      0|    frame->refreshing = true;
 1209|      0|    int rc = -1;
 1210|      0|    const int max_attempts = frame->locking ? 1 : 50;
  ------------------
  |  Branch (1210:30): [True: 0, False: 0]
  ------------------
 1211|      0|    for (int attempt = 0; attempt < max_attempts; attempt++) {
  ------------------
  |  Branch (1211:27): [True: 0, False: 0]
  ------------------
 1212|      0|      schunk_free_metalayers(frame->schunk);
 1213|      0|      rc = frame_get_metalayers(frame, frame->schunk);
 1214|      0|      if (rc >= 0) {
  ------------------
  |  Branch (1214:11): [True: 0, False: 0]
  ------------------
 1215|      0|        schunk_free_vlmetalayers(frame->schunk);
 1216|      0|        rc = frame_get_vlmetalayers(frame, frame->schunk);
 1217|      0|      }
 1218|      0|      if (rc >= 0 || attempt + 1 == max_attempts) {
  ------------------
  |  Branch (1218:11): [True: 0, False: 0]
  |  Branch (1218:22): [True: 0, False: 0]
  ------------------
 1219|      0|        break;
 1220|      0|      }
 1221|       |#if defined(_WIN32)
 1222|       |      Sleep(1);
 1223|       |#else
 1224|      0|      usleep(1000);
 1225|      0|#endif
 1226|      0|    }
 1227|      0|    frame->refreshing = false;
 1228|      0|    if (rc < 0) {
  ------------------
  |  Branch (1228:9): [True: 0, False: 0]
  ------------------
 1229|      0|      if (frame->locking) {
  ------------------
  |  Branch (1229:11): [True: 0, False: 0]
  ------------------
 1230|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1231|      0|                          "(locked handle: this is not a transient race).");
 1232|      0|        return rc;
 1233|      0|      }
 1234|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1235|      0|                        "after retries; rolling back to the previous cached view.");
 1236|      0|      frame->len = old_len;
 1237|      0|      frame->trailer_len = old_trailer_len;
 1238|      0|      frame->force_refresh = true;
 1239|      0|      return 0;
 1240|      0|    }
 1241|      0|  }
 1242|      0|  frame->schunk->change_tick++;
 1243|       |
 1244|       |  // Cached offsets index invalidated only now, after a fully successful
 1245|       |  // refresh: recomputed lazily from the fresh trailer on demand.
 1246|      0|  if (frame->coffsets != NULL) {
  ------------------
  |  Branch (1246:7): [True: 0, False: 0]
  ------------------
 1247|      0|    if (frame->coffsets_needs_free) {
  ------------------
  |  Branch (1247:9): [True: 0, False: 0]
  ------------------
 1248|      0|      free(frame->coffsets);
 1249|      0|    }
 1250|      0|    frame->coffsets = NULL;
 1251|      0|  }
 1252|       |
 1253|      0|  return 1;
 1254|      0|}
frame.c:get_coffsets_nbytes:
 1301|  14.9k|                               int32_t *coffsets_nbytes, const blosc2_io *io) {
 1302|  14.9k|  int32_t chunk_cbytes;
 1303|  14.9k|  int rc;
 1304|  14.9k|  int64_t off_pos = header_len;
 1305|  14.9k|  if (!frame->sframe) {
  ------------------
  |  Branch (1305:7): [True: 14.9k, False: 0]
  ------------------
 1306|  14.9k|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (1306:9): [True: 930, False: 13.9k]
  ------------------
 1307|    930|      off_pos += cbytes;
 1308|    930|    }
 1309|  14.9k|  }
 1310|       |
 1311|  14.9k|  if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (1311:7): [True: 122, False: 14.7k]
  |  Branch (1311:22): [True: 2, False: 14.7k]
  ------------------
 1312|  14.7k|      off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (1312:7): [True: 160, False: 14.6k]
  ------------------
 1313|    284|    BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   93|    284|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    284|    do {                                            \
  |  |  |  |   98|    284|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    284|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 284, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    284|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1314|    284|    return BLOSC2_ERROR_INVALID_HEADER;
 1315|    284|  }
 1316|       |
 1317|  14.6k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (1317:7): [True: 14.6k, False: 0]
  ------------------
 1318|  14.6k|    uint8_t *off_start = frame->cframe + off_pos;
 1319|  14.6k|    rc = blosc2_cbuffer_sizes(off_start, coffsets_nbytes, &chunk_cbytes, NULL);
 1320|  14.6k|    if (rc < 0) {
  ------------------
  |  Branch (1320:9): [True: 42, False: 14.5k]
  ------------------
 1321|     42|      return rc;
 1322|     42|    }
 1323|  14.5k|    if (chunk_cbytes < 0 || off_pos + chunk_cbytes > frame->len) {
  ------------------
  |  Branch (1323:9): [True: 0, False: 14.5k]
  |  Branch (1323:29): [True: 72, False: 14.5k]
  ------------------
 1324|     72|      BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   93|     72|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     72|    do {                                            \
  |  |  |  |   98|     72|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     72|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 72, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     72|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1325|     72|      return BLOSC2_ERROR_INVALID_HEADER;
 1326|     72|    }
 1327|  14.5k|    return 0;
 1328|  14.5k|  }
 1329|       |
 1330|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
 1331|      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 (1331:7): [True: 0, False: 0]
  |  Branch (1331:56): [True: 0, False: 0]
  ------------------
 1332|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1333|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1334|      0|  }
 1335|       |
 1336|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
 1337|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (1337:7): [True: 0, False: 0]
  ------------------
 1338|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1339|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 1340|      0|  }
 1341|       |
 1342|      0|  uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 1343|      0|  uint8_t *header_ptr = header;
 1344|      0|  void *fp = NULL;
 1345|      0|  int64_t io_pos = 0;
 1346|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1346:7): [True: 0, False: 0]
  ------------------
 1347|      0|    fp = sframe_open_index(frame->urlpath, "rb", io);
 1348|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1348:9): [True: 0, False: 0]
  ------------------
 1349|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1350|      0|      return BLOSC2_ERROR_FILE_OPEN;
 1351|      0|    }
 1352|      0|    io_pos = off_pos;
 1353|      0|  }
 1354|      0|  else {
 1355|      0|    fp = frame_reader_acquire(frame, io);
 1356|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1356:9): [True: 0, False: 0]
  ------------------
 1357|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1358|      0|      return BLOSC2_ERROR_FILE_OPEN;
 1359|      0|    }
 1360|      0|    io_pos = frame->file_offset + off_pos;
 1361|      0|  }
 1362|      0|  int64_t rbytes = io_cb->read((void**)&header_ptr, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 1363|      0|  frame_reader_release(frame, io_cb, fp);
 1364|      0|  if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (1364:7): [True: 0, False: 0]
  ------------------
 1365|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1366|      0|    return BLOSC2_ERROR_FILE_READ;
 1367|      0|  }
 1368|       |
 1369|      0|  rc = blosc2_cbuffer_sizes(header_ptr, coffsets_nbytes, &chunk_cbytes, NULL);
 1370|      0|  if (rc < 0) {
  ------------------
  |  Branch (1370:7): [True: 0, False: 0]
  ------------------
 1371|      0|    return rc;
 1372|      0|  }
 1373|       |
 1374|      0|  if (chunk_cbytes < 0 || off_pos + chunk_cbytes > trailer_offset) {
  ------------------
  |  Branch (1374:7): [True: 0, False: 0]
  |  Branch (1374:27): [True: 0, False: 0]
  ------------------
 1375|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1376|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1377|      0|  }
 1378|       |
 1379|      0|  return 0;
 1380|      0|}
frame.c:get_meta_from_header:
 2389|  1.04k|                                int32_t header_len) {
 2390|  1.04k|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|  1.04k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 2391|  1.04k|  int64_t header_pos = FRAME_IDX_SIZE;
  ------------------
  |  |   51|  1.04k|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   50|  1.04k|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  1.04k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|  1.04k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   43|  1.04k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   42|  1.04k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   41|  1.04k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|  1.04k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  1.04k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  1.04k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  1.04k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  1.04k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  1.04k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  1.04k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  1.04k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  1.04k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2392|       |
 2393|       |  // Get the size for the index of metalayers
 2394|  1.04k|  uint16_t idx_size;
 2395|  1.04k|  header_pos += sizeof(idx_size);
 2396|  1.04k|  if (header_len < header_pos) {
  ------------------
  |  Branch (2396:7): [True: 27, False: 1.01k]
  ------------------
 2397|     27|    return BLOSC2_ERROR_READ_BUFFER;
 2398|     27|  }
 2399|  1.01k|  from_big(&idx_size, header + FRAME_IDX_SIZE, sizeof(idx_size));
  ------------------
  |  |   38|  1.01k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2400|       |
 2401|       |  // Get the actual index of metalayers
 2402|  1.01k|  uint8_t* metalayers_idx = header + FRAME_IDX_SIZE + 2;
  ------------------
  |  |   51|  1.01k|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   50|  1.01k|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|  1.01k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|  1.01k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   43|  1.01k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   42|  1.01k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   41|  1.01k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|  1.01k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  1.01k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  1.01k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  1.01k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  1.01k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  1.01k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  1.01k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  1.01k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  1.01k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2403|  1.01k|  header_pos += 1;
 2404|  1.01k|  if (header_len < header_pos) {
  ------------------
  |  Branch (2404:7): [True: 1, False: 1.01k]
  ------------------
 2405|      1|    return BLOSC2_ERROR_READ_BUFFER;
 2406|      1|  }
 2407|  1.01k|  if (metalayers_idx[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (2407:7): [True: 62, False: 956]
  ------------------
 2408|     62|    return BLOSC2_ERROR_DATA;
 2409|     62|  }
 2410|    956|  uint8_t* idxp = metalayers_idx + 1;
 2411|    956|  uint16_t nmetalayers;
 2412|    956|  header_pos += sizeof(nmetalayers);
 2413|    956|  if (header_len < header_pos) {
  ------------------
  |  Branch (2413:7): [True: 2, False: 954]
  ------------------
 2414|      2|    return BLOSC2_ERROR_READ_BUFFER;
 2415|      2|  }
 2416|    954|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   38|    954|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2417|    954|  idxp += 2;
 2418|    954|  if (nmetalayers > BLOSC2_MAX_METALAYERS) {
  ------------------
  |  | 1744|    954|#define BLOSC2_MAX_METALAYERS 16
  ------------------
  |  Branch (2418:7): [True: 23, False: 931]
  ------------------
 2419|     23|    return BLOSC2_ERROR_DATA;
 2420|     23|  }
 2421|    931|  schunk->nmetalayers = nmetalayers;
 2422|       |
 2423|       |  // Populate the metalayers and its serialized values
 2424|    931|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2424:28): [True: 46, False: 885]
  ------------------
 2425|     46|    header_pos += 1;
 2426|     46|    if (header_len < header_pos) {
  ------------------
  |  Branch (2426:9): [True: 1, False: 45]
  ------------------
 2427|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2428|      1|    }
 2429|     45|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (2429:9): [True: 18, False: 27]
  ------------------
 2430|     18|      return BLOSC2_ERROR_DATA;
 2431|     18|    }
 2432|     27|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 2433|     27|    if (metalayer == NULL) {
  ------------------
  |  Branch (2433:9): [True: 0, False: 27]
  ------------------
 2434|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2435|      0|    }
 2436|     27|    schunk->metalayers[nmetalayer] = metalayer;
 2437|       |
 2438|       |    // Populate the metalayer string
 2439|     27|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 2440|     27|    idxp += 1;
 2441|     27|    header_pos += nslen;
 2442|     27|    if (header_len < header_pos) {
  ------------------
  |  Branch (2442:9): [True: 1, False: 26]
  ------------------
 2443|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2444|      1|    }
 2445|     26|    char* ns = malloc((size_t)nslen + 1);
 2446|     26|    if (ns == NULL) {
  ------------------
  |  Branch (2446:9): [True: 0, False: 26]
  ------------------
 2447|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2448|      0|    }
 2449|     26|    memcpy(ns, idxp, nslen);
 2450|     26|    ns[nslen] = '\0';
 2451|     26|    idxp += nslen;
 2452|     26|    metalayer->name = ns;
 2453|       |
 2454|       |    // Populate the serialized value for this metalayer
 2455|       |    // Get the offset
 2456|     26|    header_pos += 1;
 2457|     26|    if (header_len < header_pos) {
  ------------------
  |  Branch (2457:9): [True: 1, False: 25]
  ------------------
 2458|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2459|      1|    }
 2460|     25|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (2460:9): [True: 4, False: 21]
  ------------------
 2461|      4|      return BLOSC2_ERROR_DATA;
 2462|      4|    }
 2463|     21|    idxp += 1;
 2464|     21|    int32_t offset;
 2465|     21|    header_pos += sizeof(offset);
 2466|     21|    if (header_len < header_pos) {
  ------------------
  |  Branch (2466:9): [True: 1, False: 20]
  ------------------
 2467|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2468|      1|    }
 2469|     20|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   38|     20|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2470|     20|    idxp += 4;
 2471|     20|    if (offset < 0 || offset >= header_len) {
  ------------------
  |  Branch (2471:9): [True: 2, False: 18]
  |  Branch (2471:23): [True: 13, False: 5]
  ------------------
 2472|       |      // Offset is less than zero or exceeds header length
 2473|     15|      return BLOSC2_ERROR_DATA;
 2474|     15|    }
 2475|       |    // Go to offset and see if we have the correct marker
 2476|      5|    uint8_t* content_marker = header + offset;
 2477|      5|    if ((int64_t)header_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (2477:9): [True: 0, False: 5]
  ------------------
 2478|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2479|      0|    }
 2480|      5|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (2480:9): [True: 3, False: 2]
  ------------------
 2481|      3|      return BLOSC2_ERROR_DATA;
 2482|      3|    }
 2483|       |
 2484|       |    // Read the size of the content
 2485|      2|    int32_t content_len;
 2486|      2|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   38|      2|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2487|      2|    if (content_len < 0) {
  ------------------
  |  Branch (2487:9): [True: 1, False: 1]
  ------------------
 2488|      1|      return BLOSC2_ERROR_DATA;
 2489|      1|    }
 2490|      1|    metalayer->content_len = content_len;
 2491|       |
 2492|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 2493|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 2494|       |    // bounds check, which would let memcpy below read past the header buffer.
 2495|      1|    if ((int64_t)header_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (2495:9): [True: 1, False: 0]
  ------------------
 2496|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2497|      1|    }
 2498|      0|    char* content = malloc((size_t)content_len);
 2499|       |    // malloc(0) is allowed to return NULL, and blosc2_meta_add accepts
 2500|       |    // content_len == 0, so only treat NULL as an allocation failure when
 2501|       |    // a non-zero allocation was requested.
 2502|      0|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (2502:9): [True: 0, False: 0]
  |  Branch (2502:28): [True: 0, False: 0]
  ------------------
 2503|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2504|      0|    }
 2505|      0|    if (content_len > 0) {
  ------------------
  |  Branch (2505:9): [True: 0, False: 0]
  ------------------
 2506|      0|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 2507|      0|    }
 2508|      0|    metalayer->content = (uint8_t*)content;
 2509|      0|  }
 2510|       |
 2511|    885|  return 1;
 2512|    931|}
frame.c:get_vlmeta_from_trailer:
 2592|    870|                                   int32_t trailer_len) {
 2593|       |
 2594|    870|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|    870|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 2595|    870|  int64_t trailer_pos = FRAME_TRAILER_VLMETALAYERS + 2;
  ------------------
  |  |   60|    870|#define FRAME_TRAILER_VLMETALAYERS (2)
  ------------------
 2596|    870|  uint8_t* idxp = trailer + trailer_pos;
 2597|       |
 2598|       |  // Get the size for the index of metalayers
 2599|    870|  trailer_pos += 2;
 2600|    870|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2600:7): [True: 0, False: 870]
  ------------------
 2601|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2602|      0|  }
 2603|    870|  uint16_t idx_size;
 2604|    870|  from_big(&idx_size, idxp, sizeof(idx_size));
  ------------------
  |  |   38|    870|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2605|    870|  idxp += 2;
 2606|       |
 2607|    870|  trailer_pos += 1;
 2608|       |  // Get the actual index of metalayers
 2609|    870|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2609:7): [True: 0, False: 870]
  ------------------
 2610|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2611|      0|  }
 2612|    870|  if (idxp[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (2612:7): [True: 92, False: 778]
  ------------------
 2613|     92|    return BLOSC2_ERROR_DATA;
 2614|     92|  }
 2615|    778|  idxp += 1;
 2616|       |
 2617|       |  // The on-wire encoding is unsigned (uint16 follows the msgpack `0xde`
 2618|       |  // map16 marker), but `schunk->nvlmetalayers` is int16_t. Decoding into a
 2619|       |  // signed local would let raw bytes like 0xff 0xff slip past the
 2620|       |  // `> BLOSC2_MAX_VLMETALAYERS` ceiling as a negative count, after which
 2621|       |  // a later `blosc2_vlmeta_add` would write through `vlmetalayers[-1]`
 2622|       |  // and corrupt adjacent schunk fields. Decode unsigned, then narrow.
 2623|    778|  uint16_t nmetalayers;
 2624|    778|  trailer_pos += sizeof(nmetalayers);
 2625|    778|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2625:7): [True: 0, False: 778]
  ------------------
 2626|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2627|      0|  }
 2628|    778|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   38|    778|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2629|    778|  idxp += 2;
 2630|    778|  if (nmetalayers > BLOSC2_MAX_VLMETALAYERS) {
  ------------------
  |  | 1750|    778|#define BLOSC2_MAX_VLMETALAYERS (8 * 1024)
  ------------------
  |  Branch (2630:7): [True: 18, False: 760]
  ------------------
 2631|     18|    return BLOSC2_ERROR_DATA;
 2632|     18|  }
 2633|    760|  schunk->nvlmetalayers = (int16_t)nmetalayers;
 2634|       |
 2635|       |  // Populate the metalayers and its serialized values
 2636|  1.02k|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2636:28): [True: 334, False: 690]
  ------------------
 2637|    334|    trailer_pos += 1;
 2638|    334|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2638:9): [True: 0, False: 334]
  ------------------
 2639|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2640|      0|    }
 2641|    334|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (2641:9): [True: 18, False: 316]
  ------------------
 2642|     18|      return BLOSC2_ERROR_DATA;
 2643|     18|    }
 2644|    316|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 2645|    316|    if (metalayer == NULL) {
  ------------------
  |  Branch (2645:9): [True: 0, False: 316]
  ------------------
 2646|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2647|      0|    }
 2648|    316|    schunk->vlmetalayers[nmetalayer] = metalayer;
 2649|       |
 2650|       |    // Populate the metalayer string
 2651|    316|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 2652|    316|    idxp += 1;
 2653|    316|    trailer_pos += nslen;
 2654|    316|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2654:9): [True: 0, False: 316]
  ------------------
 2655|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2656|      0|    }
 2657|    316|    char* ns = malloc((size_t)nslen + 1);
 2658|    316|    if (ns == NULL) {
  ------------------
  |  Branch (2658:9): [True: 0, False: 316]
  ------------------
 2659|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2660|      0|    }
 2661|    316|    memcpy(ns, idxp, nslen);
 2662|    316|    ns[nslen] = '\0';
 2663|    316|    idxp += nslen;
 2664|    316|    metalayer->name = ns;
 2665|       |
 2666|       |    // Populate the serialized value for this metalayer
 2667|       |    // Get the offset
 2668|    316|    trailer_pos += 1;
 2669|    316|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2669:9): [True: 0, False: 316]
  ------------------
 2670|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2671|      0|    }
 2672|    316|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (2672:9): [True: 3, False: 313]
  ------------------
 2673|      3|      return BLOSC2_ERROR_DATA;
 2674|      3|    }
 2675|    313|    idxp += 1;
 2676|    313|    int32_t offset;
 2677|    313|    trailer_pos += sizeof(offset);
 2678|    313|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2678:9): [True: 0, False: 313]
  ------------------
 2679|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2680|      0|    }
 2681|    313|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   38|    313|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2682|    313|    idxp += 4;
 2683|    313|    if (offset < 0 || offset >= trailer_len) {
  ------------------
  |  Branch (2683:9): [True: 7, False: 306]
  |  Branch (2683:23): [True: 3, False: 303]
  ------------------
 2684|       |      // Offset is less than zero or exceeds trailer length
 2685|     10|      return BLOSC2_ERROR_DATA;
 2686|     10|    }
 2687|       |    // Go to offset and see if we have the correct marker
 2688|    303|    uint8_t* content_marker = trailer + offset;
 2689|    303|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (2689:9): [True: 1, False: 302]
  ------------------
 2690|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2691|      1|    }
 2692|    302|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (2692:9): [True: 5, False: 297]
  ------------------
 2693|      5|      return BLOSC2_ERROR_DATA;
 2694|      5|    }
 2695|       |
 2696|       |    // Read the size of the content
 2697|    297|    int32_t content_len;
 2698|    297|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   38|    297|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2699|    297|    if (content_len < 0) {
  ------------------
  |  Branch (2699:9): [True: 4, False: 293]
  ------------------
 2700|      4|      return BLOSC2_ERROR_DATA;
 2701|      4|    }
 2702|    293|    metalayer->content_len = content_len;
 2703|       |
 2704|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 2705|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 2706|       |    // bounds check, which would let memcpy below read past the trailer buffer.
 2707|    293|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (2707:9): [True: 29, False: 264]
  ------------------
 2708|     29|      return BLOSC2_ERROR_READ_BUFFER;
 2709|     29|    }
 2710|    264|    char* content = malloc((size_t)content_len);
 2711|       |    // Same zero-length carve-out as in get_meta_from_header: malloc(0) may
 2712|       |    // return NULL on some platforms, and the public API allows
 2713|       |    // content_len == 0, so don't reject a valid empty vlmetalayer.
 2714|    264|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (2714:9): [True: 262, False: 2]
  |  Branch (2714:28): [True: 0, False: 262]
  ------------------
 2715|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2716|      0|    }
 2717|    264|    if (content_len > 0) {
  ------------------
  |  Branch (2717:9): [True: 262, False: 2]
  ------------------
 2718|    262|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 2719|    262|    }
 2720|    264|    metalayer->content = (uint8_t*)content;
 2721|    264|  }
 2722|    690|  return 1;
 2723|    760|}
frame.c:validate_offsets_chunk:
 2881|  12.5k|                                  int64_t nchunks) {
 2882|  12.5k|  int32_t coffsets_cbytes = 0;
 2883|  12.5k|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 2884|  12.5k|  if (coffsets == NULL) {
  ------------------
  |  Branch (2884:7): [True: 336, False: 12.2k]
  ------------------
 2885|    336|    BLOSC_TRACE_ERROR("Cannot get compressed offsets from frame.");
  ------------------
  |  |   93|    336|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    336|    do {                                            \
  |  |  |  |   98|    336|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    336|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 336, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    336|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2886|    336|    return BLOSC2_ERROR_DATA;
 2887|    336|  }
 2888|       |
 2889|  12.2k|  int32_t offsets_nbytes;
 2890|  12.2k|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (2890:7): [True: 0, False: 12.2k]
  ------------------
 2891|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2892|      0|    return BLOSC2_ERROR_FAILURE;
 2893|      0|  }
 2894|       |
 2895|  12.2k|  int64_t* offsets = (int64_t*)malloc((size_t)offsets_nbytes);
 2896|  12.2k|  if (offsets == NULL) {
  ------------------
  |  Branch (2896:7): [True: 0, False: 12.2k]
  ------------------
 2897|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2898|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2899|      0|  }
 2900|       |
 2901|  12.2k|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 2902|  12.2k|  blosc2_context* dctx = blosc2_create_dctx(off_dparams);
 2903|  12.2k|  if (dctx == NULL) {
  ------------------
  |  Branch (2903:7): [True: 0, False: 12.2k]
  ------------------
 2904|      0|    free(offsets);
 2905|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2906|      0|    return BLOSC2_ERROR_FAILURE;
 2907|      0|  }
 2908|       |
 2909|  12.2k|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 2910|  12.2k|                                             offsets, offsets_nbytes);
 2911|  12.2k|  blosc2_free_ctx(dctx);
 2912|  12.2k|  if (off_nbytes != offsets_nbytes) {
  ------------------
  |  Branch (2912:7): [True: 10.4k, False: 1.84k]
  ------------------
 2913|  10.4k|    free(offsets);
 2914|  10.4k|    BLOSC_TRACE_ERROR("Cannot decompress offsets chunk.");
  ------------------
  |  |   93|  10.4k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  10.4k|    do {                                            \
  |  |  |  |   98|  10.4k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  10.4k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10.4k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  10.4k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2915|  10.4k|    return BLOSC2_ERROR_DATA;
 2916|  10.4k|  }
 2917|       |
 2918|  10.0G|  for (int64_t i = 0; i < nchunks; ++i) {
  ------------------
  |  Branch (2918:23): [True: 10.0G, False: 1.68k]
  ------------------
 2919|  10.0G|    int64_t offset = offsets[i];
 2920|  10.0G|    if (offset < 0) {
  ------------------
  |  Branch (2920:9): [True: 3.81G, False: 6.28G]
  ------------------
 2921|  3.81G|      continue;
 2922|  3.81G|    }
 2923|  6.28G|    if (offset > INT64_MAX - header_len || offset > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2923:9): [True: 7, False: 6.28G]
  |  Branch (2923:44): [True: 154, False: 6.28G]
  ------------------
 2924|    161|      free(offsets);
 2925|    161|      BLOSC_TRACE_ERROR("Offset for chunk %" PRId64 " is out of bounds.", i);
  ------------------
  |  |   93|    161|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    161|    do {                                            \
  |  |  |  |   98|    161|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    161|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 161, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    161|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2926|    161|      return BLOSC2_ERROR_INVALID_HEADER;
 2927|    161|    }
 2928|       |    /* Offsets do not need to be monotonic.  Frame mutations like insert can append
 2929|       |     * chunk payloads at the end of the cframe while updating the logical chunk order
 2930|       |     * only in the offsets table, so a valid frame may legitimately contain
 2931|       |     * non-monotonic non-negative offsets.
 2932|       |     */
 2933|  6.28G|  }
 2934|       |
 2935|  1.68k|  free(offsets);
 2936|  1.68k|  return 0;
 2937|  1.84k|}

blosc2_schunk_get_cparams:
   70|  12.8k|int blosc2_schunk_get_cparams(blosc2_schunk *schunk, blosc2_cparams **cparams) {
   71|  12.8k|  *cparams = calloc(1, sizeof(blosc2_cparams));
   72|  12.8k|  (*cparams)->schunk = schunk;
   73|  90.2k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (73:19): [True: 77.3k, False: 12.8k]
  ------------------
   74|  77.3k|    (*cparams)->filters[i] = schunk->filters[i];
   75|  77.3k|    (*cparams)->filters_meta[i] = schunk->filters_meta[i];
   76|  77.3k|  }
   77|  12.8k|  (*cparams)->compcode = schunk->compcode;
   78|  12.8k|  (*cparams)->compcode_meta = schunk->compcode_meta;
   79|  12.8k|  (*cparams)->clevel = schunk->clevel;
   80|  12.8k|  (*cparams)->typesize = schunk->typesize;
   81|  12.8k|  (*cparams)->blocksize = schunk->blocksize;
   82|  12.8k|  (*cparams)->splitmode = schunk->splitmode;
   83|  12.8k|  (*cparams)->use_dict = schunk->use_dict;
   84|  12.8k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (84:7): [True: 12.8k, False: 0]
  ------------------
   85|  12.8k|    (*cparams)->nthreads = blosc2_get_nthreads();
   86|  12.8k|  }
   87|      0|  else {
   88|      0|    (*cparams)->nthreads = (int16_t)schunk->cctx->nthreads;
   89|      0|  }
   90|  12.8k|  return 0;
   91|  12.8k|}
blosc2_schunk_get_dparams:
   95|  12.8k|int blosc2_schunk_get_dparams(blosc2_schunk *schunk, blosc2_dparams **dparams) {
   96|  12.8k|  *dparams = calloc(1, sizeof(blosc2_dparams));
   97|  12.8k|  (*dparams)->schunk = schunk;
   98|  12.8k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (98:7): [True: 12.8k, False: 0]
  ------------------
   99|  12.8k|    (*dparams)->nthreads = blosc2_get_nthreads();
  100|  12.8k|  }
  101|      0|  else {
  102|      0|    (*dparams)->nthreads = schunk->dctx->nthreads;
  103|      0|  }
  104|  12.8k|  return 0;
  105|  12.8k|}
schunk_free_metalayers:
  653|  13.6k|void schunk_free_metalayers(blosc2_schunk *schunk) {
  654|  13.8k|  for (int i = 0; i < schunk->nmetalayers; i++) {
  ------------------
  |  Branch (654:19): [True: 213, False: 13.6k]
  ------------------
  655|    213|    if (schunk->metalayers[i] != NULL) {
  ------------------
  |  Branch (655:9): [True: 27, False: 186]
  ------------------
  656|     27|      free(schunk->metalayers[i]->name);
  657|     27|      free(schunk->metalayers[i]->content);
  658|     27|      free(schunk->metalayers[i]);
  659|       |      schunk->metalayers[i] = NULL;
  660|     27|    }
  661|    213|  }
  662|  13.6k|  schunk->nmetalayers = 0;
  663|  13.6k|}
schunk_free_vlmetalayers:
  666|  13.6k|void schunk_free_vlmetalayers(blosc2_schunk *schunk) {
  667|  50.5k|  for (int i = 0; i < schunk->nvlmetalayers; i++) {
  ------------------
  |  Branch (667:19): [True: 36.9k, False: 13.6k]
  ------------------
  668|  36.9k|    if (schunk->vlmetalayers[i] != NULL) {
  ------------------
  |  Branch (668:9): [True: 316, False: 36.6k]
  ------------------
  669|    316|      free(schunk->vlmetalayers[i]->name);
  670|    316|      free(schunk->vlmetalayers[i]->content);
  671|    316|      free(schunk->vlmetalayers[i]);
  672|       |      schunk->vlmetalayers[i] = NULL;
  673|    316|    }
  674|  36.9k|  }
  675|  13.6k|  schunk->nvlmetalayers = 0;
  676|  13.6k|}
blosc2_schunk_free:
  679|  13.6k|int blosc2_schunk_free(blosc2_schunk *schunk) {
  680|  13.6k|  int err = 0;
  681|       |
  682|       |  // If it is a view, the data belongs to original array and should not be freed
  683|  13.6k|  if (schunk->data != NULL && !schunk->view) {
  ------------------
  |  Branch (683:7): [True: 0, False: 13.6k]
  |  Branch (683:31): [True: 0, False: 0]
  ------------------
  684|      0|    for (int i = 0; i < schunk->nchunks; i++) {
  ------------------
  |  Branch (684:21): [True: 0, False: 0]
  ------------------
  685|      0|      free(schunk->data[i]);
  686|      0|    }
  687|      0|    free(schunk->data);
  688|      0|  }
  689|  13.6k|  if (schunk->cctx != NULL)
  ------------------
  |  Branch (689:7): [True: 12.8k, False: 788]
  ------------------
  690|  12.8k|    blosc2_free_ctx(schunk->cctx);
  691|  13.6k|  if (schunk->dctx != NULL)
  ------------------
  |  Branch (691:7): [True: 12.8k, False: 788]
  ------------------
  692|  12.8k|    blosc2_free_ctx(schunk->dctx);
  693|  13.6k|  if (schunk->blockshape != NULL)
  ------------------
  |  Branch (693:7): [True: 0, False: 13.6k]
  ------------------
  694|      0|    free(schunk->blockshape);
  695|       |
  696|  13.6k|  schunk_free_metalayers(schunk);
  697|       |
  698|  13.6k|  if (schunk->storage != NULL) {
  ------------------
  |  Branch (698:7): [True: 12.8k, False: 788]
  ------------------
  699|  12.8k|    blosc2_io_cb *io_cb = blosc2_get_io_cb(schunk->storage->io->id);
  700|  12.8k|    if (io_cb != NULL) {
  ------------------
  |  Branch (700:9): [True: 12.8k, False: 0]
  ------------------
  701|  12.8k|      int rc = io_cb->destroy(schunk->storage->io->params);
  702|  12.8k|      if (rc < 0) {
  ------------------
  |  Branch (702:11): [True: 0, False: 12.8k]
  ------------------
  703|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|      0|        err = 1;
  705|      0|      }
  706|  12.8k|    }
  707|       |
  708|  12.8k|    if (schunk->storage->urlpath != NULL) {
  ------------------
  |  Branch (708:9): [True: 0, False: 12.8k]
  ------------------
  709|      0|      free(schunk->storage->urlpath);
  710|      0|    }
  711|  12.8k|    free(schunk->storage->cparams);
  712|  12.8k|    free(schunk->storage->dparams);
  713|  12.8k|    free(schunk->storage->io);
  714|  12.8k|    free(schunk->storage);
  715|  12.8k|  }
  716|       |
  717|       |  // If it is a view, the frame belongs to original array and should not be freed
  718|  13.6k|  if (schunk->frame != NULL && !schunk->view) {
  ------------------
  |  Branch (718:7): [True: 13.6k, False: 0]
  |  Branch (718:32): [True: 13.6k, False: 0]
  ------------------
  719|  13.6k|    frame_free((blosc2_frame_s *) schunk->frame);
  720|  13.6k|  }
  721|       |
  722|  13.6k|  schunk_free_vlmetalayers(schunk);
  723|       |
  724|  13.6k|  free(schunk);
  725|       |
  726|  13.6k|  return err;
  727|  13.6k|}
blosc2_schunk_from_buffer:
  731|  14.0k|blosc2_schunk* blosc2_schunk_from_buffer(uint8_t *cframe, int64_t len, bool copy) {
  732|       |  // Check that the buffer actually comes from a cframe
  733|  14.0k|  if (cframe == NULL || len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  14.0k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  14.0k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  14.0k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  14.0k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  14.0k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  14.0k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  14.0k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  14.0k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  14.0k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  14.0k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  14.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  14.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  14.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  14.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (733:7): [True: 0, False: 14.0k]
  |  Branch (733:25): [True: 15, False: 14.0k]
  ------------------
  734|     15|    return NULL;
  735|     15|  }
  736|  14.0k|  char *magic_number = (char *)cframe + FRAME_HEADER_MAGIC;
  ------------------
  |  |   29|  14.0k|#define FRAME_HEADER_MAGIC 2
  ------------------
  737|  14.0k|  if (memcmp(magic_number, "b2frame", sizeof("b2frame")) != 0) {
  ------------------
  |  Branch (737:7): [True: 188, False: 13.8k]
  ------------------
  738|    188|    return NULL;
  739|    188|  }
  740|  13.8k|  blosc2_frame_s* frame = frame_from_cframe(cframe, len, false);
  741|  13.8k|  if (frame == NULL) {
  ------------------
  |  Branch (741:7): [True: 208, False: 13.6k]
  ------------------
  742|    208|    return NULL;
  743|    208|  }
  744|  13.6k|  blosc2_schunk* schunk = frame_to_schunk(frame, copy, &BLOSC2_IO_DEFAULTS);
  745|  13.6k|  if (schunk && copy) {
  ------------------
  |  Branch (745:7): [True: 690, False: 12.9k]
  |  Branch (745:17): [True: 0, False: 690]
  ------------------
  746|       |    // Super-chunk has its own copy of frame
  747|      0|    frame_free(frame);
  748|      0|  }
  749|  13.6k|  return schunk;
  750|  13.8k|}
blosc2_schunk_decompress_chunk:
 1482|  54.8k|                                   void *dest, int32_t nbytes) {
 1483|  54.8k|  int rc = validate_nchunk(schunk, nchunk, false, "blosc2_schunk_decompress_chunk");
 1484|  54.8k|  if (rc < 0) {
  ------------------
  |  Branch (1484:7): [True: 0, False: 54.8k]
  ------------------
 1485|      0|    return rc;
 1486|      0|  }
 1487|       |
 1488|  54.8k|  int32_t chunk_nbytes;
 1489|  54.8k|  int32_t chunk_cbytes;
 1490|  54.8k|  int chunksize;
 1491|  54.8k|  blosc2_frame_s* frame = (blosc2_frame_s*)schunk->frame;
 1492|       |
 1493|  54.8k|  schunk->current_nchunk = nchunk;
 1494|  54.8k|  if (frame == NULL) {
  ------------------
  |  Branch (1494:7): [True: 0, False: 54.8k]
  ------------------
 1495|      0|    uint8_t* src = schunk->data[nchunk];
 1496|      0|    if (src == 0) {
  ------------------
  |  Branch (1496:9): [True: 0, False: 0]
  ------------------
 1497|      0|      return 0;
 1498|      0|    }
 1499|       |
 1500|      0|    rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1501|      0|    if (rc < 0) {
  ------------------
  |  Branch (1501:9): [True: 0, False: 0]
  ------------------
 1502|      0|      return rc;
 1503|      0|    }
 1504|       |
 1505|      0|    if (nbytes < chunk_nbytes) {
  ------------------
  |  Branch (1505:9): [True: 0, False: 0]
  ------------------
 1506|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1507|      0|                        "('%d' bytes, but '%d' are needed).", nbytes, chunk_nbytes);
 1508|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1509|      0|    }
 1510|       |
 1511|      0|    chunksize = blosc2_decompress_ctx(schunk->dctx, src, chunk_cbytes, dest, nbytes);
 1512|      0|    if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (1512:9): [True: 0, False: 0]
  |  Branch (1512:26): [True: 0, False: 0]
  ------------------
 1513|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1514|      0|      if (chunksize < 0)
  ------------------
  |  Branch (1514:11): [True: 0, False: 0]
  ------------------
 1515|      0|        return chunksize;
 1516|      0|      return BLOSC2_ERROR_FAILURE;
 1517|      0|    }
 1518|  54.8k|  } else {
 1519|  54.8k|    rc = frame_lock(frame, false);
 1520|  54.8k|    if (rc < 0) {
  ------------------
  |  Branch (1520:9): [True: 0, False: 54.8k]
  ------------------
 1521|      0|      return rc;
 1522|      0|    }
 1523|  54.8k|    chunksize = frame_decompress_chunk(schunk->dctx, frame, nchunk, dest, nbytes);
 1524|  54.8k|    frame_unlock(frame);
 1525|  54.8k|    if (chunksize < 0) {
  ------------------
  |  Branch (1525:9): [True: 511, False: 54.3k]
  ------------------
 1526|    511|      return chunksize;
 1527|    511|    }
 1528|  54.8k|  }
 1529|  54.3k|  return chunksize;
 1530|  54.8k|}
schunk.c:validate_nchunk:
   44|  54.8k|static int validate_nchunk(blosc2_schunk *schunk, int64_t nchunk, bool allow_end, const char *func_name) {
   45|  54.8k|  if (nchunk < 0) {
  ------------------
  |  Branch (45:7): [True: 0, False: 54.8k]
  ------------------
   46|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|      0|    return BLOSC2_ERROR_INVALID_PARAM;
   48|      0|  }
   49|       |
   50|  54.8k|  if (allow_end) {
  ------------------
  |  Branch (50:7): [True: 0, False: 54.8k]
  ------------------
   51|      0|    if (nchunk > schunk->nchunks) {
  ------------------
  |  Branch (51:9): [True: 0, False: 0]
  ------------------
   52|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|      0|                        nchunk, schunk->nchunks, func_name);
   54|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   55|      0|    }
   56|      0|  }
   57|  54.8k|  else {
   58|  54.8k|    if (nchunk >= schunk->nchunks) {
  ------------------
  |  Branch (58:9): [True: 0, False: 54.8k]
  ------------------
   59|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|      0|                        "('%" PRId64 "') in %s.", nchunk, schunk->nchunks, func_name);
   61|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   62|      0|    }
   63|  54.8k|  }
   64|       |
   65|  54.8k|  return BLOSC2_ERROR_SUCCESS;
   66|  54.8k|}

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

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

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

blosc2_unshuffle:
  436|   123k|                 const void* src, void* dest) {
  437|       |  /* Initialize the shuffle implementation if necessary. */
  438|   123k|  init_shuffle_implementation();
  439|       |
  440|   123k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (440:7): [True: 0, False: 123k]
  |  Branch (440:23): [True: 0, False: 123k]
  |  Branch (440:41): [True: 0, False: 123k]
  ------------------
  441|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  442|      0|  }
  443|       |
  444|       |  /* The implementation is initialized.
  445|       |     Dispatch to it's unshuffle routine. */
  446|   123k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  447|       |
  448|   123k|  return blocksize;
  449|   123k|}
bitunshuffle:
  484|  60.7k|                     const uint8_t format_version) {
  485|       |  /* Initialize the shuffle implementation if necessary. */
  486|  60.7k|  init_shuffle_implementation();
  487|  60.7k|  size_t size = blocksize / typesize;
  488|       |
  489|  60.7k|  if (format_version == 2) {
  ------------------
  |  Branch (489:7): [True: 5.94k, False: 54.8k]
  ------------------
  490|       |    /* Starting from version 3, bitshuffle() works differently */
  491|  5.94k|    if ((size % 8) == 0) {
  ------------------
  |  Branch (491:9): [True: 1.60k, False: 4.34k]
  ------------------
  492|       |      /* The number of elems is a multiple of 8 which is supported by
  493|       |         bitshuffle. */
  494|  1.60k|      int ret = (int) (host_implementation.bitunshuffle)
  495|  1.60k|          ((const void *) src, (void *) dest, blocksize / typesize, typesize);
  496|  1.60k|      if (ret < 0) {
  ------------------
  |  Branch (496:11): [True: 0, False: 1.60k]
  ------------------
  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|  1.60k|    }
  502|  4.34k|    else {
  503|  4.34k|      memcpy(dest, src, blocksize);
  504|  4.34k|    }
  505|  5.94k|  }
  506|  54.8k|  else {
  507|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  508|  54.8k|    size -= size % 8;
  509|  54.8k|    int ret = (int) (host_implementation.bitunshuffle)(src, dest, size, typesize);
  510|  54.8k|    if (ret < 0) {
  ------------------
  |  Branch (510:9): [True: 0, False: 54.8k]
  ------------------
  511|      0|      BLOSC_TRACE_ERROR("the impossible happened: the bitunshuffle filter failed!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|      0|      return ret;
  513|      0|    }
  514|       |
  515|       |    /* Copy the leftovers */
  516|  54.8k|    size_t offset = size * typesize;
  517|  54.8k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  518|  54.8k|  }
  519|       |
  520|  60.7k|  return blocksize;
  521|  60.7k|}
shuffle.c:init_shuffle_implementation:
  391|   184k|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|   184k|#if defined(__GNUC__) || defined(__clang__)
  401|   184k|  if (__builtin_expect(!implementation_initialized, 0)) {
  ------------------
  |  Branch (401:7): [True: 1, False: 184k]
  ------------------
  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|   184k|}
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|  9.91k|int blosc_stune_next_blocksize(blosc2_context *context) {
   48|  9.91k|  int32_t clevel = context->clevel;
   49|  9.91k|  int32_t typesize = context->typesize;
   50|  9.91k|  int32_t nbytes = context->sourcesize;
   51|  9.91k|  int32_t user_blocksize = context->blocksize;
   52|  9.91k|  int32_t blocksize = nbytes;
   53|       |
   54|       |  // Protection against very small buffers
   55|  9.91k|  if (nbytes < typesize) {
  ------------------
  |  Branch (55:7): [True: 8.43k, False: 1.47k]
  ------------------
   56|  8.43k|    context->blocksize = 1;
   57|  8.43k|    return BLOSC2_ERROR_SUCCESS;
   58|  8.43k|  }
   59|       |
   60|  1.47k|  int splitmode = split_block(context, typesize, blocksize);
   61|  1.47k|  if (user_blocksize) {
  ------------------
  |  Branch (61:7): [True: 1.04k, False: 439]
  ------------------
   62|  1.04k|    blocksize = user_blocksize;
   63|  1.04k|    goto last;
   64|  1.04k|  }
   65|       |
   66|    439|  if (nbytes >= L1) {
  ------------------
  |  |   19|    439|#define L1 (32 * 1024)
  ------------------
  |  Branch (66:7): [True: 438, False: 1]
  ------------------
   67|    438|    blocksize = L1;
  ------------------
  |  |   19|    438|#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|    438|    if (is_HCR(context)) {
  ------------------
  |  Branch (72:9): [True: 0, False: 438]
  ------------------
   73|      0|      blocksize *= 2;
   74|      0|    }
   75|       |
   76|       |    // Choose a different blocksize depending on the compression level
   77|    438|    switch (clevel) {
   78|      0|      case 0:
  ------------------
  |  Branch (78:7): [True: 0, False: 438]
  ------------------
   79|       |        // Case of plain copy
   80|      0|        blocksize /= 4;
   81|      0|        break;
   82|      0|      case 1:
  ------------------
  |  Branch (82:7): [True: 0, False: 438]
  ------------------
   83|      0|        blocksize /= 2;
   84|      0|        break;
   85|      0|      case 2:
  ------------------
  |  Branch (85:7): [True: 0, False: 438]
  ------------------
   86|      0|        blocksize *= 1;
   87|      0|        break;
   88|      0|      case 3:
  ------------------
  |  Branch (88:7): [True: 0, False: 438]
  ------------------
   89|      0|        blocksize *= 2;
   90|      0|        break;
   91|      0|      case 4:
  ------------------
  |  Branch (91:7): [True: 0, False: 438]
  ------------------
   92|    438|      case 5:
  ------------------
  |  Branch (92:7): [True: 438, False: 0]
  ------------------
   93|    438|        blocksize *= 4;
   94|    438|        break;
   95|      0|      case 6:
  ------------------
  |  Branch (95:7): [True: 0, False: 438]
  ------------------
   96|      0|      case 7:
  ------------------
  |  Branch (96:7): [True: 0, False: 438]
  ------------------
   97|      0|      case 8:
  ------------------
  |  Branch (97:7): [True: 0, False: 438]
  ------------------
   98|      0|        blocksize *= 8;
   99|      0|        break;
  100|      0|      case 9:
  ------------------
  |  Branch (100:7): [True: 0, False: 438]
  ------------------
  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: 438]
  ------------------
  108|      0|        break;
  109|    438|    }
  110|    438|  }
  111|       |
  112|       |  /* Now the blocksize for splittable codecs */
  113|    439|  if (clevel > 0 && splitmode) {
  ------------------
  |  Branch (113:7): [True: 439, False: 0]
  |  Branch (113:21): [True: 360, False: 79]
  ------------------
  114|       |    // For performance reasons, do not exceed 256 KB (it must fit in L2 cache)
  115|    360|    switch (clevel) {
  116|      0|      case 1:
  ------------------
  |  Branch (116:7): [True: 0, False: 360]
  ------------------
  117|      0|      case 2:
  ------------------
  |  Branch (117:7): [True: 0, False: 360]
  ------------------
  118|      0|      case 3:
  ------------------
  |  Branch (118:7): [True: 0, False: 360]
  ------------------
  119|      0|        blocksize = 32 * 1024;
  120|      0|        break;
  121|      0|      case 4:
  ------------------
  |  Branch (121:7): [True: 0, False: 360]
  ------------------
  122|    360|      case 5:
  ------------------
  |  Branch (122:7): [True: 360, False: 0]
  ------------------
  123|    360|      case 6:
  ------------------
  |  Branch (123:7): [True: 0, False: 360]
  ------------------
  124|    360|        blocksize = 64 * 1024;
  125|    360|        break;
  126|      0|      case 7:
  ------------------
  |  Branch (126:7): [True: 0, False: 360]
  ------------------
  127|      0|        blocksize = 128 * 1024;
  128|      0|        break;
  129|      0|      case 8:
  ------------------
  |  Branch (129:7): [True: 0, False: 360]
  ------------------
  130|      0|        blocksize = 256 * 1024;
  131|      0|        break;
  132|      0|      case 9:
  ------------------
  |  Branch (132:7): [True: 0, False: 360]
  ------------------
  133|      0|      default:
  ------------------
  |  Branch (133:7): [True: 0, False: 360]
  ------------------
  134|      0|        blocksize = 512 * 1024;
  135|      0|        break;
  136|    360|    }
  137|       |    // Multiply by typesize to get proper split sizes
  138|    360|    blocksize *= typesize;
  139|       |    // But do not exceed 4 MB per thread (having this capacity in L3 is normal in modern CPUs)
  140|    360|    if (blocksize > 4 * 1024 * 1024) {
  ------------------
  |  Branch (140:9): [True: 0, False: 360]
  ------------------
  141|      0|      blocksize = 4 * 1024 * 1024;
  142|      0|    }
  143|    360|    if (blocksize < 32 * 1024) {
  ------------------
  |  Branch (143:9): [True: 0, False: 360]
  ------------------
  144|       |      /* Do not use a too small blocksize (< 32 KB) when typesize is small */
  145|      0|      blocksize = 32 * 1024;
  146|      0|    }
  147|    360|  }
  148|       |
  149|  1.47k|  last:
  150|       |  /* Check that blocksize is not too large */
  151|  1.47k|  if (blocksize > nbytes) {
  ------------------
  |  Branch (151:7): [True: 930, False: 549]
  ------------------
  152|    930|    blocksize = nbytes;
  153|    930|  }
  154|       |
  155|       |  // blocksize *must absolutely* be a multiple of the typesize
  156|  1.47k|  if (blocksize > typesize) {
  ------------------
  |  Branch (156:7): [True: 533, False: 946]
  ------------------
  157|    533|    blocksize = blocksize / typesize * typesize;
  158|    533|  }
  159|       |
  160|  1.47k|  context->blocksize = blocksize;
  161|  1.47k|  BLOSC_INFO("compcode: %d, clevel: %d, blocksize: %d, splitmode: %d, typesize: %d",
  ------------------
  |  |  121|  1.47k|    do {                                            \
  |  |  122|  1.47k|        const char *__e = getenv("BLOSC_INFO");     \
  |  |  123|  1.47k|        if (!__e) { break; }                        \
  |  |  ------------------
  |  |  |  Branch (123:13): [True: 1.47k, False: 0]
  |  |  ------------------
  |  |  124|  1.47k|        fprintf(stderr, "[INFO] - " msg "\n", ##__VA_ARGS__); \
  |  |  125|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (125:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  162|  1.47k|             context->compcode, context->clevel, blocksize, splitmode, typesize);
  163|       |
  164|  1.47k|  return BLOSC2_ERROR_SUCCESS;
  165|    439|}
split_block:
  186|  1.47k|int split_block(blosc2_context *context, int32_t typesize, int32_t blocksize) {
  187|  1.47k|  switch (context->splitmode) {
  188|      0|    case BLOSC_ALWAYS_SPLIT:
  ------------------
  |  Branch (188:5): [True: 0, False: 1.47k]
  ------------------
  189|      0|      return 1;
  190|      0|    case BLOSC_NEVER_SPLIT:
  ------------------
  |  Branch (190:5): [True: 0, False: 1.47k]
  ------------------
  191|      0|      return 0;
  192|  1.47k|    case BLOSC_FORWARD_COMPAT_SPLIT:
  ------------------
  |  Branch (192:5): [True: 1.47k, False: 0]
  ------------------
  193|  1.47k|    case BLOSC_AUTO_SPLIT:
  ------------------
  |  Branch (193:5): [True: 0, False: 1.47k]
  ------------------
  194|       |      // These cases will be handled later
  195|  1.47k|      break;
  196|      0|    default:
  ------------------
  |  Branch (196:5): [True: 0, False: 1.47k]
  ------------------
  197|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  1.47k|  }
  199|       |
  200|  1.47k|  int compcode = context->compcode;
  201|  1.47k|  if (compcode == BLOSC_CODEC_OPENZL) {
  ------------------
  |  Branch (201:7): [True: 0, False: 1.47k]
  ------------------
  202|       |    // Never split blocks for OpenZL, as it has its own block mechanisms
  203|      0|    return 0;
  204|      0|  }
  205|  1.47k|  return (
  206|       |          // Fast codecs like blosclz, lz4 seems to prefer to split
  207|  1.47k|          ((compcode == BLOSC_BLOSCLZ) || (compcode == BLOSC_LZ4)
  ------------------
  |  Branch (207:12): [True: 1.47k, False: 0]
  |  Branch (207:43): [True: 0, False: 0]
  ------------------
  208|       |            // and low levels of zstd too
  209|      0|            || ((compcode == BLOSC_ZSTD) && (context->clevel <= 5))
  ------------------
  |  Branch (209:17): [True: 0, False: 0]
  |  Branch (209:45): [True: 0, False: 0]
  ------------------
  210|  1.47k|            ) &&
  211|       |          // ...but split seems to harm cratio too much when not using shuffle
  212|  1.47k|          (context->filter_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (212:11): [True: 1.47k, False: 0]
  ------------------
  213|  1.47k|          (typesize <= MAX_STREAMS) &&
  ------------------
  |  |   24|  1.47k|#define MAX_STREAMS 16 /* Cannot be larger than 128 */
  ------------------
  |  Branch (213:11): [True: 523, False: 956]
  ------------------
  214|    523|          (blocksize / typesize) >= BLOSC_MIN_BUFFERSIZE);
  ------------------
  |  Branch (214:11): [True: 520, False: 3]
  ------------------
  215|  1.47k|}
stune.c:is_HCR:
   21|    438|static bool is_HCR(blosc2_context * context) {
   22|    438|  switch (context->compcode) {
   23|    438|    case BLOSC_BLOSCLZ :
  ------------------
  |  Branch (23:5): [True: 438, False: 0]
  ------------------
   24|    438|      return false;
   25|      0|    case BLOSC_LZ4 :
  ------------------
  |  Branch (25:5): [True: 0, False: 438]
  ------------------
   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: 438]
  ------------------
   30|      0|    case BLOSC_ZLIB :
  ------------------
  |  Branch (30:5): [True: 0, False: 438]
  ------------------
   31|      0|    case BLOSC_ZSTD :
  ------------------
  |  Branch (31:5): [True: 0, False: 438]
  ------------------
   32|      0|      return true;
   33|      0|    default :
  ------------------
  |  Branch (33:5): [True: 0, False: 438]
  ------------------
   34|       |      return false;
   35|    438|  }
   36|    438|}

blosc2.c:print_error:
  525|     46|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     46|  return (char *) blosc2_error_string(rc);
  528|     46|}
ndcell.c:blosc2_meta_get:
 2447|      8|                                  int32_t *content_len) {
 2448|      8|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2448:7): [True: 7, False: 1]
  |  Branch (2448:25): [True: 0, False: 1]
  |  Branch (2448:41): [True: 0, False: 1]
  |  Branch (2448:60): [True: 0, False: 1]
  ------------------
 2449|      7|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|      7|    return BLOSC2_ERROR_INVALID_PARAM;
 2451|      7|  }
 2452|       |
 2453|      1|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2454|      1|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2454:7): [True: 1, False: 0]
  ------------------
 2455|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2456|      1|    return nmetalayer;
 2457|      1|  }
 2458|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2459|      0|  if (len < 0) {
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2461|      0|    return BLOSC2_ERROR_DATA;
 2462|      0|  }
 2463|      0|  *content_len = len;
 2464|      0|  if (len == 0) {
  ------------------
  |  Branch (2464:7): [True: 0, False: 0]
  ------------------
 2465|      0|    *content = NULL;
 2466|      0|    return nmetalayer;
 2467|      0|  }
 2468|      0|  *content = (uint8_t*)malloc((size_t)len);
 2469|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2469:7): [True: 0, False: 0]
  ------------------
 2470|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2471|      0|    *content_len = 0;
 2472|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2473|      0|  }
 2474|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2474:7): [True: 0, False: 0]
  |  Branch (2474:18): [True: 0, False: 0]
  ------------------
 2475|      0|    free(*content);
 2476|      0|    *content = NULL;
 2477|      0|    *content_len = 0;
 2478|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|    return BLOSC2_ERROR_DATA;
 2480|      0|  }
 2481|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2482|      0|  return nmetalayer;
 2483|      0|}
ndcell.c:blosc2_meta_exists:
 2378|      1|static inline int blosc2_meta_exists(blosc2_schunk *schunk, const char *name) {
 2379|      1|  if (strlen(name) > BLOSC2_METALAYER_NAME_MAXLEN) {
  ------------------
  |  | 1745|      1|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  ------------------
  |  Branch (2379:7): [True: 0, False: 1]
  ------------------
 2380|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2380|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1745|      0|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2381|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2382|      0|  }
 2383|       |
 2384|      1|  if (schunk == NULL) {
  ------------------
  |  Branch (2384:7): [True: 0, False: 1]
  ------------------
 2385|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2386|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2387|      0|  }
 2388|       |
 2389|      1|  for (int nmetalayer = 0; nmetalayer < schunk->nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2389:28): [True: 0, False: 1]
  ------------------
 2390|      0|    if (strcmp(name, schunk->metalayers[nmetalayer]->name) == 0) {
  ------------------
  |  Branch (2390:9): [True: 0, False: 0]
  ------------------
 2391|      0|      return nmetalayer;
 2392|      0|    }
 2393|      0|  }
 2394|      1|  return BLOSC2_ERROR_NOT_FOUND;
 2395|      1|}
ndmean.c:blosc2_meta_get:
 2447|      4|                                  int32_t *content_len) {
 2448|      4|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2448:7): [True: 4, False: 0]
  |  Branch (2448:25): [True: 0, False: 0]
  |  Branch (2448:41): [True: 0, False: 0]
  |  Branch (2448:60): [True: 0, False: 0]
  ------------------
 2449|      4|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|      4|    return BLOSC2_ERROR_INVALID_PARAM;
 2451|      4|  }
 2452|       |
 2453|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2454|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2454:7): [True: 0, False: 0]
  ------------------
 2455|      0|    BLOSC_TRACE_WARNING("Metalayer \"%s\" not found.", name);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2456|      0|    return nmetalayer;
 2457|      0|  }
 2458|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2459|      0|  if (len < 0) {
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2461|      0|    return BLOSC2_ERROR_DATA;
 2462|      0|  }
 2463|      0|  *content_len = len;
 2464|      0|  if (len == 0) {
  ------------------
  |  Branch (2464:7): [True: 0, False: 0]
  ------------------
 2465|      0|    *content = NULL;
 2466|      0|    return nmetalayer;
 2467|      0|  }
 2468|      0|  *content = (uint8_t*)malloc((size_t)len);
 2469|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2469:7): [True: 0, False: 0]
  ------------------
 2470|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2471|      0|    *content_len = 0;
 2472|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2473|      0|  }
 2474|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2474:7): [True: 0, False: 0]
  |  Branch (2474:18): [True: 0, False: 0]
  ------------------
 2475|      0|    free(*content);
 2476|      0|    *content = NULL;
 2477|      0|    *content_len = 0;
 2478|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|    return BLOSC2_ERROR_DATA;
 2480|      0|  }
 2481|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2482|      0|  return nmetalayer;
 2483|      0|}
bytedelta.c:print_error:
  525|     18|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     18|  return (char *) blosc2_error_string(rc);
  528|     18|}

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

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

ndlz4_decompress:
  526|    305|                     uint8_t meta, blosc2_dparams *dparams) {
  527|    305|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    305|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  528|    305|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    305|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  529|    305|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    305|    do {                                            \
  |  |  105|    305|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 305]
  |  |  ------------------
  |  |  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|    305|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 305]
  |  |  ------------------
  ------------------
  530|    305|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    305|    do {                                            \
  |  |  105|    305|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 305]
  |  |  ------------------
  |  |  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|    305|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 305]
  |  |  ------------------
  ------------------
  531|       |
  532|    305|  uint8_t *ip = (uint8_t *) input;
  533|    305|  uint8_t *op = (uint8_t *) output;
  534|    305|  uint8_t ndim;
  535|    305|  int32_t blockshape[2];
  536|    305|  int32_t eshape[2];
  537|    305|  uint8_t *buffercpy;
  538|    305|  uint8_t local_buffer[16];
  539|    305|  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|    305|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    305|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 304]
  |  |  ------------------
  ------------------
  546|      1|    return 0;
  547|      1|  }
  548|    304|  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|    304|#define NDLZ4_CHECK_RANGE(pos, len)                                              \
  560|    304|  do {                                                                           \
  561|    304|    int64_t _pos = (int64_t) (pos);                                              \
  562|    304|    int64_t _len = (int64_t) (len);                                              \
  563|    304|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  564|    304|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  565|    304|      return BLOSC2_ERROR_FAILURE;                                               \
  566|    304|    }                                                                            \
  567|    304|  } while (0)
  568|       |
  569|       |  /* we start with literal copy */
  570|    304|  ndim = *ip;
  571|    304|  ip++;
  572|    304|  if (ndim != 2) {
  ------------------
  |  Branch (572:7): [True: 1, False: 303]
  ------------------
  573|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      1|    return BLOSC2_ERROR_FAILURE;
  575|      1|  }
  576|    303|  memcpy(&blockshape[0], ip, 4);
  577|    303|  ip += 4;
  578|    303|  memcpy(&blockshape[1], ip, 4);
  579|    303|  ip += 4;
  580|       |
  581|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  582|    303|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (582:7): [True: 0, False: 303]
  |  Branch (582:25): [True: 26, False: 277]
  |  Branch (582:46): [True: 20, False: 257]
  ------------------
  583|     46|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     46|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     46|    do {                                            \
  |  |  |  |   98|     46|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     46|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 46, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     46|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     46|    return BLOSC2_ERROR_FAILURE;
  585|     46|  }
  586|       |
  587|    257|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  588|    257|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  589|       |
  590|    257|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    257|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 71, False: 186]
  |  |  ------------------
  ------------------
  591|     71|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     71|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     71|    do {                                            \
  |  |  |  |   98|     71|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     71|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 71, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     71|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     71|    return 0;
  593|     71|  }
  594|    186|  memset(op, 0, blockshape[0] * blockshape[1]);
  595|       |
  596|    186|  uint32_t i_stop[2];
  597|    558|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (597:19): [True: 372, False: 186]
  ------------------
  598|    372|    i_stop[i] = eshape[i] / 4;
  599|    372|  }
  600|       |
  601|       |  /* main loop */
  602|    186|  uint32_t ii[2];
  603|    186|  uint32_t padding[2] = {0};
  604|    186|  uint32_t ind = 0;
  605|    186|  uint8_t cell_aux[16];
  606|  1.81G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (606:19): [True: 1.81G, False: 30]
  ------------------
  607|  1.81G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (607:21): [True: 1.96k, False: 1.81G]
  ------------------
  608|  1.96k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  1.96k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 1.96k]
  |  |  ------------------
  ------------------
  609|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      0|        return BLOSC2_ERROR_FAILURE;
  611|      0|      }
  612|  1.96k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (612:11): [True: 396, False: 1.56k]
  ------------------
  613|    396|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (613:22): [True: 49, False: 347]
  ------------------
  614|  1.56k|      } else {
  615|  1.56k|        padding[0] = 4;
  616|  1.56k|      }
  617|  1.96k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (617:11): [True: 1.53k, False: 425]
  ------------------
  618|  1.53k|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (618:22): [True: 70, False: 1.46k]
  ------------------
  619|  1.53k|      } else {
  620|    425|        padding[1] = 4;
  621|    425|      }
  622|  1.96k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  623|  1.96k|      NDLZ4_CHECK_RANGE(cur, 1);
  ------------------
  |  |  560|  1.96k|  do {                                                                           \
  |  |  561|  1.96k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  1.96k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  1.96k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 1.96k]
  |  |  |  Branch (563:21): [True: 0, False: 1.96k]
  |  |  |  Branch (563:33): [True: 2, False: 1.96k]
  |  |  ------------------
  |  |  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.96k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 1.96k]
  |  |  ------------------
  ------------------
  624|  1.96k|      token = *ip++;
  625|  1.96k|      if (token == 0) {    // no match
  ------------------
  |  Branch (625:11): [True: 948, False: 1.01k]
  ------------------
  626|    948|        NDLZ4_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    948|  do {                                                                           \
  |  |  561|    948|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    948|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    948|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 948]
  |  |  |  Branch (563:21): [True: 0, False: 948]
  |  |  |  Branch (563:33): [True: 5, False: 943]
  |  |  ------------------
  |  |  564|      5|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      5|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      5|    }                                                                            \
  |  |  567|    948|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 943]
  |  |  ------------------
  ------------------
  627|    943|        buffercpy = ip;
  628|    943|        ip += padding[0] * padding[1];
  629|  1.01k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (629:18): [True: 113, False: 901]
  ------------------
  630|    113|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    113|  do {                                                                           \
  |  |  561|    113|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    113|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    113|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 113]
  |  |  |  Branch (563:21): [True: 0, False: 113]
  |  |  |  Branch (563:33): [True: 1, False: 112]
  |  |  ------------------
  |  |  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|    113|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 112]
  |  |  ------------------
  ------------------
  631|    112|        uint16_t offset;
  632|    112|        memcpy(&offset, ip, sizeof(offset));
  633|    112|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;   // back-reference start offset
  634|    112|        NDLZ4_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    112|  do {                                                                           \
  |  |  561|    112|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    112|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    112|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 18, False: 94]
  |  |  |  Branch (563:21): [True: 0, False: 94]
  |  |  |  Branch (563:33): [True: 1, False: 93]
  |  |  ------------------
  |  |  564|     19|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     19|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     19|    do {                                            \
  |  |  |  |  |  |   98|     19|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     19|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 19, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     19|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     19|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     19|    }                                                                            \
  |  |  567|    112|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 93]
  |  |  ------------------
  ------------------
  635|     93|        buffercpy = (uint8_t *) input + bpos;
  636|     93|        ip += 2;
  637|    901|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (637:18): [True: 116, False: 785]
  ------------------
  638|    116|        NDLZ4_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  560|    116|  do {                                                                           \
  |  |  561|    116|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    116|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    116|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 116]
  |  |  |  Branch (563:21): [True: 0, False: 116]
  |  |  |  Branch (563:33): [True: 1, False: 115]
  |  |  ------------------
  |  |  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|    116|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 115]
  |  |  ------------------
  ------------------
  639|    115|        buffercpy = cell_aux;
  640|    115|        memset(buffercpy, *ip, 16);
  641|    115|        ip++;
  642|    785|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (642:18): [True: 279, False: 506]
  ------------------
  643|    279|        buffercpy = local_buffer;
  644|    279|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    279|  do {                                                                           \
  |  |  561|    279|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    279|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    279|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 279]
  |  |  |  Branch (563:21): [True: 0, False: 279]
  |  |  |  Branch (563:33): [True: 1, False: 278]
  |  |  ------------------
  |  |  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|    279|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
  645|    278|        uint16_t offset;
  646|    278|        memcpy(&offset, ip, sizeof(offset));
  647|    278|        offset += 3;
  648|    278|        ip += 2;
  649|    278|        int i, j, k;
  650|    278|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (650:13): [True: 17, False: 261]
  ------------------
  651|     17|          i = 1;
  652|     17|          j = 2;
  653|     17|          k = 3;
  654|    261|        } else {
  655|    261|          i = 0;
  656|    261|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (656:15): [True: 32, False: 229]
  ------------------
  657|     32|            j = 1;
  658|     32|            k = 2;
  659|    229|          } else {
  660|    229|            k = 3;
  661|    229|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (661:17): [True: 40, False: 189]
  ------------------
  662|     40|              j = 1;
  663|    189|            } else {
  664|    189|              j = 2;
  665|    189|            }
  666|    229|          }
  667|    261|        }
  668|    278|        int64_t bpos = (cur + 3) - (int64_t) offset;   // == (ip - offset) as an offset
  669|    278|        NDLZ4_CHECK_RANGE(bpos, 12);
  ------------------
  |  |  560|    278|  do {                                                                           \
  |  |  561|    278|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    278|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    278|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 16, False: 262]
  |  |  |  Branch (563:21): [True: 0, False: 262]
  |  |  |  Branch (563:33): [True: 2, False: 260]
  |  |  ------------------
  |  |  564|     18|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     18|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     18|    do {                                            \
  |  |  |  |  |  |   98|     18|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     18|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 18, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     18|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     18|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     18|    }                                                                            \
  |  |  567|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 260]
  |  |  ------------------
  ------------------
  670|    260|        const uint8_t *ref = (const uint8_t *) input + bpos;
  671|    260|        memcpy(&buffercpy[i * 4], ref, 4);
  672|    260|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  673|    260|        memcpy(&buffercpy[k * 4], ref + 8, 4);
  674|    606|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (674:25): [True: 606, False: 0]
  ------------------
  675|    606|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (675:15): [True: 361, False: 245]
  |  Branch (675:27): [True: 292, False: 69]
  |  Branch (675:39): [True: 260, False: 32]
  ------------------
  676|    260|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    260|  do {                                                                           \
  |  |  561|    260|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    260|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    260|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 260]
  |  |  |  Branch (563:21): [True: 0, False: 260]
  |  |  |  Branch (563:33): [True: 4, False: 256]
  |  |  ------------------
  |  |  564|      4|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      4|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      4|    }                                                                            \
  |  |  567|    260|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 256]
  |  |  ------------------
  ------------------
  677|    256|            memcpy(&buffercpy[l * 4], ip, 4);
  678|    256|            ip += 4;
  679|    256|            break;
  680|    260|          }
  681|    606|        }
  682|       |
  683|    506|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (683:18): [True: 370, False: 136]
  |  Branch (683:36): [True: 367, False: 3]
  ------------------
  684|    367|        buffercpy = local_buffer;
  685|    367|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    367|  do {                                                                           \
  |  |  561|    367|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    367|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    367|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 367]
  |  |  |  Branch (563:21): [True: 0, False: 367]
  |  |  |  Branch (563:33): [True: 1, False: 366]
  |  |  ------------------
  |  |  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|    367|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 366]
  |  |  ------------------
  ------------------
  686|    366|        uint16_t offset;
  687|    366|        memcpy(&offset, ip, sizeof(offset));
  688|    366|        offset += 3;
  689|    366|        ip += 2;
  690|    366|        int i, j;
  691|    366|        if (token == 128) {
  ------------------
  |  Branch (691:13): [True: 72, False: 294]
  ------------------
  692|     72|          i = 2;
  693|     72|          j = 3;
  694|    294|        } else {
  695|    294|          i = (token - 128) >> 5U;
  696|    294|          j = ((token - 128) >> 3U) - (i << 2U);
  697|    294|        }
  698|    366|        int64_t bpos = (cur + 3) - (int64_t) offset;
  699|    366|        NDLZ4_CHECK_RANGE(bpos, 8);
  ------------------
  |  |  560|    366|  do {                                                                           \
  |  |  561|    366|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    366|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    366|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 25, False: 341]
  |  |  |  Branch (563:21): [True: 0, False: 341]
  |  |  |  Branch (563:33): [True: 1, False: 340]
  |  |  ------------------
  |  |  564|     26|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     26|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     26|    }                                                                            \
  |  |  567|    366|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 340]
  |  |  ------------------
  ------------------
  700|    340|        const uint8_t *ref = (const uint8_t *) input + bpos;
  701|    340|        memcpy(&buffercpy[i * 4], ref, 4);
  702|    340|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  703|  1.69k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (703:25): [True: 1.35k, False: 336]
  ------------------
  704|  1.35k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (704:15): [True: 1.01k, False: 338]
  |  Branch (704:27): [True: 775, False: 241]
  ------------------
  705|    775|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    775|  do {                                                                           \
  |  |  561|    775|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    775|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    775|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 775]
  |  |  |  Branch (563:21): [True: 0, False: 775]
  |  |  |  Branch (563:33): [True: 4, False: 771]
  |  |  ------------------
  |  |  564|      4|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      4|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      4|    }                                                                            \
  |  |  567|    775|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 771]
  |  |  ------------------
  ------------------
  706|    771|            memcpy(&buffercpy[k * 4], ip, 4);
  707|    771|            ip += 4;
  708|    771|          }
  709|  1.35k|        }
  710|    340|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (710:18): [True: 124, False: 15]
  |  Branch (710:35): [True: 112, False: 12]
  ------------------
  711|    112|        buffercpy = local_buffer;
  712|    112|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    112|  do {                                                                           \
  |  |  561|    112|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    112|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    112|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 112]
  |  |  |  Branch (563:21): [True: 0, False: 112]
  |  |  |  Branch (563:33): [True: 1, False: 111]
  |  |  ------------------
  |  |  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|    112|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 111]
  |  |  ------------------
  ------------------
  713|    111|        uint16_t offset_1;
  714|    111|        memcpy(&offset_1, ip, sizeof(offset_1));
  715|    111|        offset_1 += 5;
  716|    111|        ip += 2;
  717|    111|        NDLZ4_CHECK_RANGE(cur + 3, 2);
  ------------------
  |  |  560|    111|  do {                                                                           \
  |  |  561|    111|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    111|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    111|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 111]
  |  |  |  Branch (563:21): [True: 0, False: 111]
  |  |  |  Branch (563:33): [True: 1, False: 110]
  |  |  ------------------
  |  |  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|    111|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 110]
  |  |  ------------------
  ------------------
  718|    110|        uint16_t offset_2;
  719|    110|        memcpy(&offset_2, ip, sizeof(offset_2));
  720|    110|        offset_2 += 5;
  721|    110|        ip += 2;
  722|    110|        int i, j, k, l, m;
  723|    110|        i = 0;
  724|    110|        j = ((token - 32) >> 3U);
  725|    110|        l = -1;
  726|    440|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (726:21): [True: 330, False: 110]
  ------------------
  727|    330|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (727:15): [True: 330, False: 0]
  |  Branch (727:27): [True: 220, False: 110]
  ------------------
  728|    220|            if (l == -1) {
  ------------------
  |  Branch (728:17): [True: 110, False: 110]
  ------------------
  729|    110|              l = k;
  730|    110|            } else {
  731|    110|              m = k;
  732|    110|            }
  733|    220|          }
  734|    330|        }
  735|    110|        int64_t bpos1 = (cur + 5) - (int64_t) offset_1;
  736|    110|        NDLZ4_CHECK_RANGE(bpos1, 8);
  ------------------
  |  |  560|    110|  do {                                                                           \
  |  |  561|    110|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    110|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    110|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 25, False: 85]
  |  |  |  Branch (563:21): [True: 0, False: 85]
  |  |  |  Branch (563:33): [True: 1, False: 84]
  |  |  ------------------
  |  |  564|     26|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     26|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     26|    }                                                                            \
  |  |  567|    110|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 84]
  |  |  ------------------
  ------------------
  737|     84|        const uint8_t *ref1 = (const uint8_t *) input + bpos1;
  738|     84|        memcpy(&buffercpy[i * 4], ref1, 4);
  739|     84|        memcpy(&buffercpy[j * 4], ref1 + 4, 4);
  740|     84|        int64_t bpos2 = (cur + 5) - (int64_t) offset_2;
  741|     84|        NDLZ4_CHECK_RANGE(bpos2, 8);
  ------------------
  |  |  560|     84|  do {                                                                           \
  |  |  561|     84|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     84|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     84|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 18, False: 66]
  |  |  |  Branch (563:21): [True: 0, False: 66]
  |  |  |  Branch (563:33): [True: 1, False: 65]
  |  |  ------------------
  |  |  564|     19|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     19|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     19|    do {                                            \
  |  |  |  |  |  |   98|     19|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     19|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 19, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     19|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     19|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     19|    }                                                                            \
  |  |  567|     84|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 65]
  |  |  ------------------
  ------------------
  742|     65|        const uint8_t *ref2 = (const uint8_t *) input + bpos2;
  743|     65|        memcpy(&buffercpy[l * 4], ref2, 4);
  744|     65|        memcpy(&buffercpy[m * 4], ref2 + 4, 4);
  745|       |
  746|     65|      } 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|  1.80k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  752|  9.04k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (752:28): [True: 7.23k, False: 1.80k]
  ------------------
  753|  7.23k|        if (i < padding[0]) {
  ------------------
  |  Branch (753:13): [True: 6.54k, False: 688]
  ------------------
  754|  6.54k|          ind = orig + i * blockshape[1];
  755|  6.54k|          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|  6.54k|          buffercpy += padding[1];
  762|  6.54k|        }
  763|  7.23k|      }
  764|  1.80k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (764:11): [True: 0, False: 1.80k]
  ------------------
  765|      0|        BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|      0|        return BLOSC2_ERROR_FAILURE;
  767|      0|      }
  768|  1.80k|    }
  769|  1.81G|  }
  770|     30|  ind += padding[1];
  771|       |
  772|     30|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (772:7): [True: 0, False: 30]
  ------------------
  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|     30|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (776:7): [True: 0, False: 30]
  ------------------
  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|     30|  return (int) ind;
  782|     30|#undef NDLZ4_CHECK_RANGE
  783|     30|}

ndlz8_decompress:
  444|    220|                     uint8_t meta, blosc2_dparams *dparams) {
  445|    220|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    220|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  446|    220|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    220|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  447|    220|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    220|    do {                                            \
  |  |  105|    220|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 220]
  |  |  ------------------
  |  |  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|    220|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 220]
  |  |  ------------------
  ------------------
  448|    220|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    220|    do {                                            \
  |  |  105|    220|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 220]
  |  |  ------------------
  |  |  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|    220|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 220]
  |  |  ------------------
  ------------------
  449|       |
  450|    220|  const int cell_shape = 8;
  451|    220|  const int cell_size = 64;
  452|    220|  uint8_t *ip = (uint8_t *) input;
  453|    220|  uint8_t *op = (uint8_t *) output;
  454|    220|  uint8_t ndim;
  455|    220|  int32_t blockshape[2];
  456|    220|  int32_t eshape[2];
  457|    220|  uint8_t *buffercpy;
  458|    220|  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|    220|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    220|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 219]
  |  |  ------------------
  ------------------
  465|      1|    return 0;
  466|      1|  }
  467|    219|  uint8_t *ip_limit = ip + input_len;
  468|       |
  469|       |  /* we start with literal copy */
  470|    219|  ndim = *ip;
  471|    219|  ip++;
  472|    219|  if (ndim != 2) {
  ------------------
  |  Branch (472:7): [True: 1, False: 218]
  ------------------
  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|    218|  memcpy(&blockshape[0], ip, 4);
  477|    218|  ip += 4;
  478|    218|  memcpy(&blockshape[1], ip, 4);
  479|    218|  ip += 4;
  480|       |
  481|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  482|    218|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 218]
  |  Branch (482:25): [True: 17, False: 201]
  |  Branch (482:46): [True: 13, False: 188]
  ------------------
  483|     30|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     30|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     30|    do {                                            \
  |  |  |  |   98|     30|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     30|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 30, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     30|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|     30|    return BLOSC2_ERROR_FAILURE;
  485|     30|  }
  486|       |
  487|    188|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  488|    188|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  489|       |
  490|    188|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    188|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 35, False: 153]
  |  |  ------------------
  ------------------
  491|     35|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     35|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     35|    do {                                            \
  |  |  |  |   98|     35|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     35|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 35, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     35|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|     35|    return 0;
  493|     35|  }
  494|    153|  memset(op, 0, blockshape[0] * blockshape[1]);
  495|       |
  496|    153|  int32_t i_stop[2];
  497|    459|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (497:19): [True: 306, False: 153]
  ------------------
  498|    306|    i_stop[i] = eshape[i] / cell_shape;
  499|    306|  }
  500|       |
  501|       |  /* main loop */
  502|    153|  int32_t ii[2];
  503|    153|  int32_t padding[2] = {0};
  504|    153|  int32_t ind = 0;
  505|    153|  uint8_t *local_buffer = malloc(cell_size);
  506|    153|  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|    153|#define NDLZ8_CHECK_RANGE(pos, len)                                              \
  518|    153|  do {                                                                           \
  519|    153|    int64_t _pos = (int64_t) (pos);                                              \
  520|    153|    int64_t _len = (int64_t) (len);                                              \
  521|    153|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  522|    153|      free(local_buffer);                                                        \
  523|    153|      free(cell_aux);                                                            \
  524|    153|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  525|    153|      return BLOSC2_ERROR_FAILURE;                                               \
  526|    153|    }                                                                            \
  527|    153|  } while (0)
  528|       |
  529|  1.28G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (529:19): [True: 1.28G, False: 18]
  ------------------
  530|  1.28G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (530:21): [True: 945, False: 1.28G]
  ------------------
  531|    945|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    945|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 945]
  |  |  ------------------
  ------------------
  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|    945|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (537:11): [True: 778, False: 167]
  ------------------
  538|    778|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (538:22): [True: 6, False: 772]
  ------------------
  539|    778|      } else {
  540|    167|        padding[0] = cell_shape;
  541|    167|      }
  542|    945|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (542:11): [True: 116, False: 829]
  ------------------
  543|    116|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (543:22): [True: 67, False: 49]
  ------------------
  544|    829|      } else {
  545|    829|        padding[1] = cell_shape;
  546|    829|      }
  547|    945|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  548|    945|      NDLZ8_CHECK_RANGE(cur, 1);
  ------------------
  |  |  518|    945|  do {                                                                           \
  |  |  519|    945|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    945|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    945|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 945]
  |  |  |  Branch (521:21): [True: 0, False: 945]
  |  |  |  Branch (521:33): [True: 6, False: 939]
  |  |  ------------------
  |  |  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|    945|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 939]
  |  |  ------------------
  ------------------
  549|    939|      token = *ip++;
  550|    939|      uint8_t match_type = (token >> 3U);
  551|    939|      if (token == 0) {    // no match
  ------------------
  |  Branch (551:11): [True: 204, False: 735]
  ------------------
  552|    204|        NDLZ8_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    204|  do {                                                                           \
  |  |  519|    204|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    204|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    204|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 204]
  |  |  |  Branch (521:21): [True: 0, False: 204]
  |  |  |  Branch (521:33): [True: 5, False: 199]
  |  |  ------------------
  |  |  522|      5|      free(local_buffer);                                                        \
  |  |  523|      5|      free(cell_aux);                                                            \
  |  |  524|      5|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      5|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      5|    }                                                                            \
  |  |  527|    204|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 199]
  |  |  ------------------
  ------------------
  553|    199|        buffercpy = ip;
  554|    199|        ip += padding[0] * padding[1];
  555|    735|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (555:18): [True: 24, False: 711]
  ------------------
  556|     24|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     24|  do {                                                                           \
  |  |  519|     24|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     24|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     24|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 24]
  |  |  |  Branch (521:21): [True: 0, False: 24]
  |  |  |  Branch (521:33): [True: 1, False: 23]
  |  |  ------------------
  |  |  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|     24|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 23]
  |  |  ------------------
  ------------------
  557|     23|        uint16_t offset;
  558|     23|        memcpy(&offset, ip, sizeof(offset));
  559|     23|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;
  560|     23|        NDLZ8_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|     23|  do {                                                                           \
  |  |  519|     23|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     23|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     23|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 16, False: 7]
  |  |  |  Branch (521:21): [True: 0, False: 7]
  |  |  |  Branch (521:33): [True: 1, False: 6]
  |  |  ------------------
  |  |  522|     17|      free(local_buffer);                                                        \
  |  |  523|     17|      free(cell_aux);                                                            \
  |  |  524|     17|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     17|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     17|    do {                                            \
  |  |  |  |  |  |   98|     17|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     17|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 17, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     17|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     17|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     17|    }                                                                            \
  |  |  527|     23|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 6]
  |  |  ------------------
  ------------------
  561|      6|        buffercpy = (uint8_t *) input + bpos;
  562|      6|        ip += 2;
  563|    711|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (563:18): [True: 491, False: 220]
  ------------------
  564|    491|        NDLZ8_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  518|    491|  do {                                                                           \
  |  |  519|    491|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    491|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    491|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 491]
  |  |  |  Branch (521:21): [True: 0, False: 491]
  |  |  |  Branch (521:33): [True: 1, False: 490]
  |  |  ------------------
  |  |  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|    491|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 490]
  |  |  ------------------
  ------------------
  565|    490|        buffercpy = cell_aux;
  566|    490|        memset(buffercpy, *ip, cell_size);
  567|    490|        ip++;
  568|    490|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (568:18): [True: 84, False: 136]
  ------------------
  569|     84|        buffercpy = local_buffer;
  570|     84|        int row = (int) (token & 7);
  571|     84|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (571:13): [True: 1, False: 83]
  ------------------
  572|      1|          free(local_buffer);
  573|      1|          free(cell_aux);
  574|      1|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      1|          return BLOSC2_ERROR_FAILURE;
  576|      1|        }
  577|     83|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     83|  do {                                                                           \
  |  |  519|     83|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     83|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     83|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 83]
  |  |  |  Branch (521:21): [True: 0, False: 83]
  |  |  |  Branch (521:33): [True: 1, False: 82]
  |  |  ------------------
  |  |  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|     83|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 82]
  |  |  ------------------
  ------------------
  578|     82|        uint16_t offset;
  579|     82|        memcpy(&offset, ip, sizeof(offset));
  580|     82|        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|     82|        int64_t bpos = cur - (int64_t) offset;
  584|     82|        NDLZ8_CHECK_RANGE(bpos, 3 * cell_shape);
  ------------------
  |  |  518|     82|  do {                                                                           \
  |  |  519|     82|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     82|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     82|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 15, False: 67]
  |  |  |  Branch (521:21): [True: 0, False: 67]
  |  |  |  Branch (521:33): [True: 1, False: 66]
  |  |  ------------------
  |  |  522|     16|      free(local_buffer);                                                        \
  |  |  523|     16|      free(cell_aux);                                                            \
  |  |  524|     16|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     16|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     16|    do {                                            \
  |  |  |  |  |  |   98|     16|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     16|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 16, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     16|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     16|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     16|    }                                                                            \
  |  |  527|     82|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 66]
  |  |  ------------------
  ------------------
  585|     66|        const uint8_t *ref = (const uint8_t *) input + bpos;
  586|    264|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (586:25): [True: 198, False: 66]
  ------------------
  587|    198|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  588|    198|        }
  589|    557|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (589:25): [True: 500, False: 57]
  ------------------
  590|    500|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (590:15): [True: 231, False: 269]
  |  Branch (590:28): [True: 86, False: 183]
  ------------------
  591|    317|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    317|  do {                                                                           \
  |  |  519|    317|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    317|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    317|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 317]
  |  |  |  Branch (521:21): [True: 0, False: 317]
  |  |  |  Branch (521:33): [True: 9, False: 308]
  |  |  ------------------
  |  |  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|    317|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 308]
  |  |  ------------------
  ------------------
  592|    308|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  593|    308|            ip += cell_shape;
  594|    308|          }
  595|    500|        }
  596|    136|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (596:18): [True: 92, False: 44]
  ------------------
  597|     92|        buffercpy = local_buffer;
  598|     92|        int row = (int) (token & 7);
  599|     92|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (599:13): [True: 1, False: 91]
  ------------------
  600|      1|          free(local_buffer);
  601|      1|          free(cell_aux);
  602|      1|          BLOSC_TRACE_ERROR("Pair match row out of bounds");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|      1|          return BLOSC2_ERROR_FAILURE;
  604|      1|        }
  605|     91|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     91|  do {                                                                           \
  |  |  519|     91|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     91|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     91|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 91]
  |  |  |  Branch (521:21): [True: 0, False: 91]
  |  |  |  Branch (521:33): [True: 1, False: 90]
  |  |  ------------------
  |  |  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|     91|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 90]
  |  |  ------------------
  ------------------
  606|     90|        uint16_t offset;
  607|     90|        memcpy(&offset, ip, sizeof(offset));
  608|     90|        ip += 2;
  609|       |        // back-reference base == cur - offset (see triple-match note above).
  610|     90|        int64_t bpos = cur - (int64_t) offset;
  611|     90|        NDLZ8_CHECK_RANGE(bpos, 2 * cell_shape);
  ------------------
  |  |  518|     90|  do {                                                                           \
  |  |  519|     90|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     90|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     90|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 18, False: 72]
  |  |  |  Branch (521:21): [True: 0, False: 72]
  |  |  |  Branch (521:33): [True: 2, False: 70]
  |  |  ------------------
  |  |  522|     20|      free(local_buffer);                                                        \
  |  |  523|     20|      free(cell_aux);                                                            \
  |  |  524|     20|      BLOSC_TRACE_ERROR("ndlz8: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     20|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     20|    }                                                                            \
  |  |  527|     90|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 70]
  |  |  ------------------
  ------------------
  612|     70|        const uint8_t *ref = (const uint8_t *) input + bpos;
  613|    210|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (613:25): [True: 140, False: 70]
  ------------------
  614|    140|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  615|    140|        }
  616|    583|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (616:25): [True: 525, False: 58]
  ------------------
  617|    525|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (617:15): [True: 260, False: 265]
  |  Branch (617:28): [True: 133, False: 132]
  ------------------
  618|    393|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    393|  do {                                                                           \
  |  |  519|    393|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    393|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    393|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 393]
  |  |  |  Branch (521:21): [True: 0, False: 393]
  |  |  |  Branch (521:33): [True: 12, False: 381]
  |  |  ------------------
  |  |  522|     12|      free(local_buffer);                                                        \
  |  |  523|     12|      free(cell_aux);                                                            \
  |  |  524|     12|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     12|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     12|    }                                                                            \
  |  |  527|    393|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 381]
  |  |  ------------------
  ------------------
  619|    381|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  620|    381|            ip += cell_shape;
  621|    381|          }
  622|    525|        }
  623|     70|      } else {
  624|     44|        free(local_buffer);
  625|     44|        free(cell_aux);
  626|     44|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     44|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     44|    do {                                            \
  |  |  |  |   98|     44|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     44|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     44|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|     44|        return BLOSC2_ERROR_FAILURE;
  628|     44|      }
  629|       |
  630|    810|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  631|  7.29k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (631:27): [True: 6.48k, False: 810]
  ------------------
  632|  6.48k|        if (i < padding[0]) {
  ------------------
  |  Branch (632:13): [True: 3.13k, False: 3.34k]
  ------------------
  633|  3.13k|          ind = orig + i * blockshape[1];
  634|  3.13k|          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.13k|          buffercpy += padding[1];
  641|  3.13k|        }
  642|  6.48k|      }
  643|    810|      if (ind > output_len) {
  ------------------
  |  Branch (643:11): [True: 0, False: 810]
  ------------------
  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|    810|    }
  650|  1.28G|  }
  651|     18|  ind += padding[1];
  652|       |
  653|     18|  free(cell_aux);
  654|     18|  free(local_buffer);
  655|       |
  656|     18|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (656:7): [True: 0, False: 18]
  ------------------
  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|     18|  if (ind > output_len) {
  ------------------
  |  Branch (660:7): [True: 0, False: 18]
  ------------------
  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|     18|  return (int) ind;
  666|     18|#undef NDLZ8_CHECK_RANGE
  667|     18|}

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

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

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

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

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

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

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

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

