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

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

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

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

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

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

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

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

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

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

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

inflate_fast_avx2:
   53|  2.54k|void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
   54|       |    /* start: inflate()'s starting value for strm->avail_out */
   55|  2.54k|    struct inflate_state *state;
   56|  2.54k|    z_const unsigned char *in;  /* local strm->next_in */
  ------------------
  |  |   23|  2.54k|#define z_const const
  ------------------
   57|  2.54k|    const unsigned char *last;  /* have enough input while in < last */
   58|  2.54k|    unsigned char *out;         /* local strm->next_out */
   59|  2.54k|    unsigned char *beg;         /* inflate()'s initial strm->next_out */
   60|  2.54k|    unsigned char *end;         /* while out < end, enough space available */
   61|  2.54k|    unsigned char *safe;        /* can use chunkcopy provided out < safe */
   62|  2.54k|    unsigned char *window;      /* allocated sliding window, if wsize != 0 */
   63|  2.54k|    unsigned wsize;             /* window size or zero if not using window */
   64|  2.54k|    unsigned whave;             /* valid bytes in the window */
   65|  2.54k|    unsigned wnext;             /* window write index */
   66|       |
   67|       |    /* hold is a local copy of strm->hold. By default, hold satisfies the same
   68|       |       invariants that strm->hold does, namely that (hold >> bits) == 0. This
   69|       |       invariant is kept by loading bits into hold one byte at a time, like:
   70|       |
   71|       |       hold |= next_byte_of_input << bits; in++; bits += 8;
   72|       |
   73|       |       If we need to ensure that bits >= 15 then this code snippet is simply
   74|       |       repeated. Over one iteration of the outermost do/while loop, this
   75|       |       happens up to six times (48 bits of input), as described in the NOTES
   76|       |       above.
   77|       |
   78|       |       However, on some little endian architectures, it can be significantly
   79|       |       faster to load 64 bits once instead of 8 bits six times:
   80|       |
   81|       |       if (bits <= 16) {
   82|       |         hold |= next_8_bytes_of_input << bits; in += 6; bits += 48;
   83|       |       }
   84|       |
   85|       |       Unlike the simpler one byte load, shifting the next_8_bytes_of_input
   86|       |       by bits will overflow and lose those high bits, up to 2 bytes' worth.
   87|       |       The conservative estimate is therefore that we have read only 6 bytes
   88|       |       (48 bits). Again, as per the NOTES above, 48 bits is sufficient for the
   89|       |       rest of the iteration, and we will not need to load another 8 bytes.
   90|       |
   91|       |       Inside this function, we no longer satisfy (hold >> bits) == 0, but
   92|       |       this is not problematic, even if that overflow does not land on an 8 bit
   93|       |       byte boundary. Those excess bits will eventually shift down lower as the
   94|       |       Huffman decoder consumes input, and when new input bits need to be loaded
   95|       |       into the bits variable, the same input bits will be or'ed over those
   96|       |       existing bits. A bitwise or is idempotent: (a | b | b) equals (a | b).
   97|       |       Note that we therefore write that load operation as "hold |= etc" and not
   98|       |       "hold += etc".
   99|       |
  100|       |       Outside that loop, at the end of the function, hold is bitwise and'ed
  101|       |       with (1<<bits)-1 to drop those excess bits so that, on function exit, we
  102|       |       keep the invariant that (state->hold >> state->bits) == 0.
  103|       |    */
  104|  2.54k|    unsigned bits;              /* local strm->bits */
  105|  2.54k|    uint64_t hold;              /* local strm->hold */
  106|  2.54k|    unsigned lmask;             /* mask for first level of length codes */
  107|  2.54k|    unsigned dmask;             /* mask for first level of distance codes */
  108|  2.54k|    code const *lcode;          /* local strm->lencode */
  109|  2.54k|    code const *dcode;          /* local strm->distcode */
  110|  2.54k|    const code *here;           /* retrieved table entry */
  111|  2.54k|    unsigned op;                /* code bits, operation, extra bits, or */
  112|       |                                /*  window position, window bytes to copy */
  113|  2.54k|    unsigned len;               /* match length, unused bytes */
  114|  2.54k|    unsigned char *from;        /* where to copy match from */
  115|  2.54k|    unsigned dist;              /* match distance */
  116|  2.54k|    unsigned extra_safe;        /* copy chunks safely in all cases */
  117|       |
  118|       |    /* copy state to local variables */
  119|  2.54k|    state = (struct inflate_state *)strm->state;
  120|  2.54k|    in = strm->next_in;
  121|  2.54k|    last = in + (strm->avail_in - (INFLATE_FAST_MIN_HAVE - 1));
  ------------------
  |  |  137|  2.54k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  122|  2.54k|    out = strm->next_out;
  123|  2.54k|    beg = out - (start - strm->avail_out);
  124|  2.54k|    end = out + (strm->avail_out - (INFLATE_FAST_MIN_LEFT - 1));
  ------------------
  |  |  138|  2.54k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  125|  2.54k|    safe = out + strm->avail_out;
  126|  2.54k|    wsize = state->wsize;
  127|  2.54k|    whave = state->whave;
  128|  2.54k|    wnext = state->wnext;
  129|  2.54k|    window = state->window;
  130|  2.54k|    hold = state->hold;
  131|  2.54k|    bits = state->bits;
  132|  2.54k|    lcode = state->lencode;
  133|  2.54k|    dcode = state->distcode;
  134|  2.54k|    lmask = (1U << state->lenbits) - 1;
  135|  2.54k|    dmask = (1U << state->distbits) - 1;
  136|       |
  137|       |    /* Detect if out and window point to the same memory allocation. In this instance it is
  138|       |       necessary to use safe chunk copy functions to prevent overwriting the window. If the
  139|       |       window is overwritten then future matches with far distances will fail to copy correctly. */
  140|  2.54k|    extra_safe = (wsize != 0 && out >= window && out + INFLATE_FAST_MIN_LEFT <= window + state->wbufsize);
  ------------------
  |  |  138|      0|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (140:19): [True: 0, False: 2.54k]
  |  Branch (140:33): [True: 0, False: 0]
  |  Branch (140:50): [True: 0, False: 0]
  ------------------
  141|       |
  142|  2.54k|#define REFILL() do { \
  143|  2.54k|        hold |= load_64_bits(in, bits); \
  144|  2.54k|        in += 7; \
  145|  2.54k|        in -= ((bits >> 3) & 7); \
  146|  2.54k|        bits |= 56; \
  147|  2.54k|    } while (0)
  148|       |
  149|       |    /* decode literals and length/distances until end-of-block or not enough
  150|       |       input data or output space */
  151|   265k|    do {
  152|   265k|        REFILL();
  ------------------
  |  |  142|   265k|#define REFILL() do { \
  |  |  143|   265k|        hold |= load_64_bits(in, bits); \
  |  |  144|   265k|        in += 7; \
  |  |  145|   265k|        in -= ((bits >> 3) & 7); \
  |  |  146|   265k|        bits |= 56; \
  |  |  147|   265k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 265k]
  |  |  ------------------
  ------------------
  153|   265k|        here = lcode + (hold & lmask);
  154|   265k|        if (here->op == 0) {
  ------------------
  |  Branch (154:13): [True: 68.0k, False: 197k]
  ------------------
  155|  68.0k|            *out++ = (unsigned char)(here->val);
  156|  68.0k|            DROPBITS(here->bits);
  ------------------
  |  |  118|  68.0k|    do { \
  |  |  119|  68.0k|        hold >>= (n); \
  |  |  120|  68.0k|        bits -= (unsigned)(n); \
  |  |  121|  68.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 68.0k]
  |  |  ------------------
  ------------------
  157|  68.0k|            here = lcode + (hold & lmask);
  158|  68.0k|            if (here->op == 0) {
  ------------------
  |  Branch (158:17): [True: 23.0k, False: 44.9k]
  ------------------
  159|  23.0k|                *out++ = (unsigned char)(here->val);
  160|  23.0k|                DROPBITS(here->bits);
  ------------------
  |  |  118|  23.0k|    do { \
  |  |  119|  23.0k|        hold >>= (n); \
  |  |  120|  23.0k|        bits -= (unsigned)(n); \
  |  |  121|  23.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 23.0k]
  |  |  ------------------
  ------------------
  161|  23.0k|                here = lcode + (hold & lmask);
  162|  23.0k|            }
  163|  68.0k|        }
  164|   272k|      dolen:
  165|   272k|        DROPBITS(here->bits);
  ------------------
  |  |  118|   272k|    do { \
  |  |  119|   272k|        hold >>= (n); \
  |  |  120|   272k|        bits -= (unsigned)(n); \
  |  |  121|   272k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 272k]
  |  |  ------------------
  ------------------
  166|   272k|        op = here->op;
  167|   272k|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (167:13): [True: 21.7k, False: 250k]
  ------------------
  168|  21.7k|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  169|  21.7k|                    "inflate:         literal '%c'\n" :
  170|  21.7k|                    "inflate:         literal 0x%02x\n", here->val));
  171|  21.7k|            *out++ = (unsigned char)(here->val);
  172|   250k|        } else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (172:20): [True: 242k, False: 7.82k]
  ------------------
  173|   242k|            len = here->val;
  174|   242k|            op &= MAX_BITS;                       /* number of extra bits */
  ------------------
  |  |   39|   242k|#define MAX_BITS 15
  ------------------
  175|   242k|            len += BITS(op);
  ------------------
  |  |  114|   242k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  176|   242k|            DROPBITS(op);
  ------------------
  |  |  118|   242k|    do { \
  |  |  119|   242k|        hold >>= (n); \
  |  |  120|   242k|        bits -= (unsigned)(n); \
  |  |  121|   242k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 242k]
  |  |  ------------------
  ------------------
  177|   242k|            Tracevv((stderr, "inflate:         length %u\n", len));
  178|   242k|            here = dcode + (hold & dmask);
  179|   242k|            if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   39|   242k|#define MAX_BITS 15
  ------------------
                          if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   41|   242k|#define MAX_DIST_EXTRA_BITS 13
  ------------------
  |  Branch (179:17): [True: 164, False: 242k]
  ------------------
  180|    164|                REFILL();
  ------------------
  |  |  142|    164|#define REFILL() do { \
  |  |  143|    164|        hold |= load_64_bits(in, bits); \
  |  |  144|    164|        in += 7; \
  |  |  145|    164|        in -= ((bits >> 3) & 7); \
  |  |  146|    164|        bits |= 56; \
  |  |  147|    164|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 164]
  |  |  ------------------
  ------------------
  181|    164|            }
  182|   242k|          dodist:
  183|   242k|            DROPBITS(here->bits);
  ------------------
  |  |  118|   242k|    do { \
  |  |  119|   242k|        hold >>= (n); \
  |  |  120|   242k|        bits -= (unsigned)(n); \
  |  |  121|   242k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 242k]
  |  |  ------------------
  ------------------
  184|   242k|            op = here->op;
  185|   242k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (185:17): [True: 242k, False: 8]
  ------------------
  186|   242k|                dist = here->val;
  187|   242k|                op &= MAX_BITS;                 /* number of extra bits */
  ------------------
  |  |   39|   242k|#define MAX_BITS 15
  ------------------
  188|   242k|                dist += BITS(op);
  ------------------
  |  |  114|   242k|    (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|   242k|                DROPBITS(op);
  ------------------
  |  |  118|   242k|    do { \
  |  |  119|   242k|        hold >>= (n); \
  |  |  120|   242k|        bits -= (unsigned)(n); \
  |  |  121|   242k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 242k]
  |  |  ------------------
  ------------------
  196|   242k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  197|   242k|                op = (unsigned)(out - beg);     /* max distance in output */
  198|   242k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (198:21): [True: 38, False: 242k]
  ------------------
  199|     38|                    op = dist - op;             /* distance back in window */
  200|     38|                    if (op > whave) {
  ------------------
  |  Branch (200:25): [True: 38, 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|     38|                        SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     38|    do { \
  |  |  133|     38|        state->mode = BAD; \
  |  |  134|     38|        strm->msg = (char *)errmsg; \
  |  |  135|     38|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 38]
  |  |  ------------------
  ------------------
  225|     38|                        break;
  226|     38|#endif
  227|     38|                    }
  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|   242k|                } else if (extra_safe) {
  ------------------
  |  Branch (265:28): [True: 0, False: 242k]
  ------------------
  266|       |                    /* Whole reference is in range of current output. */
  267|      0|                        out = chunkcopy_safe(out, out - dist, len, safe);
  268|      0|#endif
  269|   242k|                } 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|   242k|                    if (dist >= len || dist >= CHUNKSIZE())
  ------------------
  |  |  118|   197k|#define CHUNKSIZE        chunksize_avx2
  ------------------
  |  Branch (275:25): [True: 45.3k, False: 197k]
  |  Branch (275:40): [True: 799, False: 196k]
  ------------------
  276|  46.1k|                        out = CHUNKCOPY(out, out - dist, len);
  ------------------
  |  |  119|  46.1k|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  277|   196k|                    else
  278|   196k|                        out = CHUNKMEMSET(out, out - dist, len);
  ------------------
  |  |  121|   196k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  279|   242k|                }
  280|   242k|            } else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (280:24): [True: 0, False: 8]
  ------------------
  281|      0|                here = dcode + here->val + BITS(op);
  ------------------
  |  |  114|      0|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  282|      0|                goto dodist;
  283|      8|            } else {
  284|      8|                SET_BAD("invalid distance code");
  ------------------
  |  |  132|      8|    do { \
  |  |  133|      8|        state->mode = BAD; \
  |  |  134|      8|        strm->msg = (char *)errmsg; \
  |  |  135|      8|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 8]
  |  |  ------------------
  ------------------
  285|      8|                break;
  286|      8|            }
  287|   242k|        } else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (287:20): [True: 7.18k, False: 637]
  ------------------
  288|  7.18k|            here = lcode + here->val + BITS(op);
  ------------------
  |  |  114|  7.18k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  289|  7.18k|            goto dolen;
  290|  7.18k|        } else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (290:20): [True: 633, False: 4]
  ------------------
  291|    633|            Tracevv((stderr, "inflate:         end of block\n"));
  292|    633|            state->mode = TYPE;
  293|    633|            break;
  294|    633|        } else {
  295|      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]
  |  |  ------------------
  ------------------
  296|      4|            break;
  297|      4|        }
  298|   272k|    } while (in < last && out < end);
  ------------------
  |  Branch (298:14): [True: 262k, False: 1.80k]
  |  Branch (298:27): [True: 262k, False: 56]
  ------------------
  299|       |
  300|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  301|  2.54k|    len = bits >> 3;
  302|  2.54k|    in -= len;
  303|  2.54k|    bits -= len << 3;
  304|  2.54k|    hold &= (UINT64_C(1) << bits) - 1;
  305|       |
  306|       |    /* update state and return */
  307|  2.54k|    strm->next_in = in;
  308|  2.54k|    strm->next_out = out;
  309|  2.54k|    strm->avail_in = (unsigned)(in < last ? (INFLATE_FAST_MIN_HAVE - 1) + (last - in)
  ------------------
  |  |  137|  2.36k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  |  Branch (309:33): [True: 2.36k, False: 181]
  ------------------
  310|  2.54k|                                          : (INFLATE_FAST_MIN_HAVE - 1) - (in - last));
  ------------------
  |  |  137|    181|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  311|  2.54k|    strm->avail_out = (unsigned)(out < end ? (INFLATE_FAST_MIN_LEFT - 1) + (end - out)
  ------------------
  |  |  138|  2.48k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (311:34): [True: 2.48k, False: 58]
  ------------------
  312|  2.54k|                                           : (INFLATE_FAST_MIN_LEFT - 1) - (out - end));
  ------------------
  |  |  138|     58|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  313|       |
  314|  2.54k|    Assert(bits <= 32, "Remaining bits greater than 32");
  315|  2.54k|    state->hold = (uint32_t)hold;
  316|  2.54k|    state->bits = bits;
  317|  2.54k|    return;
  318|  2.54k|}

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

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

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

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

chunkset_avx2.c:zng_memread_2:
   12|  1.05k|static inline uint16_t zng_memread_2(const void *ptr) {
   13|  1.05k|#if defined(HAVE_MAY_ALIAS)
   14|  1.05k|    typedef struct { uint16_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint16_t;
   15|  1.05k|    return ((const unaligned_uint16_t *)ptr)->val;
   16|       |#else
   17|       |    uint16_t val;
   18|       |    memcpy(&val, ptr, sizeof(val));
   19|       |    return val;
   20|       |#endif
   21|  1.05k|}
chunkset_avx2.c:zng_memread_4:
   23|  1.24k|static inline uint32_t zng_memread_4(const void *ptr) {
   24|  1.24k|#if defined(HAVE_MAY_ALIAS)
   25|  1.24k|    typedef struct { uint32_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint32_t;
   26|  1.24k|    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.24k|}
chunkset_avx2.c:zng_memread_8:
   34|   265k|static inline uint64_t zng_memread_8(const void *ptr) {
   35|   265k|#if defined(HAVE_MAY_ALIAS)
   36|   265k|    typedef struct { uint64_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint64_t;
   37|   265k|    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|   265k|}

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

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

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

zstd_decompress_block.c:ZSTD_highbit32:
  175|   155k|{
  176|   155k|    assert(val != 0);
  ------------------
  |  |   70|   155k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   155k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   155k|}
zstd_decompress_block.c:ZSTD_countLeadingZeros32:
   70|   155k|{
   71|   155k|    assert(val != 0);
  ------------------
  |  |   70|   155k|#    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|   155k|}
entropy_common.c:ZSTD_countTrailingZeros32:
   29|  2.81k|{
   30|  2.81k|    assert(val != 0);
  ------------------
  |  |   70|  2.81k|#    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|  2.81k|}
entropy_common.c:ZSTD_highbit32:
  175|  6.95k|{
  176|  6.95k|    assert(val != 0);
  ------------------
  |  |   70|  6.95k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  6.95k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  6.95k|}
entropy_common.c:ZSTD_countLeadingZeros32:
   70|  6.95k|{
   71|  6.95k|    assert(val != 0);
  ------------------
  |  |   70|  6.95k|#    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|  6.95k|}
fse_decompress.c:ZSTD_highbit32:
  175|  34.5k|{
  176|  34.5k|    assert(val != 0);
  ------------------
  |  |   70|  34.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  34.5k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  34.5k|}
fse_decompress.c:ZSTD_countLeadingZeros32:
   70|  34.5k|{
   71|  34.5k|    assert(val != 0);
  ------------------
  |  |   70|  34.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|  34.5k|}
huf_decompress.c:ZSTD_highbit32:
  175|  1.54k|{
  176|  1.54k|    assert(val != 0);
  ------------------
  |  |   70|  1.54k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  1.54k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  1.54k|}
huf_decompress.c:ZSTD_countLeadingZeros32:
   70|  1.54k|{
   71|  1.54k|    assert(val != 0);
  ------------------
  |  |   70|  1.54k|#    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.54k|}
huf_decompress.c:ZSTD_countTrailingZeros64:
   94|    462|{
   95|    462|    assert(val != 0);
  ------------------
  |  |   70|    462|#    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|    462|}

zstd_decompress_block.c:BIT_initDStream:
  255|    725|{
  256|    725|    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: 721]
  ------------------
  257|       |
  258|    721|    bitD->start = (const char*)srcBuffer;
  259|    721|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|    721|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 697, False: 24]
  ------------------
  262|    697|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    697|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    697|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    697|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 669, False: 28]
  ------------------
  266|    697|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 28, False: 669]
  ------------------
  267|    697|    } else {
  268|     24|        bitD->ptr   = bitD->start;
  269|     24|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|     24|        switch(srcSize)
  271|     24|        {
  272|      2|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 2, False: 22]
  ------------------
  273|      2|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      2|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|      4|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 2, False: 22]
  ------------------
  276|      4|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      4|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|      8|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 4, False: 20]
  ------------------
  279|      8|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      8|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     10|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 2, False: 22]
  ------------------
  282|     10|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     10|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|     14|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 4, False: 20]
  ------------------
  285|     14|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     14|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|     20|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 6, False: 18]
  ------------------
  288|     20|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     20|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|     24|        default: break;
  ------------------
  |  Branch (290:9): [True: 4, False: 20]
  ------------------
  291|     24|        }
  292|     24|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|     24|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 22, False: 2]
  ------------------
  294|     24|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 2, False: 22]
  ------------------
  295|     24|        }
  296|     22|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|     22|    }
  298|       |
  299|    691|    return srcSize;
  300|    721|}
zstd_decompress_block.c:BIT_readBits:
  363|  2.60M|{
  364|  2.60M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  2.60M|    BIT_skipBits(bitD, nbBits);
  366|  2.60M|    return value;
  367|  2.60M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  2.60M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  2.60M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  2.60M|    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|  2.60M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  2.60M|{
  309|  2.60M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  2.60M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  2.60M|#    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|  2.60M|#if defined(__x86_64__) || defined(_M_X64)
  318|  2.60M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  2.60M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  3.10M|{
  355|  3.10M|    bitD->bitsConsumed += nbBits;
  356|  3.10M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|   870k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   870k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   870k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 815k, False: 54.9k]
  |  |  ------------------
  ------------------
  416|   815k|        static const BitContainerType zeroFilled = 0;
  417|   815k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|   815k|        return BIT_DStream_overflow;
  420|   815k|    }
  421|       |
  422|  54.9k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  54.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  54.9k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 49.1k, False: 5.82k]
  ------------------
  425|  49.1k|        return BIT_reloadDStream_internal(bitD);
  426|  49.1k|    }
  427|  5.82k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 2.47k, False: 3.35k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  2.47k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 2.42k, False: 51]
  ------------------
  430|     51|        return BIT_DStream_completed;
  431|  2.47k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  3.35k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  3.35k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  3.35k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 241, False: 3.11k]
  ------------------
  436|    241|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    241|            result = BIT_DStream_endOfBuffer;
  438|    241|        }
  439|  3.35k|        bitD->ptr -= nbBytes;
  440|  3.35k|        bitD->bitsConsumed -= nbBytes*8;
  441|  3.35k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  3.35k|        return result;
  443|  5.82k|    }
  444|  5.82k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|  49.1k|{
  386|  49.1k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  49.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  49.1k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  49.1k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  49.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  49.1k|    bitD->bitsConsumed &= 7;
  390|  49.1k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  49.1k|    return BIT_DStream_unfinished;
  392|  49.1k|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|   496k|{
  373|   496k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|   496k|    assert(nbBits >= 1);
  ------------------
  |  |   70|   496k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|   496k|    BIT_skipBits(bitD, nbBits);
  376|   496k|    return value;
  377|   496k|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|   496k|{
  348|   496k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|   496k|    assert(nbBits >= 1);
  ------------------
  |  |   70|   496k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|   496k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|   496k|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|    161|{
  451|    161|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 151, False: 10]
  |  Branch (451:49): [True: 144, False: 7]
  ------------------
  452|    161|}
fse_decompress.c:BIT_initDStream:
  255|    568|{
  256|    568|    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: 564]
  ------------------
  257|       |
  258|    564|    bitD->start = (const char*)srcBuffer;
  259|    564|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|    564|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 522, False: 42]
  ------------------
  262|    522|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    522|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    522|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    522|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 506, False: 16]
  ------------------
  266|    522|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 16, False: 506]
  ------------------
  267|    522|    } else {
  268|     42|        bitD->ptr   = bitD->start;
  269|     42|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|     42|        switch(srcSize)
  271|     42|        {
  272|     10|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 10, False: 32]
  ------------------
  273|     10|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     10|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     24|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 14, False: 28]
  ------------------
  276|     24|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     24|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     28|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 4, False: 38]
  ------------------
  279|     28|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     28|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     33|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 5, False: 37]
  ------------------
  282|     33|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     33|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|     39|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 6, False: 36]
  ------------------
  285|     39|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     39|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|     41|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 2, False: 40]
  ------------------
  288|     41|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     41|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|     42|        default: break;
  ------------------
  |  Branch (290:9): [True: 1, False: 41]
  ------------------
  291|     42|        }
  292|     42|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|     42|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 40, False: 2]
  ------------------
  294|     42|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 2, False: 40]
  ------------------
  295|     42|        }
  296|     40|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|     40|    }
  298|       |
  299|    546|    return srcSize;
  300|    564|}
fse_decompress.c:BIT_readBits:
  363|  63.5k|{
  364|  63.5k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  63.5k|    BIT_skipBits(bitD, nbBits);
  366|  63.5k|    return value;
  367|  63.5k|}
fse_decompress.c:BIT_lookBits:
  331|  63.5k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  63.5k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  63.5k|    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|  63.5k|}
fse_decompress.c:BIT_getMiddleBits:
  308|  63.5k|{
  309|  63.5k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  63.5k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  63.5k|#    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|  63.5k|#if defined(__x86_64__) || defined(_M_X64)
  318|  63.5k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  63.5k|}
fse_decompress.c:BIT_skipBits:
  354|  78.0k|{
  355|  78.0k|    bitD->bitsConsumed += nbBits;
  356|  78.0k|}
fse_decompress.c:BIT_reloadDStream:
  413|  33.4k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  33.4k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  33.4k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 539, False: 32.8k]
  |  |  ------------------
  ------------------
  416|    539|        static const BitContainerType zeroFilled = 0;
  417|    539|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    539|        return BIT_DStream_overflow;
  420|    539|    }
  421|       |
  422|  32.8k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  32.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  32.8k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 12.0k, False: 20.8k]
  ------------------
  425|  12.0k|        return BIT_reloadDStream_internal(bitD);
  426|  12.0k|    }
  427|  20.8k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 16.2k, False: 4.56k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  16.2k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 15.6k, False: 581]
  ------------------
  430|    581|        return BIT_DStream_completed;
  431|  16.2k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  4.56k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  4.56k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  4.56k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 56, False: 4.51k]
  ------------------
  436|     56|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|     56|            result = BIT_DStream_endOfBuffer;
  438|     56|        }
  439|  4.56k|        bitD->ptr -= nbBytes;
  440|  4.56k|        bitD->bitsConsumed -= nbBytes*8;
  441|  4.56k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  4.56k|        return result;
  443|  20.8k|    }
  444|  20.8k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  12.0k|{
  386|  12.0k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  12.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  12.0k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  12.0k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  12.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  12.0k|    bitD->bitsConsumed &= 7;
  390|  12.0k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  12.0k|    return BIT_DStream_unfinished;
  392|  12.0k|}
fse_decompress.c:BIT_readBitsFast:
  372|  14.4k|{
  373|  14.4k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  14.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  14.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  14.4k|    BIT_skipBits(bitD, nbBits);
  376|  14.4k|    return value;
  377|  14.4k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  14.4k|{
  348|  14.4k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  14.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  14.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  14.4k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  14.4k|}
huf_decompress.c:BIT_initDStream:
  255|  1.10k|{
  256|  1.10k|    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: 1.09k]
  ------------------
  257|       |
  258|  1.09k|    bitD->start = (const char*)srcBuffer;
  259|  1.09k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  1.09k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 951, False: 147]
  ------------------
  262|    951|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    951|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    951|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    951|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 940, False: 11]
  ------------------
  266|    951|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 11, False: 940]
  ------------------
  267|    951|    } else {
  268|    147|        bitD->ptr   = bitD->start;
  269|    147|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    147|        switch(srcSize)
  271|    147|        {
  272|     12|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 12, False: 135]
  ------------------
  273|     12|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     12|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     31|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 19, False: 128]
  ------------------
  276|     31|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     31|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     61|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 30, False: 117]
  ------------------
  279|     61|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     61|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     79|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 18, False: 129]
  ------------------
  282|     79|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     79|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    100|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 21, False: 126]
  ------------------
  285|    100|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    100|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    117|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 17, False: 130]
  ------------------
  288|    117|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    117|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    147|        default: break;
  ------------------
  |  Branch (290:9): [True: 30, False: 117]
  ------------------
  291|    147|        }
  292|    147|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    147|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 140, False: 7]
  ------------------
  294|    147|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 7, False: 140]
  ------------------
  295|    147|        }
  296|    140|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    140|    }
  298|       |
  299|  1.08k|    return srcSize;
  300|  1.09k|}
huf_decompress.c:BIT_reloadDStream:
  413|  68.2k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  68.2k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  68.2k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 71, False: 68.1k]
  |  |  ------------------
  ------------------
  416|     71|        static const BitContainerType zeroFilled = 0;
  417|     71|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|     71|        return BIT_DStream_overflow;
  420|     71|    }
  421|       |
  422|  68.1k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  68.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  68.1k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 63.7k, False: 4.41k]
  ------------------
  425|  63.7k|        return BIT_reloadDStream_internal(bitD);
  426|  63.7k|    }
  427|  4.41k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 1.00k, False: 3.40k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  1.00k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 1.00k, False: 4]
  ------------------
  430|      4|        return BIT_DStream_completed;
  431|  1.00k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  3.40k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  3.40k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  3.40k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 580, False: 2.82k]
  ------------------
  436|    580|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    580|            result = BIT_DStream_endOfBuffer;
  438|    580|        }
  439|  3.40k|        bitD->ptr -= nbBytes;
  440|  3.40k|        bitD->bitsConsumed -= nbBytes*8;
  441|  3.40k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  3.40k|        return result;
  443|  4.41k|    }
  444|  4.41k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|  96.8k|{
  386|  96.8k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  96.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  96.8k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  96.8k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  96.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  96.8k|    bitD->bitsConsumed &= 7;
  390|  96.8k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  96.8k|    return BIT_DStream_unfinished;
  392|  96.8k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  1.25M|{
  348|  1.25M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  1.25M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.25M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  1.25M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  1.25M|}
huf_decompress.c:BIT_skipBits:
  354|  1.25M|{
  355|  1.25M|    bitD->bitsConsumed += nbBits;
  356|  1.25M|}
huf_decompress.c:BIT_endOfDStream:
  450|  1.04k|{
  451|  1.04k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 771, False: 273]
  |  Branch (451:49): [True: 8, False: 763]
  ------------------
  452|  1.04k|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  33.3k|{
  402|  33.3k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  33.3k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 296, False: 33.0k]
  |  |  ------------------
  ------------------
  403|    296|        return BIT_DStream_overflow;
  404|  33.0k|    return BIT_reloadDStream_internal(bitD);
  405|  33.3k|}

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

zstd_decompress.c:ZSTD_cpuid:
   32|  1.58k|MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) {
   33|  1.58k|    U32 f1c = 0;
   34|  1.58k|    U32 f1d = 0;
   35|  1.58k|    U32 f7b = 0;
   36|  1.58k|    U32 f7c = 0;
   37|       |#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))
   38|       |#if !defined(_M_X64) || !defined(__clang__) || __clang_major__ >= 16
   39|       |    int reg[4];
   40|       |    __cpuid((int*)reg, 0);
   41|       |    {
   42|       |        int const n = reg[0];
   43|       |        if (n >= 1) {
   44|       |            __cpuid((int*)reg, 1);
   45|       |            f1c = (U32)reg[2];
   46|       |            f1d = (U32)reg[3];
   47|       |        }
   48|       |        if (n >= 7) {
   49|       |            __cpuidex((int*)reg, 7, 0);
   50|       |            f7b = (U32)reg[1];
   51|       |            f7c = (U32)reg[2];
   52|       |        }
   53|       |    }
   54|       |#else
   55|       |    /* Clang compiler has a bug (fixed in https://reviews.llvm.org/D101338) in
   56|       |     * which the `__cpuid` intrinsic does not save and restore `rbx` as it needs
   57|       |     * to due to being a reserved register. So in that case, do the `cpuid`
   58|       |     * ourselves. Clang supports inline assembly anyway.
   59|       |     */
   60|       |    U32 n;
   61|       |    __asm__(
   62|       |        "pushq %%rbx\n\t"
   63|       |        "cpuid\n\t"
   64|       |        "popq %%rbx\n\t"
   65|       |        : "=a"(n)
   66|       |        : "a"(0)
   67|       |        : "rcx", "rdx");
   68|       |    if (n >= 1) {
   69|       |      U32 f1a;
   70|       |      __asm__(
   71|       |          "pushq %%rbx\n\t"
   72|       |          "cpuid\n\t"
   73|       |          "popq %%rbx\n\t"
   74|       |          : "=a"(f1a), "=c"(f1c), "=d"(f1d)
   75|       |          : "a"(1)
   76|       |          :);
   77|       |    }
   78|       |    if (n >= 7) {
   79|       |      __asm__(
   80|       |          "pushq %%rbx\n\t"
   81|       |          "cpuid\n\t"
   82|       |          "movq %%rbx, %%rax\n\t"
   83|       |          "popq %%rbx"
   84|       |          : "=a"(f7b), "=c"(f7c)
   85|       |          : "a"(7), "c"(0)
   86|       |          : "rdx");
   87|       |    }
   88|       |#endif
   89|       |#elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && defined(__GNUC__)
   90|       |    /* The following block like the normal cpuid branch below, but gcc
   91|       |     * reserves ebx for use of its pic register so we must specially
   92|       |     * handle the save and restore to avoid clobbering the register
   93|       |     */
   94|       |    U32 n;
   95|       |    __asm__(
   96|       |        "pushl %%ebx\n\t"
   97|       |        "cpuid\n\t"
   98|       |        "popl %%ebx\n\t"
   99|       |        : "=a"(n)
  100|       |        : "a"(0)
  101|       |        : "ecx", "edx");
  102|       |    if (n >= 1) {
  103|       |      U32 f1a;
  104|       |      __asm__(
  105|       |          "pushl %%ebx\n\t"
  106|       |          "cpuid\n\t"
  107|       |          "popl %%ebx\n\t"
  108|       |          : "=a"(f1a), "=c"(f1c), "=d"(f1d)
  109|       |          : "a"(1));
  110|       |    }
  111|       |    if (n >= 7) {
  112|       |      __asm__(
  113|       |          "pushl %%ebx\n\t"
  114|       |          "cpuid\n\t"
  115|       |          "movl %%ebx, %%eax\n\t"
  116|       |          "popl %%ebx"
  117|       |          : "=a"(f7b), "=c"(f7c)
  118|       |          : "a"(7), "c"(0)
  119|       |          : "edx");
  120|       |    }
  121|       |#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__)
  122|       |    U32 n;
  123|  1.58k|    __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx");
  124|  1.58k|    if (n >= 1) {
  ------------------
  |  Branch (124:9): [True: 1.58k, False: 0]
  ------------------
  125|  1.58k|      U32 f1a;
  126|  1.58k|      __asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx");
  127|  1.58k|    }
  128|  1.58k|    if (n >= 7) {
  ------------------
  |  Branch (128:9): [True: 1.58k, False: 0]
  ------------------
  129|  1.58k|      U32 f7a;
  130|  1.58k|      __asm__("cpuid"
  131|  1.58k|              : "=a"(f7a), "=b"(f7b), "=c"(f7c)
  132|  1.58k|              : "a"(7), "c"(0)
  133|  1.58k|              : "edx");
  134|  1.58k|    }
  135|  1.58k|#endif
  136|  1.58k|    {
  137|  1.58k|        ZSTD_cpuid_t cpuid;
  138|  1.58k|        cpuid.f1c = f1c;
  139|  1.58k|        cpuid.f1d = f1d;
  140|  1.58k|        cpuid.f7b = f7b;
  141|  1.58k|        cpuid.f7c = f7c;
  142|  1.58k|        return cpuid;
  143|  1.58k|    }
  144|  1.58k|}
zstd_decompress.c:ZSTD_cpuid_bmi1:
  147|  1.58k|  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \
  148|  1.58k|    return ((cpuid.r) & (1U << bit)) != 0;                                     \
  149|  1.58k|  }
zstd_decompress.c:ZSTD_cpuid_bmi2:
  147|  1.58k|  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \
  148|  1.58k|    return ((cpuid.r) & (1U << bit)) != 0;                                     \
  149|  1.58k|  }

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

zstd_common.c:ERR_isError:
   52|  3.26k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  3.26k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  3.26k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.26k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  1.63k|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: 84, False: 1.54k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|     24|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|  14.1k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  14.1k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  14.1k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  14.1k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|   874k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   874k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   874k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   874k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|      2|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|    611|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|    611|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    611|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    611|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  1.72k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.72k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.72k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.72k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  3.29k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  3.29k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  3.29k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.29k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|     12|{
  323|     12|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 12, False: 0]
  ------------------
  324|     12|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|     12|}
zstd_ddict.c:MEM_isLittleEndian:
  141|     12|{
  142|     12|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|     12|    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|     12|}
zstd_ddict.c:MEM_read32:
  183|     12|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  5.18k|{
  323|  5.18k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 5.18k, False: 0]
  ------------------
  324|  5.18k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  5.18k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  6.51k|{
  142|  6.51k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  6.51k|    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.51k|}
zstd_decompress.c:MEM_read32:
  183|  5.18k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|    652|{
  291|    652|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 652, False: 0]
  ------------------
  292|    652|        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|    652|}
zstd_decompress.c:MEM_read16:
  182|    652|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|    672|{
  339|    672|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 672, False: 0]
  ------------------
  340|    672|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|    672|}
zstd_decompress.c:MEM_read64:
  184|    672|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  2.85k|{
  312|  2.85k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  2.85k|}
zstd_decompress_block.c:MEM_readLE32:
  322|    629|{
  323|    629|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 629, False: 0]
  ------------------
  324|    629|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|    629|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|  56.7k|{
  142|  56.7k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  56.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|  56.7k|}
zstd_decompress_block.c:MEM_read32:
  183|    629|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  12.2k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  2.94k|{
  291|  2.94k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 2.94k, False: 0]
  ------------------
  292|  2.94k|        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|  2.94k|}
zstd_decompress_block.c:MEM_read16:
  182|  2.94k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  3.87M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|   868k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|  53.1k|{
  355|  53.1k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 53.1k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  53.1k|    else
  358|  53.1k|        return (size_t)MEM_readLE64(memPtr);
  359|  53.1k|}
zstd_decompress_block.c:MEM_readLE64:
  338|  53.1k|{
  339|  53.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 53.1k, False: 0]
  ------------------
  340|  53.1k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  53.1k|}
zstd_decompress_block.c:MEM_read64:
  184|  53.1k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
entropy_common.c:MEM_readLE32:
  322|  21.0k|{
  323|  21.0k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 21.0k, False: 0]
  ------------------
  324|  21.0k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  21.0k|}
entropy_common.c:MEM_isLittleEndian:
  141|  21.0k|{
  142|  21.0k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  21.0k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  21.0k|}
entropy_common.c:MEM_read32:
  183|  21.0k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|    309|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  17.1k|{
  355|  17.1k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 17.1k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  17.1k|    else
  358|  17.1k|        return (size_t)MEM_readLE64(memPtr);
  359|  17.1k|}
fse_decompress.c:MEM_32bits:
  137|  17.1k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  17.1k|{
  142|  17.1k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  17.1k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  17.1k|}
fse_decompress.c:MEM_readLE64:
  338|  17.1k|{
  339|  17.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 17.1k, False: 0]
  ------------------
  340|  17.1k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  17.1k|}
fse_decompress.c:MEM_read64:
  184|  17.1k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   226k|{
  142|   226k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   226k|    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|   226k|}
huf_decompress.c:MEM_write64:
  189|   123k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|   102k|{
  355|   102k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 102k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   102k|    else
  358|   102k|        return (size_t)MEM_readLE64(memPtr);
  359|   102k|}
huf_decompress.c:MEM_32bits:
  137|   103k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|   102k|{
  339|   102k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 102k, False: 0]
  ------------------
  340|   102k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   102k|}
huf_decompress.c:MEM_read64:
  184|   102k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   240k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  1.74k|{
  291|  1.74k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.74k, False: 0]
  ------------------
  292|  1.74k|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|  1.74k|}
huf_decompress.c:MEM_read16:
  182|  1.74k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

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

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

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

ZSTD_createDCtx:
  311|  1.58k|{
  312|  1.58k|    DEBUGLOG(3, "ZSTD_createDCtx");
  ------------------
  |  |  104|  1.58k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
  313|  1.58k|    return ZSTD_createDCtx_internal(ZSTD_defaultCMem);
  314|  1.58k|}
ZSTD_freeDCtx:
  325|  1.58k|{
  326|  1.58k|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (326:9): [True: 0, False: 1.58k]
  ------------------
  327|  1.58k|    RETURN_ERROR_IF(dctx->staticSize, memory_allocation, "not compatible with static DCtx");
  ------------------
  |  |  114|  1.58k|    do {                                                                       \
  |  |  115|  1.58k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.58k]
  |  |  ------------------
  |  |  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.58k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.58k]
  |  |  ------------------
  ------------------
  328|  1.58k|    {   ZSTD_customMem const cMem = dctx->customMem;
  329|  1.58k|        ZSTD_clearDict(dctx);
  330|  1.58k|        ZSTD_customFree(dctx->inBuff, cMem);
  331|  1.58k|        dctx->inBuff = NULL;
  332|  1.58k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
  333|  1.58k|        if (dctx->legacyContext)
  ------------------
  |  Branch (333:13): [True: 0, False: 1.58k]
  ------------------
  334|      0|            ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion);
  335|  1.58k|#endif
  336|  1.58k|        if (dctx->ddictSet) {
  ------------------
  |  Branch (336:13): [True: 0, False: 1.58k]
  ------------------
  337|      0|            ZSTD_freeDDictHashSet(dctx->ddictSet, cMem);
  338|       |            dctx->ddictSet = NULL;
  339|      0|        }
  340|  1.58k|        ZSTD_customFree(dctx, cMem);
  341|  1.58k|        return 0;
  342|  1.58k|    }
  343|  1.58k|}
ZSTD_getFrameHeader_advanced:
  448|  1.62k|{
  449|  1.62k|    const BYTE* ip = (const BYTE*)src;
  450|  1.62k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  451|       |
  452|  1.62k|    DEBUGLOG(5, "ZSTD_getFrameHeader_advanced: minInputSize = %zu, srcSize = %zu", minInputSize, srcSize);
  ------------------
  |  |  104|  1.62k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
  453|       |
  454|  1.62k|    if (srcSize > 0) {
  ------------------
  |  Branch (454:9): [True: 1.62k, False: 0]
  ------------------
  455|       |        /* note : technically could be considered an assert(), since it's an invalid entry */
  456|  1.62k|        RETURN_ERROR_IF(src==NULL, GENERIC, "invalid parameter : src==NULL, but srcSize>0");
  ------------------
  |  |  114|  1.62k|    do {                                                                       \
  |  |  115|  1.62k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.62k]
  |  |  ------------------
  |  |  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.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
  457|  1.62k|    }
  458|  1.62k|    if (srcSize < minInputSize) {
  ------------------
  |  Branch (458:9): [True: 0, False: 1.62k]
  ------------------
  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|  1.62k|    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|  1.62k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  480|  1.62k|    if ( (format != ZSTD_f_zstd1_magicless)
  ------------------
  |  Branch (480:10): [True: 1.62k, False: 0]
  ------------------
  481|  1.62k|      && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) {
  ------------------
  |  |  142|  1.62k|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  |  Branch (481:10): [True: 57, False: 1.56k]
  ------------------
  482|     57|        if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|     57|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                      if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|     57|#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: 57]
  ------------------
  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|     57|        RETURN_ERROR(prefix_unknown, "");
  ------------------
  |  |  131|     57|    do {                                                                     \
  |  |  132|     57|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|     57|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|     57|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|     57|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|     57|    do {                                           \
  |  |  |  |   99|     57|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     57|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|     57|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|     57|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|     57|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|     57|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|     57|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|     57|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     57|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     57|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|     57|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  494|     57|    }
  495|       |
  496|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
  497|  1.56k|    {   size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format);
  498|  1.56k|        if (srcSize < fhsize) return fhsize;
  ------------------
  |  Branch (498:13): [True: 0, False: 1.56k]
  ------------------
  499|  1.56k|        zfhPtr->headerSize = (U32)fhsize;
  500|  1.56k|    }
  501|       |
  502|      0|    {   BYTE const fhdByte = ip[minInputSize-1];
  503|  1.56k|        size_t pos = minInputSize;
  504|  1.56k|        U32 const dictIDSizeCode = fhdByte&3;
  505|  1.56k|        U32 const checksumFlag = (fhdByte>>2)&1;
  506|  1.56k|        U32 const singleSegment = (fhdByte>>5)&1;
  507|  1.56k|        U32 const fcsID = fhdByte>>6;
  508|  1.56k|        U64 windowSize = 0;
  509|  1.56k|        U32 dictID = 0;
  510|  1.56k|        U64 frameContentSize = ZSTD_CONTENTSIZE_UNKNOWN;
  ------------------
  |  |  203|  1.56k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  511|  1.56k|        RETURN_ERROR_IF((fhdByte & 0x08) != 0, frameParameter_unsupported,
  ------------------
  |  |  114|  1.56k|    do {                                                                       \
  |  |  115|  1.56k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 1.56k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
  512|  1.56k|                        "reserved bits, must be zero");
  513|       |
  514|  1.56k|        if (!singleSegment) {
  ------------------
  |  Branch (514:13): [True: 793, False: 768]
  ------------------
  515|    793|            BYTE const wlByte = ip[pos++];
  516|    793|            U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |   78|    793|#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
  517|    793|            RETURN_ERROR_IF(windowLog > ZSTD_WINDOWLOG_MAX, frameParameter_windowTooLarge, "");
  ------------------
  |  |  114|    793|    do {                                                                       \
  |  |  115|  2.37k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 793]
  |  |  |  Branch (115:13): [True: 0, False: 793]
  |  |  ------------------
  |  |  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|    793|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 793]
  |  |  ------------------
  ------------------
  518|    793|            windowSize = (1ULL << windowLog);
  519|    793|            windowSize += (windowSize >> 3) * (wlByte&7);
  520|    793|        }
  521|  1.56k|        switch(dictIDSizeCode)
  522|  1.56k|        {
  523|      0|            default:
  ------------------
  |  Branch (523:13): [True: 0, False: 1.56k]
  ------------------
  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|    107|            case 0 : break;
  ------------------
  |  Branch (526:13): [True: 107, False: 1.45k]
  ------------------
  527|    784|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (527:13): [True: 784, False: 777]
  ------------------
  528|    623|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (528:13): [True: 623, False: 938]
  ------------------
  529|     47|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (529:13): [True: 47, False: 1.51k]
  ------------------
  530|  1.56k|        }
  531|  1.56k|        switch(fcsID)
  532|  1.56k|        {
  533|      0|            default:
  ------------------
  |  Branch (533:13): [True: 0, False: 1.56k]
  ------------------
  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|    781|            case 0 : if (singleSegment) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (536:13): [True: 781, False: 780]
  |  Branch (536:26): [True: 9, False: 772]
  ------------------
  537|     29|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (537:13): [True: 29, False: 1.53k]
  ------------------
  538|     79|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (538:13): [True: 79, False: 1.48k]
  ------------------
  539|    672|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (539:13): [True: 672, False: 889]
  ------------------
  540|  1.56k|        }
  541|  1.56k|        if (singleSegment) windowSize = frameContentSize;
  ------------------
  |  Branch (541:13): [True: 768, False: 793]
  ------------------
  542|       |
  543|  1.56k|        zfhPtr->frameType = ZSTD_frame;
  544|  1.56k|        zfhPtr->frameContentSize = frameContentSize;
  545|  1.56k|        zfhPtr->windowSize = windowSize;
  546|  1.56k|        zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   54|  1.56k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 142, False: 1.41k]
  |  |  ------------------
  ------------------
  547|  1.56k|        zfhPtr->dictID = dictID;
  548|  1.56k|        zfhPtr->checksumFlag = checksumFlag;
  549|  1.56k|    }
  550|      0|    return 0;
  551|  1.56k|}
ZSTD_decompressDCtx:
 1198|  1.63k|{
 1199|  1.63k|    return ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ZSTD_getDDict(dctx));
 1200|  1.63k|}
ZSTD_decompressBegin:
 1561|  1.63k|{
 1562|  1.63k|    assert(dctx != NULL);
  ------------------
  |  |   70|  1.63k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1563|  1.63k|#if ZSTD_TRACE
 1564|  1.63k|    dctx->traceCtx = (ZSTD_trace_decompress_begin != NULL) ? ZSTD_trace_decompress_begin(dctx) : 0;
  ------------------
  |  Branch (1564:22): [True: 0, False: 1.63k]
  ------------------
 1565|  1.63k|#endif
 1566|  1.63k|    dctx->expected = ZSTD_startingInputLength(dctx->format);  /* dctx->format must be properly set */
 1567|  1.63k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 1568|  1.63k|    dctx->processedCSize = 0;
 1569|  1.63k|    dctx->decodedSize = 0;
 1570|  1.63k|    dctx->previousDstEnd = NULL;
 1571|  1.63k|    dctx->prefixStart = NULL;
 1572|  1.63k|    dctx->virtualStart = NULL;
 1573|  1.63k|    dctx->dictEnd = NULL;
 1574|  1.63k|    dctx->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */
  ------------------
  |  |   78|  1.63k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 1575|  1.63k|    dctx->litEntropy = dctx->fseEntropy = 0;
 1576|  1.63k|    dctx->dictID = 0;
 1577|  1.63k|    dctx->bType = bt_reserved;
 1578|  1.63k|    dctx->isFrameDecompression = 1;
 1579|  1.63k|    ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue));
  ------------------
  |  |   43|  1.63k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  1.63k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1580|  1.63k|    ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue));  /* initial repcodes */
  ------------------
  |  |   44|  1.63k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1581|  1.63k|    dctx->LLTptr = dctx->entropy.LLTable;
 1582|  1.63k|    dctx->MLTptr = dctx->entropy.MLTable;
 1583|  1.63k|    dctx->OFTptr = dctx->entropy.OFTable;
 1584|  1.63k|    dctx->HUFptr = dctx->entropy.hufTable;
 1585|  1.63k|    return 0;
 1586|  1.63k|}
ZSTD_decompressBegin_usingDict:
 1589|  1.62k|{
 1590|  1.62k|    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , "");
  ------------------
  |  |  146|  1.62k|    do {                                                                           \
  |  |  147|  1.62k|        size_t const err_code = (err);                                             \
  |  |  148|  1.62k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 1.62k]
  |  |  ------------------
  |  |  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.62k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1591|  1.62k|    if (dict && dictSize)
  ------------------
  |  Branch (1591:9): [True: 0, False: 1.62k]
  |  Branch (1591:17): [True: 0, False: 0]
  ------------------
 1592|      0|        RETURN_ERROR_IF(
  ------------------
  |  |  114|      0|    do {                                                                       \
  |  |  115|      0|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1593|  1.62k|            ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)),
 1594|  1.62k|            dictionary_corrupted, "");
 1595|  1.62k|    return 0;
 1596|  1.62k|}
ZSTD_decompressBegin_usingDDict:
 1602|      6|{
 1603|      6|    DEBUGLOG(4, "ZSTD_decompressBegin_usingDDict");
  ------------------
  |  |  104|      6|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1604|      6|    assert(dctx != NULL);
  ------------------
  |  |   70|      6|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1605|      6|    if (ddict) {
  ------------------
  |  Branch (1605:9): [True: 6, False: 0]
  ------------------
 1606|      6|        const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict);
 1607|      6|        size_t const dictSize = ZSTD_DDict_dictSize(ddict);
 1608|      6|        const void* const dictEnd = dictStart + dictSize;
 1609|      6|        dctx->ddictIsCold = (dctx->dictEnd != dictEnd);
 1610|      6|        DEBUGLOG(4, "DDict is %s",
  ------------------
  |  |  104|      6|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1611|      6|                    dctx->ddictIsCold ? "~cold~" : "hot!");
 1612|      6|    }
 1613|      6|    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , "");
  ------------------
  |  |  146|      6|    do {                                                                           \
  |  |  147|      6|        size_t const err_code = (err);                                             \
  |  |  148|      6|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 6]
  |  |  ------------------
  |  |  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|      6|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1614|      6|    if (ddict) {   /* NULL ddict is equivalent to no dictionary */
  ------------------
  |  Branch (1614:9): [True: 6, False: 0]
  ------------------
 1615|      6|        ZSTD_copyDDictParameters(dctx, ddict);
 1616|      6|    }
 1617|      6|    return 0;
 1618|      6|}
ZSTD_decompress_usingDDict:
 1660|  1.63k|{
 1661|       |    /* pass content and size in case legacy frames are encountered */
 1662|  1.63k|    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
 1663|       |                                     NULL, 0,
 1664|  1.63k|                                     ddict);
 1665|  1.63k|}
zstd_decompress.c:ZSTD_initDCtx_internal:
  253|  1.58k|{
  254|  1.58k|    dctx->staticSize  = 0;
  255|  1.58k|    dctx->ddict       = NULL;
  256|  1.58k|    dctx->ddictLocal  = NULL;
  257|  1.58k|    dctx->dictEnd     = NULL;
  258|  1.58k|    dctx->ddictIsCold = 0;
  259|  1.58k|    dctx->dictUses = ZSTD_dont_use;
  260|  1.58k|    dctx->inBuff      = NULL;
  261|  1.58k|    dctx->inBuffSize  = 0;
  262|  1.58k|    dctx->outBuffSize = 0;
  263|  1.58k|    dctx->streamStage = zdss_init;
  264|  1.58k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
  265|  1.58k|    dctx->legacyContext = NULL;
  266|  1.58k|    dctx->previousLegacyVersion = 0;
  267|  1.58k|#endif
  268|  1.58k|    dctx->noForwardProgress = 0;
  269|  1.58k|    dctx->oversizedDuration = 0;
  270|  1.58k|    dctx->isFrameDecompression = 1;
  271|  1.58k|#if DYNAMIC_BMI2
  272|  1.58k|    dctx->bmi2 = ZSTD_cpuSupportsBmi2();
  273|  1.58k|#endif
  274|  1.58k|    dctx->ddictSet = NULL;
  275|  1.58k|    ZSTD_DCtx_resetParameters(dctx);
  276|  1.58k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  277|       |    dctx->dictContentEndForFuzzing = NULL;
  278|  1.58k|#endif
  279|  1.58k|}
zstd_decompress.c:ZSTD_createDCtx_internal:
  294|  1.58k|static ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) {
  295|  1.58k|    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;
  ------------------
  |  Branch (295:9): [True: 0, False: 1.58k]
  ------------------
  296|       |
  297|  1.58k|    {   ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem);
  298|  1.58k|        if (!dctx) return NULL;
  ------------------
  |  Branch (298:13): [True: 0, False: 1.58k]
  ------------------
  299|  1.58k|        dctx->customMem = customMem;
  300|  1.58k|        ZSTD_initDCtx_internal(dctx);
  301|  1.58k|        return dctx;
  302|  1.58k|    }
  303|  1.58k|}
zstd_decompress.c:ZSTD_clearDict:
  317|  3.21k|{
  318|  3.21k|    ZSTD_freeDDict(dctx->ddictLocal);
  319|  3.21k|    dctx->ddictLocal = NULL;
  320|       |    dctx->ddict = NULL;
  321|  3.21k|    dctx->dictUses = ZSTD_dont_use;
  322|  3.21k|}
zstd_decompress.c:ZSTD_frameHeaderSize_internal:
  417|  3.18k|{
  418|  3.18k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  419|  3.18k|    RETURN_ERROR_IF(srcSize < minInputSize, srcSize_wrong, "");
  ------------------
  |  |  114|  3.18k|    do {                                                                       \
  |  |  115|  3.18k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 3.18k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  3.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.18k]
  |  |  ------------------
  ------------------
  420|       |
  421|  3.18k|    {   BYTE const fhd = ((const BYTE*)src)[minInputSize-1];
  422|  3.18k|        U32 const dictID= fhd & 3;
  423|  3.18k|        U32 const singleSegment = (fhd >> 5) & 1;
  424|  3.18k|        U32 const fcsId = fhd >> 6;
  425|  3.18k|        return minInputSize + !singleSegment
  426|  3.18k|             + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]
  427|  3.18k|             + (singleSegment && !fcsId);
  ------------------
  |  Branch (427:17): [True: 1.56k, False: 1.62k]
  |  Branch (427:34): [True: 27, False: 1.54k]
  ------------------
  428|  3.18k|    }
  429|  3.18k|}
zstd_decompress.c:ZSTD_startingInputLength:
  233|  8.16k|{
  234|  8.16k|    size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format);
  ------------------
  |  | 1257|  8.16k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1257:46): [True: 8.16k, False: 0]
  |  |  ------------------
  ------------------
  235|       |    /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */
  236|  8.16k|    assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) );
  ------------------
  |  |   70|  8.16k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  237|  8.16k|    return startingInputLength;
  238|  8.16k|}
zstd_decompress.c:readSkippableFrameSize:
  588|     27|{
  589|     27|    size_t const skippableHeaderSize = ZSTD_SKIPPABLEHEADERSIZE;
  ------------------
  |  | 1260|     27|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  590|     27|    U32 sizeU32;
  591|       |
  592|     27|    RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, "");
  ------------------
  |  |  114|     27|    do {                                                                       \
  |  |  115|     27|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 27]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|     27|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 27]
  |  |  ------------------
  ------------------
  593|       |
  594|     27|    sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|     27|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  595|     27|    RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32,
  ------------------
  |  |  114|     27|    do {                                                                       \
  |  |  115|     27|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 26]
  |  |  ------------------
  |  |  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|     27|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 26]
  |  |  ------------------
  ------------------
  596|     27|                    frameParameter_unsupported, "");
  597|     26|    {   size_t const skippableSize = skippableHeaderSize + sizeU32;
  598|     26|        RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|     26|    do {                                                                       \
  |  |  115|     26|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 24, False: 2]
  |  |  ------------------
  |  |  116|     24|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     24|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     24|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     24|    do {                                           \
  |  |  |  |   99|     24|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     24|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     24|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     24|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     24|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     24|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     24|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     24|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     24|        }                                                                      \
  |  |  123|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  599|      2|        return skippableSize;
  600|     26|    }
  601|     26|}
zstd_decompress.c:ZSTD_decompressMultiFrame:
 1075|  1.63k|{
 1076|  1.63k|    void* const dststart = dst;
 1077|  1.63k|    int moreThan1Frame = 0;
 1078|       |
 1079|  1.63k|    DEBUGLOG(5, "ZSTD_decompressMultiFrame");
  ------------------
  |  |  104|  1.63k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.63k]
  |  |  ------------------
  ------------------
 1080|  1.63k|    assert(dict==NULL || ddict==NULL);  /* either dict or ddict set, not both */
  ------------------
  |  |   70|  1.63k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1081|       |
 1082|  1.63k|    if (ddict) {
  ------------------
  |  Branch (1082:9): [True: 6, False: 1.63k]
  ------------------
 1083|      6|        dict = ZSTD_DDict_dictContent(ddict);
 1084|      6|        dictSize = ZSTD_DDict_dictSize(ddict);
 1085|      6|    }
 1086|       |
 1087|  1.72k|    while (srcSize >= ZSTD_startingInputLength(dctx->format)) {
  ------------------
  |  Branch (1087:12): [True: 1.65k, False: 66]
  ------------------
 1088|       |
 1089|  1.65k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
 1090|  1.65k|        if (dctx->format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize)) {
  ------------------
  |  Branch (1090:13): [True: 1.65k, False: 0]
  |  Branch (1090:45): [True: 1, False: 1.65k]
  ------------------
 1091|      1|            size_t decodedSize;
 1092|      1|            size_t const frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize);
 1093|      1|            if (ZSTD_isError(frameSize)) return frameSize;
  ------------------
  |  |   44|      1|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1093:17): [True: 1, False: 0]
  ------------------
 1094|      0|            RETURN_ERROR_IF(dctx->staticSize, memory_allocation,
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1095|      0|                "legacy support is not compatible with static dctx");
 1096|       |
 1097|      0|            decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);
 1098|      0|            if (ZSTD_isError(decodedSize)) return decodedSize;
  ------------------
  |  |   44|      0|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1098:17): [True: 0, False: 0]
  ------------------
 1099|       |
 1100|      0|            {
 1101|      0|                unsigned long long const expectedSize = ZSTD_getFrameContentSize(src, srcSize);
 1102|      0|                RETURN_ERROR_IF(expectedSize == ZSTD_CONTENTSIZE_ERROR, corruption_detected, "Corrupted frame header!");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1103|      0|                if (expectedSize != ZSTD_CONTENTSIZE_UNKNOWN) {
  ------------------
  |  |  203|      0|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (1103:21): [True: 0, False: 0]
  ------------------
 1104|      0|                    RETURN_ERROR_IF(expectedSize != decodedSize, corruption_detected,
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1105|      0|                        "Frame header size does not match decoded size!");
 1106|      0|                }
 1107|      0|            }
 1108|       |
 1109|      0|            assert(decodedSize <= dstCapacity);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1110|      0|            dst = (BYTE*)dst + decodedSize;
 1111|      0|            dstCapacity -= decodedSize;
 1112|       |
 1113|      0|            src = (const BYTE*)src + frameSize;
 1114|      0|            srcSize -= frameSize;
 1115|       |
 1116|      0|            continue;
 1117|      0|        }
 1118|  1.65k|#endif
 1119|       |
 1120|  1.65k|        if (dctx->format == ZSTD_f_zstd1 && srcSize >= 4) {
  ------------------
  |  Branch (1120:13): [True: 1.65k, False: 0]
  |  Branch (1120:45): [True: 1.65k, False: 0]
  ------------------
 1121|  1.65k|            U32 const magicNumber = MEM_readLE32(src);
 1122|  1.65k|            DEBUGLOG(5, "reading magic number %08X", (unsigned)magicNumber);
  ------------------
  |  |  104|  1.65k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.65k]
  |  |  ------------------
  ------------------
 1123|  1.65k|            if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|  1.65k|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                          if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|  1.65k|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  |  Branch (1123:17): [True: 27, False: 1.63k]
  ------------------
 1124|       |                /* skippable frame detected : skip it */
 1125|     27|                size_t const skippableSize = readSkippableFrameSize(src, srcSize);
 1126|     27|                FORWARD_IF_ERROR(skippableSize, "invalid skippable frame");
  ------------------
  |  |  146|     27|    do {                                                                           \
  |  |  147|     27|        size_t const err_code = (err);                                             \
  |  |  148|     27|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 25, False: 2]
  |  |  ------------------
  |  |  149|     25|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     25|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     25|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     25|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     25|    do {                                           \
  |  |  |  |   99|     25|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     25|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     25|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     25|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     25|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     25|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     25|            return err_code;                                                       \
  |  |  155|     25|        }                                                                          \
  |  |  156|     27|    } 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|     27|        }   }
 1133|       |
 1134|  1.63k|        if (ddict) {
  ------------------
  |  Branch (1134:13): [True: 6, False: 1.62k]
  ------------------
 1135|       |            /* we were called from ZSTD_decompress_usingDDict */
 1136|      6|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(dctx, ddict), "");
  ------------------
  |  |  146|      6|    do {                                                                           \
  |  |  147|      6|        size_t const err_code = (err);                                             \
  |  |  148|      6|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 6]
  |  |  ------------------
  |  |  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|      6|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1137|  1.62k|        } else {
 1138|       |            /* this will initialize correctly with no dict if dict == NULL, so
 1139|       |             * use this in all cases but ddict */
 1140|  1.62k|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize), "");
  ------------------
  |  |  146|  1.62k|    do {                                                                           \
  |  |  147|  1.62k|        size_t const err_code = (err);                                             \
  |  |  148|  1.62k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 1.62k]
  |  |  ------------------
  |  |  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.62k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1141|  1.62k|        }
 1142|  1.63k|        ZSTD_checkContinuity(dctx, dst, dstCapacity);
 1143|       |
 1144|  1.63k|        {   const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,
 1145|  1.63k|                                                    &src, &srcSize);
 1146|  1.63k|            RETURN_ERROR_IF(
  ------------------
  |  |  114|  1.63k|    do {                                                                       \
  |  |  115|  3.31k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 57, False: 1.57k]
  |  |  |  Branch (115:13): [True: 17, False: 40]
  |  |  ------------------
  |  |  116|     17|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     17|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     17|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     17|    do {                                           \
  |  |  |  |   99|     17|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     17|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     17|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     17|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     17|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     17|        }                                                                      \
  |  |  123|  1.63k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.61k]
  |  |  ------------------
  ------------------
 1147|  1.63k|                (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown)
 1148|  1.63k|             && (moreThan1Frame==1),
 1149|  1.63k|                srcSize_wrong,
 1150|  1.63k|                "At least one frame successfully completed, "
 1151|  1.63k|                "but following bytes are garbage: "
 1152|  1.63k|                "it's more likely to be a srcSize error, "
 1153|  1.63k|                "specifying more input bytes than size of frame(s). "
 1154|  1.63k|                "Note: one could be unlucky, it might be a corruption error instead, "
 1155|  1.63k|                "happening right at the place where we expect zstd magic bytes. "
 1156|  1.63k|                "But this is _much_ less likely than a srcSize field error.");
 1157|  1.61k|            if (ZSTD_isError(res)) return res;
  ------------------
  |  |   44|  1.61k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1157:17): [True: 1.52k, False: 84]
  ------------------
 1158|     84|            assert(res <= dstCapacity);
  ------------------
  |  |   70|     84|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1159|     84|            if (res != 0)
  ------------------
  |  Branch (1159:17): [True: 83, False: 1]
  ------------------
 1160|     83|                dst = (BYTE*)dst + res;
 1161|     84|            dstCapacity -= res;
 1162|     84|        }
 1163|      0|        moreThan1Frame = 1;
 1164|     84|    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */
 1165|       |
 1166|     66|    RETURN_ERROR_IF(srcSize, srcSize_wrong, "input not entirely consumed");
  ------------------
  |  |  114|     66|    do {                                                                       \
  |  |  115|     66|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 64]
  |  |  ------------------
  |  |  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|     66|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 64]
  |  |  ------------------
  ------------------
 1167|       |
 1168|     64|    return (size_t)((BYTE*)dst - (BYTE*)dststart);
 1169|     66|}
zstd_decompress.c:ZSTD_decompressFrame:
  956|  1.63k|{
  957|  1.63k|    const BYTE* const istart = (const BYTE*)(*srcPtr);
  958|  1.63k|    const BYTE* ip = istart;
  959|  1.63k|    BYTE* const ostart = (BYTE*)dst;
  960|  1.63k|    BYTE* const oend = dstCapacity != 0 ? ostart + dstCapacity : ostart;
  ------------------
  |  Branch (960:24): [True: 1.63k, False: 0]
  ------------------
  961|  1.63k|    BYTE* op = ostart;
  962|  1.63k|    size_t remainingSrcSize = *srcSizePtr;
  963|       |
  964|  1.63k|    DEBUGLOG(4, "ZSTD_decompressFrame (srcSize:%i)", (int)*srcSizePtr);
  ------------------
  |  |  104|  1.63k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.63k]
  |  |  ------------------
  ------------------
  965|       |
  966|       |    /* check */
  967|  1.63k|    RETURN_ERROR_IF(
  ------------------
  |  |  114|  1.63k|    do {                                                                       \
  |  |  115|  4.89k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1.63k, False: 0]
  |  |  |  Branch (115:13): [True: 5, False: 1.62k]
  |  |  ------------------
  |  |  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.63k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
  968|  1.63k|        remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize,
  969|  1.63k|        srcSize_wrong, "");
  970|       |
  971|       |    /* Frame Header */
  972|  1.62k|    {   size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal(
  973|  1.62k|                ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format);
  ------------------
  |  | 1257|  1.62k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1257:46): [True: 1.62k, False: 0]
  |  |  ------------------
  ------------------
  974|  1.62k|        if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  |   44|  1.62k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (974:13): [True: 0, False: 1.62k]
  ------------------
  975|  1.62k|        RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize,
  ------------------
  |  |  114|  1.62k|    do {                                                                       \
  |  |  115|  1.62k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 1.62k]
  |  |  ------------------
  |  |  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.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
  976|  1.62k|                        srcSize_wrong, "");
  977|  1.62k|        FORWARD_IF_ERROR( ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize) , "");
  ------------------
  |  |  146|  1.62k|    do {                                                                           \
  |  |  147|  1.62k|        size_t const err_code = (err);                                             \
  |  |  148|  1.62k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 59, False: 1.56k]
  |  |  ------------------
  |  |  149|     59|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     59|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     59|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     59|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     59|    do {                                           \
  |  |  |  |   99|     59|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     59|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     59|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     59|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     59|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     59|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     59|            return err_code;                                                       \
  |  |  155|     59|        }                                                                          \
  |  |  156|  1.62k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
  978|  1.56k|        ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize;
  979|  1.56k|    }
  980|       |
  981|       |    /* Shrink the blockSizeMax if enabled */
  982|  1.56k|    if (dctx->maxBlockSizeParam != 0)
  ------------------
  |  Branch (982:9): [True: 0, False: 1.56k]
  ------------------
  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|  2.22k|    while (1) {
  ------------------
  |  Branch (986:12): [True: 2.22k, Folded]
  ------------------
  987|  2.22k|        BYTE* oBlockEnd = oend;
  988|  2.22k|        size_t decodedSize;
  989|  2.22k|        blockProperties_t blockProperties;
  990|  2.22k|        size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties);
  991|  2.22k|        if (ZSTD_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  |   44|  2.22k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (991:13): [True: 21, False: 2.20k]
  ------------------
  992|       |
  993|  2.20k|        ip += ZSTD_blockHeaderSize;
  994|  2.20k|        remainingSrcSize -= ZSTD_blockHeaderSize;
  995|  2.20k|        RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  2.20k|    do {                                                                       \
  |  |  115|  2.20k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 37, False: 2.16k]
  |  |  ------------------
  |  |  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.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.16k]
  |  |  ------------------
  ------------------
  996|       |
  997|  2.16k|        if (ip >= op && ip < oBlockEnd) {
  ------------------
  |  Branch (997:13): [True: 10, False: 2.15k]
  |  Branch (997:25): [True: 0, False: 10]
  ------------------
  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|  2.16k|        switch(blockProperties.blockType)
 1015|  2.16k|        {
 1016|  1.46k|        case bt_compressed:
  ------------------
  |  Branch (1016:9): [True: 1.46k, False: 698]
  ------------------
 1017|  1.46k|            assert(dctx->isFrameDecompression == 1);
  ------------------
  |  |   70|  1.46k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1018|  1.46k|            decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oBlockEnd-op), ip, cBlockSize, not_streaming);
 1019|  1.46k|            break;
 1020|    506|        case bt_raw :
  ------------------
  |  Branch (1020:9): [True: 506, False: 1.65k]
  ------------------
 1021|       |            /* Use oend instead of oBlockEnd because this function is safe to overlap. It uses memmove. */
 1022|    506|            decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize);
 1023|    506|            break;
 1024|    192|        case bt_rle :
  ------------------
  |  Branch (1024:9): [True: 192, False: 1.97k]
  ------------------
 1025|    192|            decodedSize = ZSTD_setRleBlock(op, (size_t)(oBlockEnd-op), *ip, blockProperties.origSize);
 1026|    192|            break;
 1027|      0|        case bt_reserved :
  ------------------
  |  Branch (1027:9): [True: 0, False: 2.16k]
  ------------------
 1028|      0|        default:
  ------------------
  |  Branch (1028:9): [True: 0, False: 2.16k]
  ------------------
 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|  2.16k|        }
 1031|  2.16k|        FORWARD_IF_ERROR(decodedSize, "Block decompression failure");
  ------------------
  |  |  146|  2.16k|    do {                                                                           \
  |  |  147|  2.16k|        size_t const err_code = (err);                                             \
  |  |  148|  2.16k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 1.27k, False: 886]
  |  |  ------------------
  |  |  149|  1.27k|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|  1.27k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  1.27k|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|  1.27k|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|  1.27k|    do {                                           \
  |  |  |  |   99|  1.27k|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1.27k]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|  1.27k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|  1.27k|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|  1.27k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  1.27k|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|  1.27k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|  1.27k|            return err_code;                                                       \
  |  |  155|  1.27k|        }                                                                          \
  |  |  156|  2.16k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 886]
  |  |  ------------------
  ------------------
 1032|    886|        DEBUGLOG(5, "Decompressed block of dSize = %u", (unsigned)decodedSize);
  ------------------
  |  |  104|    886|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 886]
  |  |  ------------------
  ------------------
 1033|    886|        if (dctx->validateChecksum) {
  ------------------
  |  Branch (1033:13): [True: 655, False: 231]
  ------------------
 1034|    655|            XXH64_update(&dctx->xxhState, op, decodedSize);
  ------------------
  |  |  460|    655|#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
  |  |  ------------------
  |  |  |  |  443|    655|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    655|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1035|    655|        }
 1036|    886|        if (decodedSize) /* support dst = NULL,0 */ {
  ------------------
  |  Branch (1036:13): [True: 527, False: 359]
  ------------------
 1037|    527|            op += decodedSize;
 1038|    527|        }
 1039|    886|        assert(ip != NULL);
  ------------------
  |  |   70|    886|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1040|    886|        ip += cBlockSize;
 1041|    886|        remainingSrcSize -= cBlockSize;
 1042|    886|        if (blockProperties.lastBlock) break;
  ------------------
  |  Branch (1042:13): [True: 226, False: 660]
  ------------------
 1043|    886|    }
 1044|       |
 1045|    226|    if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) {
  ------------------
  |  |  203|    226|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (1045:9): [True: 165, False: 61]
  ------------------
 1046|    165|        RETURN_ERROR_IF((U64)(op-ostart) != dctx->fParams.frameContentSize,
  ------------------
  |  |  114|    165|    do {                                                                       \
  |  |  115|    165|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 100, False: 65]
  |  |  ------------------
  |  |  116|    100|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    100|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 100]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    100|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    100|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    100|    do {                                           \
  |  |  |  |   99|    100|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 100]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    100|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 100]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    100|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    100|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 100]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    100|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    100|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 100]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    100|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    100|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    100|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    100|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    100|        }                                                                      \
  |  |  123|    165|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 65]
  |  |  ------------------
  ------------------
 1047|    165|                        corruption_detected, "");
 1048|    165|    }
 1049|    126|    if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */
  ------------------
  |  Branch (1049:9): [True: 43, False: 83]
  ------------------
 1050|     43|        RETURN_ERROR_IF(remainingSrcSize<4, checksum_wrong, "");
  ------------------
  |  |  114|     43|    do {                                                                       \
  |  |  115|     43|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 41]
  |  |  ------------------
  |  |  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|     43|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 41]
  |  |  ------------------
  ------------------
 1051|     41|        if (!dctx->forceIgnoreChecksum) {
  ------------------
  |  Branch (1051:13): [True: 41, False: 0]
  ------------------
 1052|     41|            U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);
  ------------------
  |  |  461|     41|#  define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)
  |  |  ------------------
  |  |  |  |  443|     41|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|     41|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1053|     41|            U32 checkRead;
 1054|     41|            checkRead = MEM_readLE32(ip);
 1055|     41|            RETURN_ERROR_IF(checkRead != checkCalc, checksum_wrong, "");
  ------------------
  |  |  114|     41|    do {                                                                       \
  |  |  115|     41|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 40, False: 1]
  |  |  ------------------
  |  |  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|     41|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1056|     41|        }
 1057|      1|        ip += 4;
 1058|      1|        remainingSrcSize -= 4;
 1059|      1|    }
 1060|     84|    ZSTD_DCtx_trace_end(dctx, (U64)(op-ostart), (U64)(ip-istart), /* streaming */ 0);
 1061|       |    /* Allow caller to get size read */
 1062|     84|    DEBUGLOG(4, "ZSTD_decompressFrame: decompressed frame of size %i, consuming %i bytes of input", (int)(op-ostart), (int)(ip - (const BYTE*)*srcPtr));
  ------------------
  |  |  104|     84|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 84]
  |  |  ------------------
  ------------------
 1063|     84|    *srcPtr = ip;
 1064|     84|    *srcSizePtr = remainingSrcSize;
 1065|     84|    return (size_t)(op-ostart);
 1066|    126|}
zstd_decompress.c:ZSTD_getDDict:
 1181|  1.63k|{
 1182|  1.63k|    switch (dctx->dictUses) {
 1183|      0|    default:
  ------------------
  |  Branch (1183:5): [True: 0, False: 1.63k]
  ------------------
 1184|      0|        assert(0 /* Impossible */);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1185|      0|        ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
 1186|  1.63k|    case ZSTD_dont_use:
  ------------------
  |  Branch (1186:5): [True: 1.63k, False: 0]
  ------------------
 1187|  1.63k|        ZSTD_clearDict(dctx);
 1188|  1.63k|        return NULL;
 1189|      0|    case ZSTD_use_indefinitely:
  ------------------
  |  Branch (1189:5): [True: 0, False: 1.63k]
  ------------------
 1190|      0|        return dctx->ddict;
 1191|      0|    case ZSTD_use_once:
  ------------------
  |  Branch (1191:5): [True: 0, False: 1.63k]
  ------------------
 1192|      0|        dctx->dictUses = ZSTD_dont_use;
 1193|      0|        return dctx->ddict;
 1194|  1.63k|    }
 1195|  1.63k|}
zstd_decompress.c:ZSTD_decodeFrameHeader:
  703|  1.62k|{
  704|  1.62k|    size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format);
  705|  1.62k|    if (ZSTD_isError(result)) return result;    /* invalid header */
  ------------------
  |  |   44|  1.62k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (705:9): [True: 59, False: 1.56k]
  ------------------
  706|  1.56k|    RETURN_ERROR_IF(result>0, srcSize_wrong, "headerSize too small");
  ------------------
  |  |  114|  1.56k|    do {                                                                       \
  |  |  115|  1.56k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
  707|       |
  708|       |    /* Reference DDict requested by frame if dctx references multiple ddicts */
  709|  1.56k|    if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts && dctx->ddictSet) {
  ------------------
  |  Branch (709:9): [True: 0, False: 1.56k]
  |  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|  1.56k|    dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0;
  ------------------
  |  Branch (720:31): [True: 776, False: 785]
  |  Branch (720:61): [True: 776, False: 0]
  ------------------
  721|  1.56k|    if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|    776|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|    776|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    776|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (721:9): [True: 776, False: 785]
  ------------------
  722|  1.56k|    dctx->processedCSize += headerSize;
  723|  1.56k|    return 0;
  724|  1.56k|}
zstd_decompress.c:ZSTD_copyRawBlock:
  898|    506|{
  899|    506|    DEBUGLOG(5, "ZSTD_copyRawBlock");
  ------------------
  |  |  104|    506|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 506]
  |  |  ------------------
  ------------------
  900|    506|    RETURN_ERROR_IF(srcSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|    506|    do {                                                                       \
  |  |  115|    506|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 506]
  |  |  ------------------
  |  |  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|    506|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 506]
  |  |  ------------------
  ------------------
  901|    506|    if (dst == NULL) {
  ------------------
  |  Branch (901:9): [True: 0, False: 506]
  ------------------
  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|    506|    ZSTD_memmove(dst, src, srcSize);
  ------------------
  |  |   45|    506|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  906|    506|    return srcSize;
  907|    506|}
zstd_decompress.c:ZSTD_setRleBlock:
  912|    192|{
  913|    192|    RETURN_ERROR_IF(regenSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|    192|    do {                                                                       \
  |  |  115|    192|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6, False: 186]
  |  |  ------------------
  |  |  116|      6|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      6|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      6|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      6|    do {                                           \
  |  |  |  |   99|      6|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      6|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      6|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      6|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      6|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      6|        }                                                                      \
  |  |  123|    192|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 186]
  |  |  ------------------
  ------------------
  914|    186|    if (dst == NULL) {
  ------------------
  |  Branch (914:9): [True: 0, False: 186]
  ------------------
  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|    186|    ZSTD_memset(dst, b, regenSize);
  ------------------
  |  |   46|    186|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  919|    186|    return regenSize;
  920|    186|}
zstd_decompress.c:ZSTD_DCtx_trace_end:
  923|     84|{
  924|     84|#if ZSTD_TRACE
  925|     84|    if (dctx->traceCtx && ZSTD_trace_decompress_end != NULL) {
  ------------------
  |  Branch (925:9): [True: 0, False: 84]
  |  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|     84|}
zstd_decompress.c:ZSTD_DCtx_resetParameters:
  241|  1.58k|{
  242|  1.58k|    assert(dctx->streamStage == zdss_init);
  ------------------
  |  |   70|  1.58k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  243|  1.58k|    dctx->format = ZSTD_f_zstd1;
  244|  1.58k|    dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;
  ------------------
  |  |   40|  1.58k|#  define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)
  |  |  ------------------
  |  |  |  | 1287|  1.58k|#define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27   /* by default, the streaming decoder will refuse any frame
  |  |  ------------------
  ------------------
  245|  1.58k|    dctx->outBufferMode = ZSTD_bm_buffered;
  246|  1.58k|    dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum;
  247|  1.58k|    dctx->refMultipleDDicts = ZSTD_rmd_refSingleDDict;
  248|  1.58k|    dctx->disableHufAsm = 0;
  249|  1.58k|    dctx->maxBlockSizeParam = 0;
  250|  1.58k|}

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

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

zstd_decompress.c:ZSTD_isLegacy:
   57|  1.65k|{
   58|  1.65k|    U32 magicNumberLE;
   59|  1.65k|    if (srcSize<4) return 0;
  ------------------
  |  Branch (59:9): [True: 0, False: 1.65k]
  ------------------
   60|  1.65k|    magicNumberLE = MEM_readLE32(src);
   61|  1.65k|    switch(magicNumberLE)
   62|  1.65k|    {
   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|      0|        case ZSTDv05_MAGICNUMBER : return 5;
  ------------------
  |  |  153|      0|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (76:9): [True: 0, False: 1.65k]
  ------------------
   77|      0|#endif
   78|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
   79|      2|        case ZSTDv06_MAGICNUMBER : return 6;
  ------------------
  |  |  164|      2|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (79:9): [True: 2, False: 1.65k]
  ------------------
   80|      0|#endif
   81|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
   82|      0|        case ZSTDv07_MAGICNUMBER : return 7;
  ------------------
  |  |  180|      0|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (82:9): [True: 0, False: 1.65k]
  ------------------
   83|      0|#endif
   84|  1.65k|        default : return 0;
  ------------------
  |  Branch (84:9): [True: 1.65k, False: 2]
  ------------------
   85|  1.65k|    }
   86|  1.65k|}
zstd_decompress.c:ZSTD_findFrameSizeInfoLegacy:
  196|      1|{
  197|      1|    ZSTD_frameSizeInfo frameSizeInfo;
  198|      1|    U32 const version = ZSTD_isLegacy(src, srcSize);
  199|      1|    switch(version)
  200|      1|    {
  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|      0|        case 5 :
  ------------------
  |  Branch (230:9): [True: 0, False: 1]
  ------------------
  231|      0|            ZSTDv05_findFrameSizeInfoLegacy(src, srcSize,
  232|      0|                &frameSizeInfo.compressedSize,
  233|      0|                &frameSizeInfo.decompressedBound);
  234|      0|            break;
  235|      0|#endif
  236|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
  237|      1|        case 6 :
  ------------------
  |  Branch (237:9): [True: 1, False: 0]
  ------------------
  238|      1|            ZSTDv06_findFrameSizeInfoLegacy(src, srcSize,
  239|      1|                &frameSizeInfo.compressedSize,
  240|      1|                &frameSizeInfo.decompressedBound);
  241|      1|            break;
  242|      0|#endif
  243|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
  244|      0|        case 7 :
  ------------------
  |  Branch (244:9): [True: 0, False: 1]
  ------------------
  245|      0|            ZSTDv07_findFrameSizeInfoLegacy(src, srcSize,
  246|      0|                &frameSizeInfo.compressedSize,
  247|      0|                &frameSizeInfo.decompressedBound);
  248|      0|            break;
  249|      0|#endif
  250|      0|        default :
  ------------------
  |  Branch (250:9): [True: 0, False: 1]
  ------------------
  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|      1|    }
  255|      1|    if (!ZSTD_isError(frameSizeInfo.compressedSize) && frameSizeInfo.compressedSize > srcSize) {
  ------------------
  |  |   44|      1|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (255:9): [True: 0, False: 1]
  |  Branch (255:56): [True: 0, False: 0]
  ------------------
  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|      1|    if (frameSizeInfo.decompressedBound != ZSTD_CONTENTSIZE_ERROR) {
  ------------------
  |  |  204|      1|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
  |  Branch (262:9): [True: 0, False: 1]
  ------------------
  263|      0|        assert((frameSizeInfo.decompressedBound & (ZSTD_BLOCKSIZE_MAX - 1)) == 0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  264|      0|        frameSizeInfo.nbBlocks = (size_t)(frameSizeInfo.decompressedBound / ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |  148|      0|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|      0|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  265|      0|    }
  266|      1|    return frameSizeInfo;
  267|      1|}
zstd_decompress.c:ZSTD_findFrameCompressedSizeLegacy:
  270|      1|{
  271|      1|    ZSTD_frameSizeInfo frameSizeInfo = ZSTD_findFrameSizeInfoLegacy(src, srcSize);
  272|      1|    return frameSizeInfo.compressedSize;
  273|      1|}

ZSTDv06_findFrameSizeInfoLegacy:
 3618|      1|{
 3619|      1|    const BYTE* ip = (const BYTE*)src;
 3620|      1|    size_t remainingSize = srcSize;
 3621|      1|    size_t nbBlocks = 0;
 3622|      1|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3623|       |
 3624|       |    /* Frame Header */
 3625|      1|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, srcSize);
 3626|      1|        if (ZSTDv06_isError(frameHeaderSize)) {
  ------------------
  |  | 2731|      1|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3626:13): [True: 0, False: 1]
  ------------------
 3627|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3628|      0|            return;
 3629|      0|        }
 3630|      1|        if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) {
  ------------------
  |  |  164|      1|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (3630:13): [True: 0, False: 1]
  ------------------
 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|        if (srcSize < frameHeaderSize+ZSTDv06_blockHeaderSize) {
  ------------------
  |  Branch (3634:13): [True: 0, False: 1]
  ------------------
 3635|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3636|      0|            return;
 3637|      0|        }
 3638|      1|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3639|      1|    }
 3640|       |
 3641|       |    /* Loop on each block */
 3642|      1|    while (1) {
  ------------------
  |  Branch (3642:12): [True: 1, Folded]
  ------------------
 3643|      1|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, remainingSize, &blockProperties);
 3644|      1|        if (ZSTDv06_isError(cBlockSize)) {
  ------------------
  |  | 2731|      1|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3644:13): [True: 0, False: 1]
  ------------------
 3645|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3646|      0|            return;
 3647|      0|        }
 3648|       |
 3649|      1|        ip += ZSTDv06_blockHeaderSize;
 3650|      1|        remainingSize -= ZSTDv06_blockHeaderSize;
 3651|      1|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3651:13): [True: 1, False: 0]
  ------------------
 3652|      1|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3653|      1|            return;
 3654|      1|        }
 3655|       |
 3656|      0|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3656:13): [True: 0, False: 0]
  ------------------
 3657|       |
 3658|      0|        ip += cBlockSize;
 3659|      0|        remainingSize -= cBlockSize;
 3660|      0|        nbBlocks++;
 3661|      0|    }
 3662|       |
 3663|      0|    *cSize = ip - (const BYTE*)src;
 3664|      0|    *dBound = nbBlocks * ZSTDv06_BLOCKSIZE_MAX;
  ------------------
  |  |  344|      0|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3665|      0|}
zstd_v06.c:MEM_readLE32:
  190|      1|{
  191|      1|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (191:9): [True: 1, False: 0]
  ------------------
  192|      1|        return MEM_read32(memPtr);
  193|      0|    else
  194|      0|        return MEM_swap32(MEM_read32(memPtr));
  195|      1|}
zstd_v06.c:MEM_isLittleEndian:
  108|      1|{
  109|      1|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  110|      1|    return one.c[0];
  111|      1|}
zstd_v06.c:MEM_read32:
  119|      1|{
  120|      1|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  121|      1|}
zstd_v06.c:ZSTDv06_frameHeaderSize:
 2912|      1|{
 2913|      1|    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: 1]
  ------------------
 2914|      1|    { U32 const fcsId = (((const BYTE*)src)[4]) >> 6;
 2915|      1|      return ZSTDv06_frameHeaderSize_min + ZSTDv06_fcs_fieldSize[fcsId]; }
 2916|      1|}
zstd_v06.c:ZSTD_errorFrameSizeInfoLegacy:
 3612|      1|{
 3613|      1|    *cSize = ret;
 3614|      1|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  454|      1|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3615|      1|}
zstd_v06.c:ZSTDv06_getcBlockSize:
 2971|      1|{
 2972|      1|    const BYTE* const in = (const BYTE*)src;
 2973|      1|    U32 cSize;
 2974|       |
 2975|      1|    if (srcSize < ZSTDv06_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2975:9): [True: 0, False: 1]
  ------------------
 2976|       |
 2977|      1|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 2978|      1|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2979|      1|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2979:23): [True: 0, False: 1]
  ------------------
 2980|       |
 2981|      1|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2981:9): [True: 0, False: 1]
  ------------------
 2982|      1|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2982:9): [True: 0, False: 1]
  ------------------
 2983|      1|    return cSize;
 2984|      1|}

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

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

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

blosc2.c:is_little_endian:
   36|   240k|static bool is_little_endian(void) {
   37|   240k|  static const int i = 1;
   38|   240k|  char* p = (char*)&i;
   39|       |
   40|   240k|  if (p[0] == 1) {
  ------------------
  |  Branch (40:7): [True: 240k, False: 0]
  ------------------
   41|   240k|    return true;
   42|   240k|  }
   43|      0|  else {
   44|       |    return false;
   45|      0|  }
   46|   240k|}
blosc2.c:load_lib:
  311|      1|static inline void* load_lib(char *plugin_name, char *libpath) {
  312|      1|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (312:7): [True: 0, False: 1]
  ------------------
  313|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|      0|    return NULL;
  315|      0|  }
  316|       |    // Attempt to directly load the library by name
  317|       |#if defined(_WIN32)
  318|       |    // Windows dynamic library (DLL) format
  319|       |    snprintf(libpath, PATH_MAX, "blosc2_%s.dll", plugin_name);
  320|       |#else
  321|       |    // Unix/Linux/Mac OS dynamic library (.so) format
  322|      1|    snprintf(libpath, PATH_MAX, "libblosc2_%s.so", plugin_name);
  323|      1|#endif
  324|      1|    void* loaded_lib = dlopen(libpath, RTLD_LAZY);
  325|      1|    if (loaded_lib != NULL) {
  ------------------
  |  Branch (325:9): [True: 0, False: 1]
  ------------------
  326|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  327|      0|        return loaded_lib;
  328|      1|    } else {
  329|       |#if defined(_WIN32)
  330|       |        BLOSC_TRACE_INFO("Failed to load %s directly, error: %lu\n", libpath, GetLastError());
  331|       |#else
  332|      1|        BLOSC_TRACE_INFO("Failed to load %s directly, error: %s\n", libpath, dlerror());
  ------------------
  |  |   95|      1|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  333|      1|#endif
  334|      1|    }
  335|       |    // If direct loading fails, fallback to using Python to find the library path
  336|      1|    if (get_libpath(plugin_name, libpath, "") < 0 && get_libpath(plugin_name, libpath, "3") < 0) {
  ------------------
  |  Branch (336:9): [True: 1, False: 0]
  |  Branch (336:54): [True: 1, False: 0]
  ------------------
  337|      1|        BLOSC_TRACE_ERROR("Problems when running python or python3 for getting plugin path");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  338|      1|        return NULL;
  339|      1|    }
  340|       |
  341|      0|    if (strlen(libpath) == 0) {
  ------------------
  |  Branch (341:9): [True: 0, False: 0]
  ------------------
  342|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  343|      0|        return NULL;
  344|      0|    }
  345|       |
  346|       |    // Try to load the library again with the path from Python
  347|      0|    loaded_lib = dlopen(libpath, RTLD_LAZY);
  348|      0|    if (loaded_lib == NULL) {
  ------------------
  |  Branch (348:9): [True: 0, False: 0]
  ------------------
  349|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  350|      0|    } else {
  351|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  352|      0|    }
  353|       |
  354|      0|    return loaded_lib;
  355|      0|}
blosc2.c:blosc2_valid_plugin_name:
  269|      3|static inline bool blosc2_valid_plugin_name(const char *plugin_name) {
  270|      3|  if (plugin_name == NULL || plugin_name[0] == '\0') {
  ------------------
  |  Branch (270:7): [True: 0, False: 3]
  |  Branch (270:30): [True: 0, False: 3]
  ------------------
  271|      0|    return false;
  272|      0|  }
  273|     15|  for (const unsigned char *p = (const unsigned char *)plugin_name; *p != '\0'; ++p) {
  ------------------
  |  Branch (273:69): [True: 12, False: 3]
  ------------------
  274|     12|    if (!isalnum(*p) && *p != '_') {
  ------------------
  |  Branch (274:9): [True: 0, False: 12]
  |  Branch (274:25): [True: 0, False: 0]
  ------------------
  275|      0|      return false;
  276|      0|    }
  277|     12|  }
  278|      3|  return true;
  279|      3|}
blosc2.c:get_libpath:
  282|      2|static inline int get_libpath(char *plugin_name, char *libpath, char *python_version) {
  283|      2|  BLOSC_TRACE_INFO("Trying to get plugin path with python%s\n", python_version);
  ------------------
  |  |   95|      2|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|      2|  char python_cmd[PATH_MAX] = {0};
  285|      2|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (285:7): [True: 0, False: 2]
  ------------------
  286|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  288|      0|  }
  289|      2|  int written = snprintf(python_cmd, sizeof(python_cmd),
  290|      2|                         "python%s -c \"import blosc2_%s; blosc2_%s.print_libpath()\"",
  291|      2|                         python_version, plugin_name, plugin_name);
  292|      2|  if (written < 0 || (size_t)written >= sizeof(python_cmd)) {
  ------------------
  |  Branch (292:7): [True: 0, False: 2]
  |  Branch (292:22): [True: 0, False: 2]
  ------------------
  293|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  294|      0|    return BLOSC2_ERROR_FAILURE;
  295|      0|  }
  296|      2|  FILE *fp = popen(python_cmd, "r");
  297|      2|  if (fp == NULL) {
  ------------------
  |  Branch (297:7): [True: 0, False: 2]
  ------------------
  298|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  299|      0|    return BLOSC2_ERROR_FAILURE;
  300|      0|  }
  301|      2|  if (fgets(libpath, PATH_MAX, fp) == NULL) {
  ------------------
  |  Branch (301:7): [True: 2, False: 0]
  ------------------
  302|      2|    BLOSC_TRACE_ERROR("Could not read python output");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  303|      2|    pclose(fp);
  304|      2|    return BLOSC2_ERROR_FAILURE;
  305|      2|  }
  306|      0|  pclose(fp);
  307|       |
  308|      0|  return BLOSC2_ERROR_SUCCESS;
  309|      2|}
blosc2.c:sw32_:
  109|  7.48k|static inline int32_t sw32_(const void* pa) {
  110|  7.48k|  int32_t idest;
  111|       |
  112|  7.48k|  bool little_endian = is_little_endian();
  113|  7.48k|  if (little_endian) {
  ------------------
  |  Branch (113:7): [True: 7.48k, False: 0]
  ------------------
  114|  7.48k|    memcpy(&idest, pa, sizeof(idest));
  115|  7.48k|  }
  116|      0|  else {
  117|      0|#if defined (__GNUC__)
  118|      0|    return __builtin_bswap32(*(unsigned int *)pa);
  119|       |#elif defined (_MSC_VER) /* Visual Studio */
  120|       |    return _byteswap_ulong(*(unsigned int *)pa);
  121|       |#else
  122|       |    const uint8_t *pa_ = (const uint8_t *)pa;
  123|       |    uint8_t *dest = (uint8_t *)&idest;
  124|       |    dest[0] = pa_[3];
  125|       |    dest[1] = pa_[2];
  126|       |    dest[2] = pa_[1];
  127|       |    dest[3] = pa_[0];
  128|       |#endif
  129|      0|  }
  130|  7.48k|  return idest;
  131|  7.48k|}
frame.c:endian_handler:
   50|  62.8k|{
   51|  62.8k|  bool little_endian = is_little_endian();
   52|  62.8k|  if (little_endian == little) {
  ------------------
  |  Branch (52:7): [True: 0, False: 62.8k]
  ------------------
   53|      0|    memcpy(dest, pa, size);
   54|      0|  }
   55|  62.8k|  else {
   56|  62.8k|    uint8_t* pa_ = (uint8_t*)pa;
   57|  62.8k|    uint8_t pa2_[8];
   58|  62.8k|    switch (size) {
   59|  25.6k|      case 8:
  ------------------
  |  Branch (59:7): [True: 25.6k, False: 37.2k]
  ------------------
   60|  25.6k|        pa2_[0] = pa_[7];
   61|  25.6k|        pa2_[1] = pa_[6];
   62|  25.6k|        pa2_[2] = pa_[5];
   63|  25.6k|        pa2_[3] = pa_[4];
   64|  25.6k|        pa2_[4] = pa_[3];
   65|  25.6k|        pa2_[5] = pa_[2];
   66|  25.6k|        pa2_[6] = pa_[1];
   67|  25.6k|        pa2_[7] = pa_[0];
   68|  25.6k|        break;
   69|  31.4k|      case 4:
  ------------------
  |  Branch (69:7): [True: 31.4k, False: 31.3k]
  ------------------
   70|  31.4k|        pa2_[0] = pa_[3];
   71|  31.4k|        pa2_[1] = pa_[2];
   72|  31.4k|        pa2_[2] = pa_[1];
   73|  31.4k|        pa2_[3] = pa_[0];
   74|  31.4k|        break;
   75|    771|      case 2:
  ------------------
  |  Branch (75:7): [True: 771, False: 62.0k]
  ------------------
   76|    771|        pa2_[0] = pa_[1];
   77|    771|        pa2_[1] = pa_[0];
   78|    771|        break;
   79|  4.94k|      case 1:
  ------------------
  |  Branch (79:7): [True: 4.94k, False: 57.9k]
  ------------------
   80|  4.94k|        pa2_[0] = pa_[0];
   81|  4.94k|        break;
   82|      0|      default:
  ------------------
  |  Branch (82:7): [True: 0, False: 62.8k]
  ------------------
   83|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|  62.8k|    }
   85|  62.8k|    memcpy(dest, pa2_, size);
   86|  62.8k|  }
   87|  62.8k|}
frame.c:is_little_endian:
   36|  62.8k|static bool is_little_endian(void) {
   37|  62.8k|  static const int i = 1;
   38|  62.8k|  char* p = (char*)&i;
   39|       |
   40|  62.8k|  if (p[0] == 1) {
  ------------------
  |  Branch (40:7): [True: 62.8k, False: 0]
  ------------------
   41|  62.8k|    return true;
   42|  62.8k|  }
   43|      0|  else {
   44|       |    return false;
   45|      0|  }
   46|  62.8k|}
frame.c:blosc2_nchunks_to_offsets_nbytes:
   97|  15.8k|static inline bool blosc2_nchunks_to_offsets_nbytes(int64_t nchunks, int32_t *off_nbytes) {
   98|  15.8k|  const int64_t max_nchunks = INT32_MAX / (int64_t)sizeof(int64_t);
   99|  15.8k|  if (nchunks < 0 || nchunks > max_nchunks) {
  ------------------
  |  Branch (99:7): [True: 0, False: 15.8k]
  |  Branch (99:22): [True: 5, False: 15.8k]
  ------------------
  100|      5|    return false;
  101|      5|  }
  102|  15.8k|  if (off_nbytes != NULL) {
  ------------------
  |  Branch (102:7): [True: 15.8k, False: 0]
  ------------------
  103|  15.8k|    *off_nbytes = (int32_t)(nchunks * (int64_t)sizeof(int64_t));
  104|  15.8k|  }
  105|       |  return true;
  106|  15.8k|}

blosc2_stdio_open:
   72|      2|void *blosc2_stdio_open(const char *urlpath, const char *mode, void *params) {
   73|      2|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|      2|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
   74|      2|  if (urlpath == NULL || mode == NULL) {
  ------------------
  |  Branch (74:7): [True: 2, False: 0]
  |  Branch (74:26): [True: 0, False: 0]
  ------------------
   75|      2|    BLOSC_TRACE_ERROR("Invalid arguments for stdio open.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   76|      2|    return NULL;
   77|      2|  }
   78|      0|  FILE *file = fopen(urlpath, mode);
   79|      0|  if (file == NULL) {
  ------------------
  |  Branch (79:7): [True: 0, False: 0]
  ------------------
   80|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|      0|    return NULL;
   82|      0|  }
   83|      0|  blosc2_stdio_file *my_fp = malloc(sizeof(blosc2_stdio_file));
   84|      0|  if (my_fp == NULL) {
  ------------------
  |  Branch (84:7): [True: 0, False: 0]
  ------------------
   85|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   86|      0|    fclose(file);
   87|      0|    return NULL;
   88|      0|  }
   89|      0|  my_fp->file = file;
   90|      0|  return my_fp;
   91|      0|}
blosc2_stdio_destroy:
  262|  4.73k|int blosc2_stdio_destroy(void* params) {
  263|  4.73k|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|  4.73k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  264|  4.73k|  return 0;
  265|  4.73k|}

do_nothing:
  578|  29.0k|int do_nothing(uint8_t filter, char cmode) {
  579|  29.0k|  if (cmode == 'c') {
  ------------------
  |  Branch (579:7): [True: 0, False: 29.0k]
  ------------------
  580|      0|    return (filter == BLOSC_NOFILTER);
  581|  29.0k|  } else {
  582|       |    // TRUNC_PREC do not have to be applied during decompression
  583|  29.0k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (583:13): [True: 9.79k, False: 19.3k]
  |  Branch (583:43): [True: 821, False: 18.4k]
  ------------------
  584|  29.0k|  }
  585|  29.0k|}
next_filter:
  588|  4.91k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  589|  8.39k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (589:36): [True: 8.39k, False: 0]
  ------------------
  590|  8.39k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (590:9): [True: 4.91k, False: 3.48k]
  ------------------
  591|  4.91k|      return filters[i];
  592|  4.91k|    }
  593|  8.39k|  }
  594|      0|  return BLOSC_NOFILTER;
  595|  4.91k|}
last_filter:
  598|  3.45k|int last_filter(const uint8_t* filters, char cmode) {
  599|  3.45k|  int last_index = -1;
  600|  24.1k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (600:40): [True: 20.7k, False: 3.45k]
  ------------------
  601|  20.7k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (601:9): [True: 13.5k, False: 7.12k]
  ------------------
  602|  13.5k|      last_index = i;
  603|  13.5k|    }
  604|  20.7k|  }
  605|  3.45k|  return last_index;
  606|  3.45k|}
read_chunk_header:
  685|   232k|{
  686|   232k|  memset(header, 0, sizeof(blosc_header));
  687|       |
  688|   232k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (688:7): [True: 0, False: 232k]
  ------------------
  689|      0|    BLOSC_TRACE_ERROR("Not enough space to read Blosc header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|      0|    return BLOSC2_ERROR_READ_BUFFER;
  691|      0|  }
  692|       |
  693|   232k|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  694|       |
  695|   232k|  bool little_endian = is_little_endian();
  696|       |
  697|   232k|  if (!little_endian) {
  ------------------
  |  Branch (697:7): [True: 0, False: 232k]
  ------------------
  698|      0|    header->nbytes = bswap32_(header->nbytes);
  699|      0|    header->blocksize = bswap32_(header->blocksize);
  700|      0|    header->cbytes = bswap32_(header->cbytes);
  701|      0|  }
  702|       |
  703|   232k|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (703:7): [True: 21, False: 232k]
  ------------------
  704|     21|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|     21|    return BLOSC2_ERROR_INVALID_HEADER;
  706|     21|  }
  707|   232k|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (707:7): [True: 12, False: 232k]
  ------------------
  708|     12|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  709|     12|    return BLOSC2_ERROR_INVALID_HEADER;
  710|     12|  }
  711|   232k|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (711:7): [True: 4, False: 232k]
  ------------------
  712|      4|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|      4|    return BLOSC2_ERROR_INVALID_HEADER;
  714|      4|  }
  715|   232k|  if (header->typesize == 0) {
  ------------------
  |  Branch (715:7): [True: 3, False: 232k]
  ------------------
  716|      3|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|      3|    return BLOSC2_ERROR_INVALID_HEADER;
  718|      3|  }
  719|       |
  720|       |  /* Read extended header if it is wanted */
  721|   232k|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (721:7): [True: 5.72k, False: 226k]
  |  Branch (721:28): [True: 5.54k, False: 174]
  |  Branch (721:65): [True: 5.38k, False: 164]
  ------------------
  722|  5.38k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (722:9): [True: 0, False: 5.38k]
  ------------------
  723|      0|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  724|      0|      return BLOSC2_ERROR_INVALID_HEADER;
  725|      0|    }
  726|  5.38k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (726:9): [True: 0, False: 5.38k]
  ------------------
  727|      0|      BLOSC_TRACE_ERROR("Not enough space to read Blosc extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|      0|      return BLOSC2_ERROR_READ_BUFFER;
  729|      0|    }
  730|       |
  731|  5.38k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  732|  5.38k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  733|       |
  734|  5.38k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (734:9): [True: 8, False: 5.37k]
  |  Branch (734:55): [True: 7, False: 1]
  ------------------
  735|      7|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  736|      7|      if (special_type != 0) {
  ------------------
  |  Branch (736:11): [True: 4, False: 3]
  ------------------
  737|      4|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|      4|        return BLOSC2_ERROR_INVALID_HEADER;
  739|      4|      }
  740|      7|    }
  741|       |
  742|  5.37k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  743|  5.37k|    if (special_type != 0) {
  ------------------
  |  Branch (743:9): [True: 233, False: 5.14k]
  ------------------
  744|    233|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (744:11): [True: 62, False: 171]
  ------------------
  745|       |        // In this case, the actual type size must be derived from the cbytes
  746|     62|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  747|     62|        if (typesize <= 0) {
  ------------------
  |  Branch (747:13): [True: 0, False: 62]
  ------------------
  748|      0|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  750|      0|        }
  751|     62|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (751:13): [True: 0, False: 62]
  ------------------
  752|      0|          BLOSC_TRACE_ERROR("`typesize` is greater than maximum allowed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  754|      0|        }
  755|     62|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (755:13): [True: 0, False: 62]
  ------------------
  756|      0|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  758|      0|        }
  759|     62|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (759:13): [True: 2, False: 60]
  ------------------
  760|      2|          BLOSC_TRACE_ERROR("`nbytes` is not 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  761|      2|          return BLOSC2_ERROR_INVALID_HEADER;
  762|      2|        }
  763|     62|      }
  764|    171|      else {
  765|    171|        if (header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (765:13): [True: 0, False: 171]
  ------------------
  766|      0|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  768|      0|        }
  769|    171|      }
  770|    233|    }
  771|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  772|       |    // did not initialize filters to zero beyond the max supported.
  773|  5.37k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (773:9): [True: 547, False: 4.82k]
  ------------------
  774|    547|      header->filters[5] = 0;
  775|    547|      header->filters_meta[5] = 0;
  776|    547|    }
  777|  5.37k|  }
  778|   227k|  else {
  779|   227k|    flags_to_filters(header->flags, header->filters);
  780|   227k|  }
  781|   232k|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (781:7): [True: 1.14k, False: 231k]
  ------------------
  782|  1.14k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (782:7): [True: 4, False: 1.14k]
  ------------------
  783|       |    /* Version from future with unsupported chunk features. */
  784|      4|    return BLOSC2_ERROR_VERSION_SUPPORT;
  785|      4|  }
  786|   232k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (786:7): [True: 2, False: 232k]
  ------------------
  787|      2|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (787:7): [True: 0, False: 2]
  ------------------
  788|      0|    BLOSC_TRACE_ERROR("VL-block chunks cannot be memcpyed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  789|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  790|      0|  }
  791|   232k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (791:7): [True: 232k, False: 2]
  ------------------
  792|   232k|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (792:7): [True: 232k, False: 40]
  |  Branch (792:29): [True: 1.69k, False: 230k]
  ------------------
  793|  1.69k|    header->blocksize = header->nbytes;
  794|  1.69k|  }
  795|   232k|  return 0;
  796|   232k|}
fill_codec:
  879|      1|int fill_codec(blosc2_codec *codec) {
  880|      1|  char libpath[PATH_MAX];
  881|      1|  void *lib = load_lib(codec->compname, libpath);
  882|      1|  if(lib == NULL) {
  ------------------
  |  Branch (882:6): [True: 1, False: 0]
  ------------------
  883|      1|    BLOSC_TRACE_ERROR("Error while loading the library for codec `%s`", codec->compname);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  884|      1|    return BLOSC2_ERROR_FAILURE;
  885|      1|  }
  886|       |
  887|      0|  codec_info *info = dlsym(lib, "info");
  888|      0|  if (info == NULL) {
  ------------------
  |  Branch (888:7): [True: 0, False: 0]
  ------------------
  889|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  890|      0|    dlclose(lib);
  891|      0|    return BLOSC2_ERROR_FAILURE;
  892|      0|  }
  893|      0|  codec->encoder = dlsym(lib, info->encoder);
  894|      0|  codec->decoder = dlsym(lib, info->decoder);
  895|       |
  896|      0|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (896:7): [True: 0, False: 0]
  |  Branch (896:33): [True: 0, False: 0]
  ------------------
  897|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  898|      0|    dlclose(lib);
  899|      0|    return BLOSC2_ERROR_FAILURE;
  900|      0|  }
  901|       |
  902|       |  /* If ever add .free function in future for codec params
  903|       |  codecparams_info *info2 = dlsym(lib, "info2");
  904|       |  if (info2 != NULL) {
  905|       |    // New plugin (e.g. openzl) with free function for codec_params defined
  906|       |    // will be used when destroying context in blosc2_free_ctx
  907|       |      codec->free = dlsym(lib, info2->free);
  908|       |  }
  909|       |  else{
  910|       |    codec->free = NULL;
  911|       |  }
  912|       |  */
  913|       |
  914|      0|  return BLOSC2_ERROR_SUCCESS;
  915|      0|}
_cycle_buffers:
  992|  2.27k|void _cycle_buffers(uint8_t **src, uint8_t **dest, uint8_t **tmp) {
  993|  2.27k|  uint8_t *tmp2 = *src;
  994|  2.27k|  *src = *dest;
  995|  2.27k|  *dest = *tmp;
  996|  2.27k|  *tmp = tmp2;
  997|  2.27k|}
pipeline_backward:
 1419|    855|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1420|    855|  blosc2_context* context = thread_context->parent_context;
 1421|    855|  int32_t typesize = context->typesize;
 1422|    855|  uint8_t* filters = context->filters;
 1423|    855|  uint8_t* filters_meta = context->filters_meta;
 1424|    855|  uint8_t* _src = src;
 1425|    855|  uint8_t* _dest = tmp;
 1426|    855|  uint8_t* _tmp = tmp2;
 1427|    855|  int errcode = 0;
 1428|       |
 1429|  3.53k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1429:40): [True: 3.53k, False: 0]
  ------------------
 1430|       |    // Delta filter requires the whole chunk ready
 1431|  3.53k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1431:28): [True: 772, False: 2.76k]
  |  Branch (1431:56): [True: 504, False: 2.25k]
  ------------------
 1432|  2.25k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1432:28): [True: 687, False: 1.57k]
  ------------------
 1433|  3.53k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1433:9): [True: 1.96k, False: 1.57k]
  |  Branch (1433:29): [True: 1.96k, False: 0]
  ------------------
 1434|  1.96k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1434:10): [True: 602, False: 1.36k]
  |  Branch (1434:39): [True: 932, False: 429]
  ------------------
 1435|  1.53k|      _dest = dest + offset;
 1436|  1.53k|    }
 1437|  3.53k|    int rc = BLOSC2_ERROR_SUCCESS;
 1438|  3.53k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1438:9): [True: 2.93k, False: 603]
  ------------------
 1439|  2.93k|      switch (filters[i]) {
 1440|    683|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1440:9): [True: 683, False: 2.24k]
  ------------------
 1441|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1442|    683|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1442:28): [True: 291, False: 392]
  ------------------
 1443|    683|          break;
 1444|    438|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1444:9): [True: 438, False: 2.49k]
  ------------------
 1445|    438|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1445:15): [True: 0, False: 438]
  ------------------
 1446|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1447|      0|          }
 1448|    438|          break;
 1449|    602|        case BLOSC_DELTA:
  ------------------
  |  Branch (1449:9): [True: 602, False: 2.32k]
  ------------------
 1450|    602|          if (context->nthreads == 1) {
  ------------------
  |  Branch (1450:15): [True: 602, False: 0]
  ------------------
 1451|       |            /* Serial mode */
 1452|    602|            delta_decoder(dest, offset, bsize, typesize, _dest);
 1453|    602|          } else {
 1454|      0|            struct blosc_job_group *job = context->job;
 1455|      0|            blosc2_pthread_mutex_t *delta_mutex = job != NULL ? &job->delta_mutex : &context->delta_mutex;
  ------------------
  |  |   89|      0|#define blosc2_pthread_mutex_t pthread_mutex_t
  ------------------
  |  Branch (1455:51): [True: 0, False: 0]
  ------------------
 1456|      0|            blosc2_pthread_cond_t *delta_cv = job != NULL ? &job->delta_cv : &context->delta_cv;
  ------------------
  |  |   95|      0|#define blosc2_pthread_cond_t pthread_cond_t
  ------------------
  |  Branch (1456:47): [True: 0, False: 0]
  ------------------
 1457|      0|            int *dref_not_init = job != NULL ? &job->dref_not_init : &context->dref_not_init;
  ------------------
  |  Branch (1457:34): [True: 0, False: 0]
  ------------------
 1458|       |            /* Force the thread in charge of the block 0 to go first */
 1459|      0|            blosc2_pthread_mutex_lock(delta_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 1460|      0|            if (*dref_not_init) {
  ------------------
  |  Branch (1460:17): [True: 0, False: 0]
  ------------------
 1461|      0|              if (offset != 0) {
  ------------------
  |  Branch (1461:19): [True: 0, False: 0]
  ------------------
 1462|      0|                blosc2_pthread_cond_wait(delta_cv, delta_mutex);
  ------------------
  |  |   98|      0|#define blosc2_pthread_cond_wait(a, b) pthread_cond_wait((a), (b))
  ------------------
 1463|      0|              } else {
 1464|      0|                delta_decoder(dest, offset, bsize, typesize, _dest);
 1465|      0|                *dref_not_init = 0;
 1466|      0|                blosc2_pthread_cond_broadcast(delta_cv);
  ------------------
  |  |  100|      0|#define blosc2_pthread_cond_broadcast(a) pthread_cond_broadcast((a))
  ------------------
 1467|      0|              }
 1468|      0|            }
 1469|      0|            blosc2_pthread_mutex_unlock(delta_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 1470|      0|            if (offset != 0) {
  ------------------
  |  Branch (1470:17): [True: 0, False: 0]
  ------------------
 1471|      0|              delta_decoder(dest, offset, bsize, typesize, _dest);
 1472|      0|            }
 1473|      0|          }
 1474|    602|          break;
 1475|    134|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1475:9): [True: 134, False: 2.79k]
  ------------------
 1476|       |          // TRUNC_PREC filter does not need to be undone
 1477|    134|          break;
 1478|  1.07k|        default:
  ------------------
  |  Branch (1478:9): [True: 1.07k, False: 1.85k]
  ------------------
 1479|  1.07k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1479:15): [True: 36, False: 1.03k]
  ------------------
 1480|     36|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   93|     36|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     36|    do {                                            \
  |  |  |  |   98|     36|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     36|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 36, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     36|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1481|     36|                              filters[i]);
 1482|     36|            errcode = -1;
 1483|     36|          }
 1484|  2.93k|      }
 1485|  2.93k|    } else {
 1486|       |        // Look for the filters_meta in user filters and run it
 1487|  2.37k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1487:30): [True: 2.29k, False: 85]
  ------------------
 1488|  2.29k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1488:15): [True: 518, False: 1.77k]
  ------------------
 1489|    518|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1489:17): [True: 0, False: 518]
  ------------------
 1490|       |              // Dynamically load filter
 1491|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1491:19): [True: 0, False: 0]
  ------------------
 1492|      0|                BLOSC_TRACE_ERROR("Could not load filter %d.", g_filters[j].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1493|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1494|      0|              }
 1495|      0|            }
 1496|    518|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1496:17): [True: 518, False: 0]
  ------------------
 1497|    518|              blosc2_dparams dparams;
 1498|    518|              blosc2_ctx_get_dparams(context, &dparams);
 1499|    518|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1500|    518|            } else {
 1501|      0|              BLOSC_TRACE_ERROR("Backward function is NULL");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1502|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1503|      0|            }
 1504|    518|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1504:17): [True: 6, False: 512]
  ------------------
 1505|      6|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1506|      6|              return rc;
 1507|      6|            }
 1508|    512|            goto urfiltersuccess;
 1509|    518|          }
 1510|  2.29k|        }
 1511|     85|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|     85|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     85|    do {                                            \
  |  |  |  |   98|     85|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     85|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 85, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     85|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1512|     85|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1513|    512|      urfiltersuccess:;
 1514|    512|    }
 1515|       |
 1516|       |    // Cycle buffers when required
 1517|  3.44k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1517:9): [True: 2.40k, False: 1.03k]
  |  Branch (1517:43): [True: 2.27k, False: 134]
  ------------------
 1518|  2.27k|      _cycle_buffers(&_src, &_dest, &_tmp);
 1519|  2.27k|    }
 1520|  3.44k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1520:9): [True: 764, False: 2.67k]
  ------------------
 1521|    764|      break;
 1522|    764|    }
 1523|  3.44k|  }
 1524|       |
 1525|    764|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1525:7): [True: 764, False: 0]
  |  Branch (1525:38): [True: 260, False: 504]
  ------------------
 1526|    260|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1527|    260|  }
 1528|       |
 1529|       |  /* Postfilter function */
 1530|    764|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1530:7): [True: 0, False: 764]
  ------------------
 1531|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1532|      0|    blosc2_postfilter_params postparams;
 1533|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1534|      0|    postparams.input = _src;
 1535|      0|    postparams.output = dest + offset;
 1536|      0|    postparams.size = bsize;
 1537|      0|    postparams.typesize = typesize;
 1538|      0|    postparams.offset = nblock * context->blocksize;
 1539|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1539:25): [True: 0, False: 0]
  ------------------
 1540|      0|    postparams.nblock = nblock;
 1541|      0|    postparams.tid = thread_context->tid;
 1542|      0|    postparams.ttmp = thread_context->tmp;
 1543|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1544|      0|    postparams.ctx = context;
 1545|       |
 1546|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1546:9): [True: 0, False: 0]
  ------------------
 1547|      0|      BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1548|      0|      return BLOSC2_ERROR_POSTFILTER;
 1549|      0|    }
 1550|      0|  }
 1551|       |
 1552|    764|  return errcode;
 1553|    764|}
free_thread_context:
 2245|  4.45k|void free_thread_context(struct thread_context* thread_context) {
 2246|  4.45k|  destroy_thread_context(thread_context);
 2247|  4.45k|  my_free(thread_context);
 2248|  4.45k|}
check_nthreads:
 2251|  3.91k|int check_nthreads(blosc2_context* context) {
 2252|  3.91k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2252:7): [True: 0, False: 3.91k]
  |  Branch (2252:53): [True: 0, False: 0]
  ------------------
 2253|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2253|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2254|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2255|      0|  }
 2256|  3.91k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2256:7): [True: 0, False: 3.91k]
  ------------------
 2257|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2257|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2258|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2259|      0|  }
 2260|       |
 2261|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2262|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2263|       |   * clear it so the re-attach logic below creates a fresh one. */
 2264|  3.91k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|  7.82k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2264:7): [True: 0, False: 3.91k]
  ------------------
 2265|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2265:7): [True: 0, False: 0]
  ------------------
 2266|      0|    context->thread_pool = NULL;
 2267|      0|    context->threads_started = 0;
 2268|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2269|      0|  }
 2270|       |
 2271|  3.91k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2271:7): [True: 0, False: 3.91k]
  ------------------
 2272|      0|    release_thread_backend(context);
 2273|      0|    context->nthreads = context->new_nthreads;
 2274|      0|  }
 2275|  3.91k|  if (context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2275:7): [True: 0, False: 3.91k]
  |  Branch (2275:32): [True: 0, False: 0]
  ------------------
 2276|      0|    int rc;
 2277|      0|    if (threads_callback) {
  ------------------
  |  Branch (2277:9): [True: 0, False: 0]
  ------------------
 2278|      0|      rc = init_callback_threads(context);
 2279|      0|    }
 2280|      0|    else {
 2281|       |#if defined(_WIN32)
 2282|       |      rc = init_threadpool(context);
 2283|       |#else
 2284|      0|      rc = attach_shared_pool(context);
 2285|      0|#endif
 2286|      0|    }
 2287|      0|    if (rc < 0) {
  ------------------
  |  Branch (2287:9): [True: 0, False: 0]
  ------------------
 2288|      0|      return rc;
 2289|      0|    }
 2290|      0|  }
 2291|  3.91k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2291:7): [True: 3.91k, False: 0]
  ------------------
 2292|  3.91k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  3.91k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2293|  3.91k|  }
 2294|       |
 2295|  3.91k|  return context->nthreads;
 2296|  3.91k|}
build_filters:
 3633|  5.01k|                   const int32_t typesize, uint8_t* filters) {
 3634|       |
 3635|       |  /* Fill the end part of the filter pipeline */
 3636|  5.01k|  if ((doshuffle == BLOSC_SHUFFLE) && (typesize > 1))
  ------------------
  |  Branch (3636:7): [True: 0, False: 5.01k]
  |  Branch (3636:39): [True: 0, False: 0]
  ------------------
 3637|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
 3638|  5.01k|  if (doshuffle == BLOSC_BITSHUFFLE)
  ------------------
  |  Branch (3638:7): [True: 0, False: 5.01k]
  ------------------
 3639|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
 3640|  5.01k|  if (doshuffle == BLOSC_NOSHUFFLE)
  ------------------
  |  Branch (3640:7): [True: 0, False: 5.01k]
  ------------------
 3641|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_NOSHUFFLE;
 3642|  5.01k|  if (delta)
  ------------------
  |  Branch (3642:7): [True: 0, False: 5.01k]
  ------------------
 3643|      0|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
 3644|  5.01k|}
blosc2_decompress_ctx:
 3890|  4.93k|                          void* dest, int32_t destsize) {
 3891|  4.93k|  int result;
 3892|       |
 3893|  4.93k|  if (context->do_compress != 0) {
  ------------------
  |  Branch (3893:7): [True: 0, False: 4.93k]
  ------------------
 3894|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3895|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3896|      0|  }
 3897|       |
 3898|  4.93k|  result = blosc_run_decompression_with_context(context, src, srcsize, dest, destsize);
 3899|       |
 3900|       |  // Reset a possible block_maskout
 3901|  4.93k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (3901:7): [True: 0, False: 4.93k]
  ------------------
 3902|      0|    free(context->block_maskout);
 3903|      0|    context->block_maskout = NULL;
 3904|      0|  }
 3905|  4.93k|  context->block_maskout_nitems = 0;
 3906|       |
 3907|  4.93k|  return result;
 3908|  4.93k|}
_blosc_getitem:
 4212|    789|                   int start, int nitems, void* dest, int32_t destsize) {
 4213|    789|  uint8_t* _src = (uint8_t*)(src);  /* current pos for source buffer */
 4214|    789|  uint8_t* _dest = (uint8_t*)(dest);
 4215|    789|  int32_t ntbytes = 0;              /* the number of uncompressed bytes */
 4216|    789|  int32_t bsize, bsize2, ebsize, leftoverblock;
 4217|    789|  int32_t startb, stopb;
 4218|    789|  int32_t stop;
 4219|    789|  int32_t nitems_bytes;
 4220|    789|  int64_t start64 = (int64_t)start;
 4221|    789|  int64_t nitems64 = (int64_t)nitems;
 4222|    789|  int64_t typesize64 = (int64_t)header->typesize;
 4223|    789|  int64_t stop64;
 4224|    789|  int64_t nitems_bytes64;
 4225|    789|  int64_t start_bytes64;
 4226|    789|  int64_t stop_bytes64;
 4227|    789|  int j, rc;
 4228|       |
 4229|    789|  if (nitems == 0) {
  ------------------
  |  Branch (4229:7): [True: 0, False: 789]
  ------------------
 4230|       |    // We have nothing to do
 4231|      0|    return 0;
 4232|      0|  }
 4233|    789|  if (nitems < 0) {
  ------------------
  |  Branch (4233:7): [True: 0, False: 789]
  ------------------
 4234|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4235|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4236|      0|  }
 4237|       |
 4238|    789|  nitems_bytes64 = nitems64 * typesize64;
 4239|    789|  if (nitems_bytes64 < 0 || nitems_bytes64 > INT32_MAX || nitems_bytes64 > destsize) {
  ------------------
  |  Branch (4239:7): [True: 0, False: 789]
  |  Branch (4239:29): [True: 0, False: 789]
  |  Branch (4239:59): [True: 1, False: 788]
  ------------------
 4240|      1|    BLOSC_TRACE_ERROR("`nitems`*`typesize` out of dest 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4241|      1|    return BLOSC2_ERROR_WRITE_BUFFER;
 4242|      1|  }
 4243|    788|  nitems_bytes = (int32_t)nitems_bytes64;
 4244|       |
 4245|    788|  int32_t* bstarts = (int32_t*)(_src + context->header_overhead);
 4246|       |
 4247|       |  /* Check region boundaries */
 4248|    788|  start_bytes64 = start64 * typesize64;
 4249|    788|  if ((start < 0) || (start_bytes64 < 0) || (start_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4249:7): [True: 0, False: 788]
  |  Branch (4249:22): [True: 0, False: 788]
  |  Branch (4249:45): [True: 0, False: 788]
  ------------------
 4250|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4251|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4252|      0|  }
 4253|       |
 4254|    788|  stop64 = start64 + nitems64;
 4255|    788|  if ((stop64 < 0) || (stop64 > INT32_MAX)) {
  ------------------
  |  Branch (4255:7): [True: 0, False: 788]
  |  Branch (4255:23): [True: 0, False: 788]
  ------------------
 4256|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4257|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4258|      0|  }
 4259|    788|  stop = (int32_t)stop64;
 4260|       |
 4261|    788|  stop_bytes64 = stop64 * typesize64;
 4262|    788|  if ((stop_bytes64 < 0) || (stop_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4262:7): [True: 0, False: 788]
  |  Branch (4262:29): [True: 0, False: 788]
  ------------------
 4263|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4264|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4265|      0|  }
 4266|       |
 4267|    788|  bool chunk_memcpyed = (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0;
 4268|    788|  if (!context->special_type && !chunk_memcpyed &&
  ------------------
  |  Branch (4268:7): [True: 741, False: 47]
  |  Branch (4268:33): [True: 175, False: 566]
  ------------------
 4269|    175|      ((uint8_t *)(_src + srcsize) < (uint8_t *)(bstarts + context->nblocks))) {
  ------------------
  |  Branch (4269:7): [True: 0, False: 175]
  ------------------
 4270|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4271|      0|    return BLOSC2_ERROR_READ_BUFFER;
 4272|      0|  }
 4273|       |
 4274|    788|  bool memcpyed = header->flags & (uint8_t)BLOSC_MEMCPYED;
 4275|    788|  if (context->special_type) {
  ------------------
  |  Branch (4275:7): [True: 47, False: 741]
  ------------------
 4276|       |    // Fake a runlen as if its a memcpyed chunk
 4277|     47|    memcpyed = true;
 4278|     47|  }
 4279|       |
 4280|    788|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (4280:19): [True: 788, False: 0]
  ------------------
 4281|    788|                  (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (4281:19): [True: 8, False: 780]
  |  Branch (4281:54): [True: 0, False: 8]
  ------------------
 4282|    788|  if (memcpyed && !is_lazy && !context->postfilter) {
  ------------------
  |  Branch (4282:7): [True: 613, False: 175]
  |  Branch (4282:19): [True: 613, False: 0]
  |  Branch (4282:31): [True: 613, False: 0]
  ------------------
 4283|       |    // Short-circuit for (non-lazy) memcpyed or special values
 4284|    613|    ntbytes = nitems_bytes;
 4285|    613|    switch (context->special_type) {
 4286|     27|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (4286:7): [True: 27, False: 586]
  ------------------
 4287|       |        // All repeated values
 4288|     27|        rc = set_values(context->typesize, _src, _dest, ntbytes);
 4289|     27|        if (rc < 0) {
  ------------------
  |  Branch (4289:13): [True: 0, False: 27]
  ------------------
 4290|      0|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4291|      0|          return BLOSC2_ERROR_DATA;
 4292|      0|        }
 4293|     27|        break;
 4294|     27|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (4294:7): [True: 1, False: 612]
  ------------------
 4295|      1|        rc = set_nans(context->typesize, _dest, ntbytes);
 4296|      1|        if (rc < 0) {
  ------------------
  |  Branch (4296:13): [True: 0, False: 1]
  ------------------
 4297|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4298|      0|          return BLOSC2_ERROR_DATA;
 4299|      0|        }
 4300|      1|        break;
 4301|     18|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (4301:7): [True: 18, False: 595]
  ------------------
 4302|     18|        memset(_dest, 0, ntbytes);
 4303|     18|        break;
 4304|      1|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (4304:7): [True: 1, False: 612]
  ------------------
 4305|       |        // We do nothing here
 4306|      1|        break;
 4307|    566|      case BLOSC2_NO_SPECIAL:
  ------------------
  |  Branch (4307:7): [True: 566, False: 47]
  ------------------
 4308|    566|        {
 4309|    566|          int64_t src_offset64 = (int64_t)context->header_overhead + start_bytes64;
 4310|    566|          int64_t src_stop64 = src_offset64 + nitems_bytes64;
 4311|    566|          if ((src_offset64 < 0) || (src_stop64 < src_offset64) || (src_stop64 > srcsize)) {
  ------------------
  |  Branch (4311:15): [True: 0, False: 566]
  |  Branch (4311:37): [True: 0, False: 566]
  |  Branch (4311:68): [True: 0, False: 566]
  ------------------
 4312|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4313|      0|            return BLOSC2_ERROR_READ_BUFFER;
 4314|      0|          }
 4315|    566|          _src += (int32_t)src_offset64;
 4316|    566|        }
 4317|      0|        memcpy(_dest, _src, ntbytes);
 4318|    566|        break;
 4319|      0|      default:
  ------------------
  |  Branch (4319:7): [True: 0, False: 613]
  ------------------
 4320|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4321|      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]
  |  |  ------------------
  ------------------
 4322|    613|    }
 4323|    613|    return ntbytes;
 4324|    613|  }
 4325|       |
 4326|    175|  ebsize = header->blocksize + header->typesize * (signed)sizeof(int32_t);
 4327|    175|  struct thread_context* scontext = context->serial_context;
 4328|       |  /* Resize the temporaries in serial context if needed */
 4329|    175|  if (header->blocksize > scontext->tmp_blocksize) {
  ------------------
  |  Branch (4329:7): [True: 0, False: 175]
  ------------------
 4330|      0|    my_free(scontext->tmp);
 4331|      0|    scontext->tmp_nbytes = (size_t)4 * ebsize;
 4332|      0|    scontext->tmp = my_malloc(scontext->tmp_nbytes);
 4333|      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]
  |  |  ------------------
  ------------------
 4334|      0|    scontext->tmp2 = scontext->tmp + ebsize;
 4335|      0|    scontext->tmp3 = scontext->tmp2 + ebsize;
 4336|      0|    scontext->tmp4 = scontext->tmp3 + ebsize;
 4337|      0|    scontext->tmp_blocksize = (int32_t)header->blocksize;
 4338|      0|  }
 4339|       |
 4340|    350|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (4340:15): [True: 288, False: 62]
  ------------------
 4341|    288|    bsize = header->blocksize;
 4342|    288|    leftoverblock = 0;
 4343|    288|    if ((j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (4343:9): [True: 175, False: 113]
  |  Branch (4343:40): [True: 113, False: 62]
  ------------------
 4344|    113|      bsize = context->leftover;
 4345|    113|      leftoverblock = 1;
 4346|    113|    }
 4347|       |
 4348|       |    /* Compute start & stop for each block */
 4349|    288|    startb = start * header->typesize - j * header->blocksize;
 4350|    288|    stopb = stop * header->typesize - j * header->blocksize;
 4351|    288|    if (stopb <= 0) {
  ------------------
  |  Branch (4351:9): [True: 113, False: 175]
  ------------------
 4352|       |      // We can exit as soon as this block is beyond stop
 4353|    113|      break;
 4354|    113|    }
 4355|    175|    if (startb >= header->blocksize) {
  ------------------
  |  Branch (4355:9): [True: 0, False: 175]
  ------------------
 4356|      0|      continue;
 4357|      0|    }
 4358|    175|    if (startb < 0) {
  ------------------
  |  Branch (4358:9): [True: 0, False: 175]
  ------------------
 4359|      0|      startb = 0;
 4360|      0|    }
 4361|    175|    if (stopb > header->blocksize) {
  ------------------
  |  Branch (4361:9): [True: 0, False: 175]
  ------------------
 4362|      0|      stopb = header->blocksize;
 4363|      0|    }
 4364|    175|    bsize2 = stopb - startb;
 4365|       |
 4366|    175|#if defined(HAVE_ZFP)
 4367|    175|    if (context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) {
  ------------------
  |  Branch (4367:9): [True: 14, False: 161]
  ------------------
 4368|     14|      scontext->zfp_cell_start = startb / context->typesize;
 4369|     14|      scontext->zfp_cell_nitems = nitems;
 4370|     14|    }
 4371|    175|#endif /* HAVE_ZFP */
 4372|       |
 4373|       |    /* Do the actual data copy */
 4374|       |    // Regular decompression.  Put results in tmp2.
 4375|       |    // If the block is aligned and the worst case fits in destination, let's avoid a copy
 4376|    175|    bool get_single_block = ((startb == 0) && (bsize == nitems_bytes));
  ------------------
  |  Branch (4376:30): [True: 175, False: 0]
  |  Branch (4376:47): [True: 0, False: 175]
  ------------------
 4377|    175|    uint8_t* tmp2 = get_single_block ? dest : scontext->tmp2;
  ------------------
  |  Branch (4377:21): [True: 0, False: 175]
  ------------------
 4378|       |
 4379|       |    // If memcpyed we don't have a bstarts section (because it is not needed)
 4380|    175|    int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (4380:26): [True: 0, False: 175]
  ------------------
 4381|    175|      context->header_overhead + j * header->blocksize : sw32_(bstarts + j);
 4382|       |
 4383|    175|    int32_t cbytes = blosc_d(context->serial_context, bsize, leftoverblock, memcpyed,
 4384|    175|                             src, srcsize, src_offset, j,
 4385|    175|                             tmp2, 0, scontext->tmp, scontext->tmp3);
 4386|    175|    if (cbytes < 0) {
  ------------------
  |  Branch (4386:9): [True: 0, False: 175]
  ------------------
 4387|      0|      ntbytes = cbytes;
 4388|      0|      break;
 4389|      0|    }
 4390|    175|    if (scontext->zfp_cell_nitems > 0) {
  ------------------
  |  Branch (4390:9): [True: 14, False: 161]
  ------------------
 4391|     14|      if (cbytes == bsize2) {
  ------------------
  |  Branch (4391:11): [True: 0, False: 14]
  ------------------
 4392|      0|        memcpy((uint8_t *) dest, tmp2, (unsigned int) bsize2);
 4393|     14|      } else if (cbytes == context->blocksize) {
  ------------------
  |  Branch (4393:18): [True: 14, False: 0]
  ------------------
 4394|     14|        memcpy((uint8_t *) dest, tmp2 + scontext->zfp_cell_start * context->typesize, (unsigned int) bsize2);
 4395|     14|        cbytes = bsize2;
 4396|     14|      }
 4397|    161|    } else if (!get_single_block) {
  ------------------
  |  Branch (4397:16): [True: 161, False: 0]
  ------------------
 4398|       |      /* Copy to destination */
 4399|    161|      memcpy((uint8_t *) dest + ntbytes, tmp2 + startb, (unsigned int) bsize2);
 4400|    161|    }
 4401|    175|    ntbytes += bsize2;
 4402|    175|  }
 4403|       |
 4404|    175|  scontext->zfp_cell_nitems = 0;
 4405|       |
 4406|    175|  return ntbytes;
 4407|    175|}
blosc2_getitem:
 4409|    789|int blosc2_getitem(const void* src, int32_t srcsize, int start, int nitems, void* dest, int32_t destsize) {
 4410|    789|  blosc2_context context;
 4411|    789|  int result;
 4412|       |
 4413|       |  /* Minimally populate the context */
 4414|    789|  memset(&context, 0, sizeof(blosc2_context));
 4415|       |
 4416|    789|  context.schunk = g_schunk;
 4417|    789|  context.nthreads = 1;  // force a serial decompression; fixes #95
 4418|       |
 4419|       |  /* Call the actual getitem function */
 4420|    789|  result = blosc2_getitem_ctx(&context, src, srcsize, start, nitems, dest, destsize);
 4421|       |
 4422|       |  /* Release resources */
 4423|    789|  if (context.serial_context != NULL) {
  ------------------
  |  Branch (4423:7): [True: 789, False: 0]
  ------------------
 4424|    789|    free_thread_context(context.serial_context);
 4425|    789|  }
 4426|    789|  return result;
 4427|    789|}
blosc2_getitem_ctx:
 4436|    789|    int start, int nitems, void* dest, int32_t destsize) {
 4437|    789|  blosc_header header;
 4438|    789|  int result;
 4439|       |
 4440|       |  /* Minimally populate the context */
 4441|    789|  result = read_chunk_header((uint8_t *) src, srcsize, true, &header);
 4442|    789|  if (result < 0) {
  ------------------
  |  Branch (4442:7): [True: 0, False: 789]
  ------------------
 4443|      0|    return result;
 4444|      0|  }
 4445|    789|  if (header.blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (4445:7): [True: 0, False: 789]
  ------------------
 4446|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4447|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4448|      0|  }
 4449|       |
 4450|    789|  context->src = src;
 4451|    789|  context->srcsize = srcsize;
 4452|    789|  context->dest = dest;
 4453|    789|  context->destsize = destsize;
 4454|       |
 4455|    789|  result = blosc2_initialize_context_from_header(context, &header);
 4456|    789|  if (result < 0) {
  ------------------
  |  Branch (4456:7): [True: 0, False: 789]
  ------------------
 4457|      0|    return result;
 4458|      0|  }
 4459|       |
 4460|    789|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (4460:7): [True: 789, False: 0]
  ------------------
 4461|    789|    context->serial_context = create_thread_context(context, 0);
 4462|    789|  }
 4463|    789|  BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|    789|    do {                                            \
  |  |  105|    789|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 789]
  |  |  ------------------
  |  |  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|    789|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 789]
  |  |  ------------------
  ------------------
 4464|       |  /* Call the actual getitem function */
 4465|    789|  result = _blosc_getitem(context, &header, src, srcsize, start, nitems, dest, destsize);
 4466|       |
 4467|    789|  return result;
 4468|    789|}
blosc2_get_nthreads:
 5344|  9.47k|{
 5345|  9.47k|  int16_t nthreads;
 5346|  9.47k|  if (!g_initlib) {
  ------------------
  |  Branch (5346:7): [True: 0, False: 9.47k]
  ------------------
 5347|      0|    blosc2_init();
 5348|      0|  }
 5349|  9.47k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  9.47k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5350|  9.47k|  nthreads = g_nthreads;
 5351|  9.47k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  9.47k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5352|  9.47k|  return nthreads;
 5353|  9.47k|}
blosc2_set_nthreads:
 5355|  7.77k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5356|  7.77k|  int16_t ret;          /* the previous number of threads */
 5357|       |
 5358|       |  /* Check whether the library should be initialized */
 5359|  7.77k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5359:7): [True: 0, False: 7.77k]
  ------------------
 5360|       |
 5361|  7.77k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  7.77k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5362|  7.77k|  ret = g_nthreads;
 5363|  7.77k|  if (nthreads != ret) {
  ------------------
  |  Branch (5363:7): [True: 0, False: 7.77k]
  ------------------
 5364|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5365|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5366|      0|    g_nthreads = nthreads;
 5367|      0|    g_global_context->new_nthreads = nthreads;
 5368|      0|    int16_t ret2 = check_nthreads(g_global_context);
 5369|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5369:9): [True: 0, False: 0]
  ------------------
 5370|      0|      g_nthreads = ret;
 5371|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5372|      0|      g_global_context->nthreads = old_nthreads;
 5373|      0|      check_nthreads(g_global_context);
 5374|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5375|      0|      return ret2;
 5376|      0|    }
 5377|      0|  }
 5378|  7.77k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  7.77k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5379|       |
 5380|  7.77k|  return ret;
 5381|  7.77k|}
blosc2_cbuffer_sizes:
 5533|   227k|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 5534|   227k|  blosc_header header;
 5535|   227k|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 5536|   227k|  if (rc < 0) {
  ------------------
  |  Branch (5536:7): [True: 40, False: 226k]
  ------------------
 5537|       |    /* Return zeros if error reading header */
 5538|     40|    memset(&header, 0, sizeof(header));
 5539|     40|  }
 5540|       |
 5541|       |  /* Read the interesting values */
 5542|   227k|  if (nbytes != NULL)
  ------------------
  |  Branch (5542:7): [True: 226k, False: 360]
  ------------------
 5543|   226k|    *nbytes = header.nbytes;
 5544|   227k|  if (cbytes != NULL)
  ------------------
  |  Branch (5544:7): [True: 227k, False: 0]
  ------------------
 5545|   227k|    *cbytes = header.cbytes;
 5546|   227k|  if (blocksize != NULL)
  ------------------
  |  Branch (5546:7): [True: 5.44k, False: 221k]
  ------------------
 5547|  5.44k|    *blocksize = header.blocksize;
 5548|   227k|  return rc;
 5549|   227k|}
blosc2_init:
 5684|  7.77k|void blosc2_init(void) {
 5685|       |  /* Return if Blosc is already initialized */
 5686|  7.77k|  if (g_initlib) return;
  ------------------
  |  Branch (5686:7): [True: 0, False: 7.77k]
  ------------------
 5687|       |
 5688|  7.77k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 5689|  7.77k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 5690|  7.77k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 5691|  7.77k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 5692|  7.77k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 5693|  7.77k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 5694|  7.77k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 5695|  7.77k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 5696|  7.77k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 5697|  7.77k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 5698|       |
 5699|  7.77k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 5700|       |
 5701|  7.77k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 5702|  7.77k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 5703|  7.77k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 5704|  7.77k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 5705|  7.77k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 5706|  7.77k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 5707|  7.77k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 5708|  7.77k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 5709|  7.77k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 5710|  7.77k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 5711|       |
 5712|  7.77k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 5713|       |
 5714|  7.77k|  g_ncodecs = 0;
 5715|  7.77k|  g_nfilters = 0;
 5716|  7.77k|  g_ntuners = 0;
 5717|       |
 5718|  7.77k|#if defined(HAVE_PLUGINS)
 5719|  7.77k|  #include "blosc2/blosc2-common.h"
 5720|  7.77k|  #include "blosc2/blosc2-stdio.h"
 5721|  7.77k|  register_codecs();
 5722|  7.77k|  register_filters();
 5723|  7.77k|  register_tuners();
 5724|  7.77k|#endif
 5725|  7.77k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  7.77k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5726|  7.77k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  7.77k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5727|       |  /* Create a global context */
 5728|  7.77k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5729|  7.77k|  memset(g_global_context, 0, sizeof(blosc2_context));
 5730|  7.77k|  g_global_context->nthreads = g_nthreads;
 5731|  7.77k|  g_global_context->new_nthreads = g_nthreads;
 5732|  7.77k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  7.77k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5733|  7.77k|  g_initlib = 1;
 5734|  7.77k|}
blosc2_free_resources:
 5737|  7.77k|int blosc2_free_resources(void) {
 5738|       |  /* Return if Blosc is not initialized */
 5739|  7.77k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (5739:7): [True: 0, False: 7.77k]
  ------------------
 5740|       |
 5741|  7.77k|  return release_thread_backend(g_global_context);
 5742|  7.77k|}
blosc2_destroy:
 5745|  7.77k|void blosc2_destroy(void) {
 5746|       |  /* Return if Blosc is not initialized */
 5747|  7.77k|  if (!g_initlib) return;
  ------------------
  |  Branch (5747:7): [True: 0, False: 7.77k]
  ------------------
 5748|       |
 5749|  7.77k|  blosc2_free_resources();
 5750|  7.77k|  g_initlib = 0;
 5751|  7.77k|  blosc2_free_ctx(g_global_context);
 5752|       |
 5753|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 5754|       |   * Do this before freeing the pools so that release_thread_backend callers
 5755|       |   * that race with us will take the "skip" path rather than locking the
 5756|       |   * soon-to-be-destroyed pool_registry_mutex. */
 5757|  7.77k|  g_destroy_count++;
 5758|       |
 5759|       |  /* Tear down any remaining shared pools */
 5760|  7.77k|  struct blosc_shared_pool *pool = shared_pools;
 5761|  7.77k|  while (pool != NULL) {
  ------------------
  |  Branch (5761:10): [True: 0, False: 7.77k]
  ------------------
 5762|      0|    struct blosc_shared_pool *next = pool->next;
 5763|      0|    destroy_shared_pool(pool);
 5764|      0|    pool = next;
 5765|      0|  }
 5766|  7.77k|  shared_pools = NULL;
 5767|  7.77k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  7.77k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5768|       |
 5769|  7.77k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  7.77k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5770|  7.77k|}
blosc2_create_cctx:
 5776|  5.02k|blosc2_context* blosc2_create_cctx(blosc2_cparams cparams) {
 5777|  5.02k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5778|  5.02k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  5.02k|    do {                                            \
  |  |  105|  5.02k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 5.02k]
  |  |  ------------------
  |  |  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|  5.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 5.02k]
  |  |  ------------------
  ------------------
 5779|       |
 5780|       |  /* Populate the context, using zeros as default values */
 5781|  5.02k|  memset(context, 0, sizeof(blosc2_context));
 5782|  5.02k|  context->do_compress = 1;   /* meant for compression */
 5783|  5.02k|  context->use_dict = cparams.use_dict;
 5784|  5.02k|  if (cparams.instr_codec) {
  ------------------
  |  Branch (5784:7): [True: 0, False: 5.02k]
  ------------------
 5785|      0|    context->blosc2_flags = BLOSC2_INSTR_CODEC;
 5786|      0|  }
 5787|       |
 5788|  35.1k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (5788:19): [True: 30.1k, False: 5.01k]
  ------------------
 5789|  30.1k|    context->filters[i] = cparams.filters[i];
 5790|  30.1k|    context->filters_meta[i] = cparams.filters_meta[i];
 5791|       |
 5792|  30.1k|    if (context->filters[i] >= BLOSC_LAST_FILTER && context->filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (5792:9): [True: 2.16k, False: 27.9k]
  |  Branch (5792:53): [True: 3, False: 2.16k]
  ------------------
 5793|      3|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5794|      3|                        context->filters[i]);
 5795|      3|      free(context);
 5796|      3|      return NULL;
 5797|      3|    }
 5798|  30.1k|    if (context->filters[i] > BLOSC_LAST_REGISTERED_FILTER && context->filters[i] <= BLOSC2_GLOBAL_REGISTERED_FILTERS_STOP) {
  ------------------
  |  Branch (5798:9): [True: 1.62k, False: 28.4k]
  |  Branch (5798:63): [True: 8, False: 1.61k]
  ------------------
 5799|      8|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5800|      8|                        context->filters[i]);
 5801|      8|      free(context);
 5802|      8|      return NULL;
 5803|      8|    }
 5804|  30.1k|  }
 5805|       |
 5806|  5.01k|#if defined(HAVE_ZFP)
 5807|  5.01k|#include "blosc2/codecs-registry.h"
 5808|  5.01k|  if ((context->compcode >= BLOSC_CODEC_ZFP_FIXED_ACCURACY) && (context->compcode <= BLOSC_CODEC_ZFP_FIXED_RATE)) {
  ------------------
  |  Branch (5808:7): [True: 0, False: 5.01k]
  |  Branch (5808:64): [True: 0, False: 0]
  ------------------
 5809|      0|    for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) {
  ------------------
  |  Branch (5809:21): [True: 0, False: 0]
  ------------------
 5810|      0|      if ((context->filters[i] == BLOSC_SHUFFLE) || (context->filters[i] == BLOSC_BITSHUFFLE)) {
  ------------------
  |  Branch (5810:11): [True: 0, False: 0]
  |  Branch (5810:53): [True: 0, False: 0]
  ------------------
 5811|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5812|      0|        return NULL;
 5813|      0|      }
 5814|      0|    }
 5815|      0|  }
 5816|  5.01k|#endif /* HAVE_ZFP */
 5817|       |
 5818|       |  /* Check for a BLOSC_SHUFFLE environment variable */
 5819|  5.01k|  int doshuffle = -1;
 5820|  5.01k|  char* envvar = getenv("BLOSC_SHUFFLE");
 5821|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5821:7): [True: 0, False: 5.01k]
  ------------------
 5822|      0|    if (strcmp(envvar, "NOSHUFFLE") == 0) {
  ------------------
  |  Branch (5822:9): [True: 0, False: 0]
  ------------------
 5823|      0|      doshuffle = BLOSC_NOSHUFFLE;
 5824|      0|    }
 5825|      0|    else if (strcmp(envvar, "SHUFFLE") == 0) {
  ------------------
  |  Branch (5825:14): [True: 0, False: 0]
  ------------------
 5826|      0|      doshuffle = BLOSC_SHUFFLE;
 5827|      0|    }
 5828|      0|    else if (strcmp(envvar, "BITSHUFFLE") == 0) {
  ------------------
  |  Branch (5828:14): [True: 0, False: 0]
  ------------------
 5829|      0|      doshuffle = BLOSC_BITSHUFFLE;
 5830|      0|    }
 5831|      0|    else {
 5832|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5833|      0|    }
 5834|      0|  }
 5835|       |  /* Check for a BLOSC_DELTA environment variable */
 5836|  5.01k|  int dodelta = BLOSC_NOFILTER;
 5837|  5.01k|  envvar = getenv("BLOSC_DELTA");
 5838|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5838:7): [True: 0, False: 5.01k]
  ------------------
 5839|      0|    if (strcmp(envvar, "1") == 0) {
  ------------------
  |  Branch (5839:9): [True: 0, False: 0]
  ------------------
 5840|      0|      dodelta = BLOSC_DELTA;
 5841|      0|    } else if (strcmp(envvar, "0") == 0){
  ------------------
  |  Branch (5841:16): [True: 0, False: 0]
  ------------------
 5842|      0|      dodelta = BLOSC_NOFILTER;
 5843|      0|    }
 5844|      0|    else {
 5845|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5846|      0|    }
 5847|      0|  }
 5848|       |  /* Check for a BLOSC_TYPESIZE environment variable */
 5849|  5.01k|  context->typesize = cparams.typesize;
 5850|  5.01k|  envvar = getenv("BLOSC_TYPESIZE");
 5851|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5851:7): [True: 0, False: 5.01k]
  ------------------
 5852|      0|    int32_t value;
 5853|      0|    errno = 0; /* To distinguish success/failure after call */
 5854|      0|    value = (int32_t) strtol(envvar, NULL, 10);
 5855|      0|    if ((errno != EINVAL) && (value > 0)) {
  ------------------
  |  Branch (5855:9): [True: 0, False: 0]
  |  Branch (5855:30): [True: 0, False: 0]
  ------------------
 5856|      0|      context->typesize = value;
 5857|      0|    }
 5858|      0|    else {
 5859|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5860|      0|    }
 5861|      0|  }
 5862|  5.01k|  build_filters(doshuffle, dodelta, context->typesize, context->filters);
 5863|       |
 5864|  5.01k|  context->clevel = cparams.clevel;
 5865|       |  /* Check for a BLOSC_CLEVEL environment variable */
 5866|  5.01k|  envvar = getenv("BLOSC_CLEVEL");
 5867|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5867:7): [True: 0, False: 5.01k]
  ------------------
 5868|      0|    int value;
 5869|      0|    errno = 0; /* To distinguish success/failure after call */
 5870|      0|    value = (int)strtol(envvar, NULL, 10);
 5871|      0|    if ((errno != EINVAL) && (value >= 0)) {
  ------------------
  |  Branch (5871:9): [True: 0, False: 0]
  |  Branch (5871:30): [True: 0, False: 0]
  ------------------
 5872|      0|      context->clevel = value;
 5873|      0|    }
 5874|      0|    else {
 5875|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5876|      0|    }
 5877|      0|  }
 5878|       |
 5879|  5.01k|  context->compcode = cparams.compcode;
 5880|       |  /* Check for a BLOSC_COMPRESSOR environment variable */
 5881|  5.01k|  envvar = getenv("BLOSC_COMPRESSOR");
 5882|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5882:7): [True: 0, False: 5.01k]
  ------------------
 5883|      0|    int codec = blosc2_compname_to_compcode(envvar);
 5884|      0|    if (codec >= BLOSC_LAST_CODEC) {
  ------------------
  |  Branch (5884:9): [True: 0, False: 0]
  ------------------
 5885|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5886|      0|      return NULL;
 5887|      0|    }
 5888|      0|    context->compcode = codec;
 5889|      0|  }
 5890|  5.01k|  context->compcode_meta = cparams.compcode_meta;
 5891|       |
 5892|  5.01k|  context->blocksize = cparams.blocksize;
 5893|       |  /* Check for a BLOSC_BLOCKSIZE environment variable */
 5894|  5.01k|  envvar = getenv("BLOSC_BLOCKSIZE");
 5895|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5895:7): [True: 0, False: 5.01k]
  ------------------
 5896|      0|    int32_t blocksize;
 5897|      0|    errno = 0; /* To distinguish success/failure after call */
 5898|      0|    blocksize = (int32_t) strtol(envvar, NULL, 10);
 5899|      0|    if ((errno != EINVAL) && (blocksize > 0)) {
  ------------------
  |  Branch (5899:9): [True: 0, False: 0]
  |  Branch (5899:30): [True: 0, False: 0]
  ------------------
 5900|      0|      context->blocksize = blocksize;
 5901|      0|    }
 5902|      0|    else {
 5903|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5904|      0|    }
 5905|      0|  }
 5906|       |
 5907|  5.01k|  context->nthreads = cparams.nthreads;
 5908|       |  /* Check for a BLOSC_NTHREADS environment variable */
 5909|  5.01k|  envvar = getenv("BLOSC_NTHREADS");
 5910|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5910:7): [True: 0, False: 5.01k]
  ------------------
 5911|      0|    errno = 0; /* To distinguish success/failure after call */
 5912|      0|    int16_t nthreads = (int16_t) strtol(envvar, NULL, 10);
 5913|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (5913:9): [True: 0, False: 0]
  |  Branch (5913:30): [True: 0, False: 0]
  ------------------
 5914|      0|      context->nthreads = nthreads;
 5915|      0|    }
 5916|      0|    else {
 5917|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5918|      0|    }
 5919|      0|  }
 5920|  5.01k|  context->new_nthreads = context->nthreads;
 5921|       |
 5922|  5.01k|  context->splitmode = cparams.splitmode;
 5923|       |  /* Check for a BLOSC_SPLITMODE environment variable */
 5924|  5.01k|  envvar = getenv("BLOSC_SPLITMODE");
 5925|  5.01k|  if (envvar != NULL) {
  ------------------
  |  Branch (5925:7): [True: 0, False: 5.01k]
  ------------------
 5926|      0|    int32_t splitmode = -1;
 5927|      0|    if (strcmp(envvar, "ALWAYS") == 0) {
  ------------------
  |  Branch (5927:9): [True: 0, False: 0]
  ------------------
 5928|      0|      splitmode = BLOSC_ALWAYS_SPLIT;
 5929|      0|    }
 5930|      0|    else if (strcmp(envvar, "NEVER") == 0) {
  ------------------
  |  Branch (5930:14): [True: 0, False: 0]
  ------------------
 5931|      0|      splitmode = BLOSC_NEVER_SPLIT;
 5932|      0|    }
 5933|      0|    else if (strcmp(envvar, "AUTO") == 0) {
  ------------------
  |  Branch (5933:14): [True: 0, False: 0]
  ------------------
 5934|      0|      splitmode = BLOSC_AUTO_SPLIT;
 5935|      0|    }
 5936|      0|    else if (strcmp(envvar, "FORWARD_COMPAT") == 0) {
  ------------------
  |  Branch (5936:14): [True: 0, False: 0]
  ------------------
 5937|      0|      splitmode = BLOSC_FORWARD_COMPAT_SPLIT;
 5938|      0|    }
 5939|      0|    else {
 5940|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5941|      0|    }
 5942|      0|    if (splitmode >= 0) {
  ------------------
  |  Branch (5942:9): [True: 0, False: 0]
  ------------------
 5943|      0|      context->splitmode = splitmode;
 5944|      0|    }
 5945|      0|  }
 5946|       |
 5947|  5.01k|  context->threads_started = 0;
 5948|  5.01k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  5.01k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5949|  5.01k|  context->schunk = cparams.schunk;
 5950|       |
 5951|  5.01k|  if (cparams.prefilter != NULL) {
  ------------------
  |  Branch (5951:7): [True: 0, False: 5.01k]
  ------------------
 5952|      0|    context->prefilter = cparams.prefilter;
 5953|      0|    context->preparams = (blosc2_prefilter_params*)my_malloc(sizeof(blosc2_prefilter_params));
 5954|      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]
  |  |  ------------------
  ------------------
 5955|      0|    memcpy(context->preparams, cparams.preparams, sizeof(blosc2_prefilter_params));
 5956|      0|  }
 5957|       |
 5958|  5.01k|  if (cparams.tuner_id <= 0) {
  ------------------
  |  Branch (5958:7): [True: 5.01k, False: 0]
  ------------------
 5959|  5.01k|    cparams.tuner_id = g_tuner;
 5960|  5.01k|  } else {
 5961|      0|    for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (5961:21): [True: 0, False: 0]
  ------------------
 5962|      0|      if (g_tuners[i].id == cparams.tuner_id) {
  ------------------
  |  Branch (5962:11): [True: 0, False: 0]
  ------------------
 5963|      0|        if (g_tuners[i].init == NULL) {
  ------------------
  |  Branch (5963:13): [True: 0, False: 0]
  ------------------
 5964|      0|          if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (5964:15): [True: 0, False: 0]
  ------------------
 5965|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5966|      0|            return NULL;
 5967|      0|          }
 5968|      0|        }
 5969|      0|        if (g_tuners[i].init(cparams.tuner_params, context, NULL) < 0) {
  ------------------
  |  Branch (5969:13): [True: 0, False: 0]
  ------------------
 5970|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5971|      0|          return NULL;
 5972|      0|        }
 5973|      0|        goto urtunersuccess;
 5974|      0|      }
 5975|      0|    }
 5976|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5977|      0|    return NULL;
 5978|      0|  }
 5979|  5.01k|  urtunersuccess:;
 5980|       |
 5981|  5.01k|  context->tuner_id = cparams.tuner_id;
 5982|       |
 5983|  5.01k|  context->codec_params = cparams.codec_params;
 5984|  5.01k|  memcpy(context->filter_params, cparams.filter_params, BLOSC2_MAX_FILTERS * sizeof(void*));
 5985|       |
 5986|  5.01k|  return context;
 5987|  5.01k|}
blosc2_create_dctx:
 5990|  9.28k|blosc2_context* blosc2_create_dctx(blosc2_dparams dparams) {
 5991|  9.28k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5992|  9.28k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  9.28k|    do {                                            \
  |  |  105|  9.28k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 9.28k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  9.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 9.28k]
  |  |  ------------------
  ------------------
 5993|       |
 5994|       |  /* Populate the context, using zeros as default values */
 5995|  9.28k|  memset(context, 0, sizeof(blosc2_context));
 5996|  9.28k|  context->do_compress = 0;   /* Meant for decompression */
 5997|       |
 5998|  9.28k|  context->nthreads = dparams.nthreads;
 5999|  9.28k|  char* envvar = getenv("BLOSC_NTHREADS");
 6000|  9.28k|  if (envvar != NULL) {
  ------------------
  |  Branch (6000:7): [True: 0, False: 9.28k]
  ------------------
 6001|      0|    errno = 0; /* To distinguish success/failure after call */
 6002|      0|    long nthreads = strtol(envvar, NULL, 10);
 6003|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (6003:9): [True: 0, False: 0]
  |  Branch (6003:30): [True: 0, False: 0]
  ------------------
 6004|      0|      context->nthreads = (int16_t) nthreads;
 6005|      0|    }
 6006|      0|  }
 6007|  9.28k|  context->new_nthreads = context->nthreads;
 6008|       |
 6009|  9.28k|  context->threads_started = 0;
 6010|  9.28k|  context->block_maskout = NULL;
 6011|  9.28k|  context->block_maskout_nitems = 0;
 6012|  9.28k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  9.28k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6013|  9.28k|  context->schunk = dparams.schunk;
 6014|       |
 6015|  9.28k|  if (dparams.postfilter != NULL) {
  ------------------
  |  Branch (6015:7): [True: 0, False: 9.28k]
  ------------------
 6016|      0|    context->postfilter = dparams.postfilter;
 6017|      0|    context->postparams = (blosc2_postfilter_params*)my_malloc(sizeof(blosc2_postfilter_params));
 6018|      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]
  |  |  ------------------
  ------------------
 6019|      0|    memcpy(context->postparams, dparams.postparams, sizeof(blosc2_postfilter_params));
 6020|      0|  }
 6021|       |
 6022|  9.28k|  return context;
 6023|  9.28k|}
blosc2_free_ctx:
 6026|  22.0k|void blosc2_free_ctx(blosc2_context* context) {
 6027|  22.0k|  if (g_initlib ||
  ------------------
  |  Branch (6027:7): [True: 14.2k, False: 7.77k]
  ------------------
 6028|  7.77k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  29.8k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6028:7): [True: 0, False: 7.77k]
  ------------------
 6029|  14.2k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  7.77k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6029:7): [True: 0, False: 7.77k]
  ------------------
 6030|  14.2k|    release_thread_backend(context);
 6031|  14.2k|  }
 6032|  22.0k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6032:7): [True: 3.65k, False: 18.4k]
  ------------------
 6033|  3.65k|    free_thread_context(context->serial_context);
 6034|  3.65k|  }
 6035|  22.0k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  22.0k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6036|  22.0k|  release_context_dict_buffer(context);
 6037|  22.0k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6037:7): [True: 0, False: 22.0k]
  ------------------
 6038|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6038:9): [True: 0, False: 0]
  ------------------
 6039|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6040|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6040:16): [True: 0, False: 0]
  ------------------
 6041|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6042|      0|    }
 6043|      0|#ifdef HAVE_ZSTD
 6044|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6044:14): [True: 0, False: 0]
  ------------------
 6045|      0|      ZSTD_freeCDict(context->dict_cdict);
 6046|      0|    }
 6047|      0|#endif
 6048|      0|  }
 6049|  22.0k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6049:7): [True: 5, False: 22.0k]
  ------------------
 6050|      5|#ifdef HAVE_ZSTD
 6051|      5|    ZSTD_freeDDict(context->dict_ddict);
 6052|      5|#endif
 6053|      5|  }
 6054|  22.0k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6054:7): [True: 0, False: 22.0k]
  ------------------
 6055|      0|    int rc;
 6056|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6056:9): [True: 0, False: 0]
  |  Branch (6056:49): [True: 0, False: 0]
  ------------------
 6057|      0|      rc = blosc_stune_free(context);
 6058|      0|    } else {
 6059|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6059:23): [True: 0, False: 0]
  ------------------
 6060|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6060:13): [True: 0, False: 0]
  ------------------
 6061|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6061:15): [True: 0, False: 0]
  ------------------
 6062|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6062:17): [True: 0, False: 0]
  ------------------
 6063|      0|              BLOSC_TRACE_ERROR("Could not load tuner %d.", g_tuners[i].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6064|      0|              return;
 6065|      0|            }
 6066|      0|          }
 6067|      0|          rc = g_tuners[i].free(context);
 6068|      0|          goto urtunersuccess;
 6069|      0|        }
 6070|      0|      }
 6071|      0|      BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", context->tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6072|      0|      return;
 6073|      0|      urtunersuccess:;
 6074|      0|    }
 6075|      0|    if (rc < 0) {
  ------------------
  |  Branch (6075:9): [True: 0, False: 0]
  ------------------
 6076|      0|      BLOSC_TRACE_ERROR("Error in user-defined tuner free function\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6077|      0|      return;
 6078|      0|    }
 6079|      0|  }
 6080|       |  /* May be needed if codec_params ever contains nested objects
 6081|       |  if (context->codec_params != NULL) {
 6082|       |    int rc;
 6083|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6084|       |      if (g_codecs[i].compcode == context->compcode) {
 6085|       |        if (g_codecs[i].free == NULL) {
 6086|       |          // Dynamically load codec plugin
 6087|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6088|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6089|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6090|       |          }
 6091|       |        }
 6092|       |        if (g_codecs[i].free == NULL){
 6093|       |          // no free func, codec_params is simple
 6094|       |          my_free(context->codec_params);
 6095|       |        }
 6096|       |        else{ // has free function for codec_params (e.g. openzl)
 6097|       |        rc = g_codecs[i].free(context->codec_params);
 6098|       |          goto urcodecsuccess;
 6099|       |        }
 6100|       |      }
 6101|       |    }
 6102|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6103|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6104|       |    urcodecsuccess:;
 6105|       |    if (rc < 0) {
 6106|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6107|       |      return;
 6108|       |    }
 6109|       |  }
 6110|       |  */
 6111|  22.0k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6111:7): [True: 0, False: 22.0k]
  ------------------
 6112|      0|    my_free(context->preparams);
 6113|      0|  }
 6114|  22.0k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6114:7): [True: 0, False: 22.0k]
  ------------------
 6115|      0|    my_free(context->postparams);
 6116|      0|  }
 6117|       |
 6118|  22.0k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6118:7): [True: 0, False: 22.0k]
  ------------------
 6119|      0|    free(context->block_maskout);
 6120|      0|  }
 6121|  22.0k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6121:7): [True: 0, False: 22.0k]
  ------------------
 6122|      0|    free(context->blocknbytes);
 6123|      0|  }
 6124|  22.0k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6124:7): [True: 0, False: 22.0k]
  ------------------
 6125|      0|    free(context->blockoffsets);
 6126|      0|  }
 6127|  22.0k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6127:7): [True: 0, False: 22.0k]
  ------------------
 6128|      0|    free(context->blockcbytes);
 6129|      0|  }
 6130|  22.0k|  my_free(context);
 6131|  22.0k|}
blosc2_ctx_get_dparams:
 6158|    753|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6159|    753|  dparams->nthreads = ctx->nthreads;
 6160|    753|  dparams->schunk = ctx->schunk;
 6161|    753|  dparams->postfilter = ctx->postfilter;
 6162|    753|  dparams->postparams = ctx->postparams;
 6163|    753|  dparams->typesize = ctx->typesize;
 6164|       |
 6165|    753|  return BLOSC2_ERROR_SUCCESS;
 6166|    753|}
blosc2_chunk_zeros:
 6188|    274|int blosc2_chunk_zeros(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6189|    274|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6189:7): [True: 0, False: 274]
  ------------------
 6190|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6191|      0|    return BLOSC2_ERROR_DATA;
 6192|      0|  }
 6193|       |
 6194|    274|  if ((nbytes > 0) && (nbytes % cparams.typesize)) {
  ------------------
  |  Branch (6194:7): [True: 257, False: 17]
  |  Branch (6194:23): [True: 4, False: 253]
  ------------------
 6195|      4|    BLOSC_TRACE_ERROR("nbytes must 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6196|      4|    return BLOSC2_ERROR_DATA;
 6197|      4|  }
 6198|       |
 6199|    270|  blosc_header header;
 6200|    270|  blosc2_context* context = blosc2_create_cctx(cparams);
 6201|    270|  if (context == NULL) {
  ------------------
  |  Branch (6201:7): [True: 0, False: 270]
  ------------------
 6202|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6203|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6204|      0|  }
 6205|       |
 6206|    270|  int error = initialize_context_compression(
 6207|    270|          context, NULL, nbytes, dest, destsize,
 6208|    270|          context->clevel, context->filters, context->filters_meta,
 6209|    270|          context->typesize, context->compcode, context->blocksize,
 6210|    270|          context->new_nthreads, context->nthreads, context->splitmode,
 6211|    270|          context->tuner_id, context->tuner_params, context->schunk);
 6212|    270|  if (error <= 0) {
  ------------------
  |  Branch (6212:7): [True: 0, False: 270]
  ------------------
 6213|      0|    blosc2_free_ctx(context);
 6214|      0|    return error;
 6215|      0|  }
 6216|       |
 6217|    270|  memset(&header, 0, sizeof(header));
 6218|    270|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6219|    270|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6220|    270|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6221|    270|  header.typesize = context->typesize;
 6222|    270|  header.nbytes = (int32_t)nbytes;
 6223|    270|  header.blocksize = context->blocksize;
 6224|    270|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6225|    270|  header.blosc2_flags = BLOSC2_SPECIAL_ZERO << 4;  // mark chunk as all zeros
 6226|    270|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6227|       |
 6228|    270|  blosc2_free_ctx(context);
 6229|       |
 6230|    270|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6231|    270|}
blosc2_chunk_uninit:
 6235|      7|int blosc2_chunk_uninit(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6236|      7|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6236:7): [True: 0, False: 7]
  ------------------
 6237|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6238|      0|    return BLOSC2_ERROR_DATA;
 6239|      0|  }
 6240|       |
 6241|      7|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6241:7): [True: 1, False: 6]
  ------------------
 6242|      1|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6243|      1|    return BLOSC2_ERROR_DATA;
 6244|      1|  }
 6245|       |
 6246|      6|  blosc_header header;
 6247|      6|  blosc2_context* context = blosc2_create_cctx(cparams);
 6248|      6|  if (context == NULL) {
  ------------------
  |  Branch (6248:7): [True: 0, False: 6]
  ------------------
 6249|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6250|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6251|      0|  }
 6252|      6|  int error = initialize_context_compression(
 6253|      6|          context, NULL, nbytes, dest, destsize,
 6254|      6|          context->clevel, context->filters, context->filters_meta,
 6255|      6|          context->typesize, context->compcode, context->blocksize,
 6256|      6|          context->new_nthreads, context->nthreads, context->splitmode,
 6257|      6|          context->tuner_id, context->tuner_params, context->schunk);
 6258|      6|  if (error <= 0) {
  ------------------
  |  Branch (6258:7): [True: 0, False: 6]
  ------------------
 6259|      0|    blosc2_free_ctx(context);
 6260|      0|    return error;
 6261|      0|  }
 6262|       |
 6263|      6|  memset(&header, 0, sizeof(header));
 6264|      6|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6265|      6|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6266|      6|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6267|      6|  header.typesize = context->typesize;
 6268|      6|  header.nbytes = (int32_t)nbytes;
 6269|      6|  header.blocksize = context->blocksize;
 6270|      6|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6271|      6|  header.blosc2_flags = BLOSC2_SPECIAL_UNINIT << 4;  // mark chunk as uninitialized
 6272|      6|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6273|       |
 6274|      6|  blosc2_free_ctx(context);
 6275|       |
 6276|      6|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6277|      6|}
blosc2_chunk_nans:
 6281|      2|int blosc2_chunk_nans(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6282|      2|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6282:7): [True: 0, False: 2]
  ------------------
 6283|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6284|      0|    return BLOSC2_ERROR_DATA;
 6285|      0|  }
 6286|       |
 6287|      2|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6287:7): [True: 0, False: 2]
  ------------------
 6288|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6289|      0|    return BLOSC2_ERROR_DATA;
 6290|      0|  }
 6291|       |
 6292|      2|  blosc_header header;
 6293|      2|  blosc2_context* context = blosc2_create_cctx(cparams);
 6294|      2|  if (context == NULL) {
  ------------------
  |  Branch (6294:7): [True: 0, False: 2]
  ------------------
 6295|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6296|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6297|      0|  }
 6298|       |
 6299|      2|  int error = initialize_context_compression(
 6300|      2|          context, NULL, nbytes, dest, destsize,
 6301|      2|          context->clevel, context->filters, context->filters_meta,
 6302|      2|          context->typesize, context->compcode, context->blocksize,
 6303|      2|          context->new_nthreads, context->nthreads, context->splitmode,
 6304|      2|          context->tuner_id, context->tuner_params, context->schunk);
 6305|      2|  if (error <= 0) {
  ------------------
  |  Branch (6305:7): [True: 0, False: 2]
  ------------------
 6306|      0|    blosc2_free_ctx(context);
 6307|      0|    return error;
 6308|      0|  }
 6309|       |
 6310|      2|  memset(&header, 0, sizeof(header));
 6311|      2|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6312|      2|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6313|      2|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6314|      2|  header.typesize = context->typesize;
 6315|      2|  header.nbytes = (int32_t)nbytes;
 6316|      2|  header.blocksize = context->blocksize;
 6317|      2|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6318|      2|  header.blosc2_flags = BLOSC2_SPECIAL_NAN << 4;  // mark chunk as all NaNs
 6319|      2|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6320|       |
 6321|      2|  blosc2_free_ctx(context);
 6322|       |
 6323|      2|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6324|      2|}
register_filter_private:
 6378|  38.8k|int register_filter_private(blosc2_filter *filter) {
 6379|  38.8k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  38.8k|    do {                                            \
  |  |  105|  38.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 38.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|  38.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 38.8k]
  |  |  ------------------
  ------------------
 6380|  38.8k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6380:9): [True: 0, False: 38.8k]
  ------------------
 6381|      0|        BLOSC_TRACE_ERROR("Can not register more filters");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6382|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6383|      0|    }
 6384|  38.8k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6384:9): [True: 0, False: 38.8k]
  ------------------
 6385|      0|        BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_FILTERS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6386|      0|        return BLOSC2_ERROR_FAILURE;
 6387|      0|    }
 6388|       |    /* This condition can never be fulfilled
 6389|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6390|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6391|       |        return BLOSC2_ERROR_FAILURE;
 6392|       |    }
 6393|       |    */
 6394|       |
 6395|   116k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6395:26): [True: 77.7k, False: 38.8k]
  ------------------
 6396|  77.7k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6396:11): [True: 0, False: 77.7k]
  ------------------
 6397|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6397:13): [True: 0, False: 0]
  ------------------
 6398|      0|          BLOSC_TRACE_ERROR("The filter (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6399|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6400|      0|          return BLOSC2_ERROR_FAILURE;
 6401|      0|        }
 6402|      0|        else {
 6403|       |          // Already registered, so no more actions needed
 6404|      0|          return BLOSC2_ERROR_SUCCESS;
 6405|      0|        }
 6406|      0|      }
 6407|  77.7k|    }
 6408|       |
 6409|  38.8k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6410|  38.8k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6411|       |
 6412|  38.8k|    return BLOSC2_ERROR_SUCCESS;
 6413|  38.8k|}
register_codec_private:
 6428|  54.4k|int register_codec_private(blosc2_codec *codec) {
 6429|  54.4k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  54.4k|    do {                                            \
  |  |  105|  54.4k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 54.4k]
  |  |  ------------------
  |  |  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|  54.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 54.4k]
  |  |  ------------------
  ------------------
 6430|  54.4k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6430:9): [True: 0, False: 54.4k]
  ------------------
 6431|      0|      BLOSC_TRACE_ERROR("Can not register more codecs");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6432|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6433|      0|    }
 6434|  54.4k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6434:9): [True: 0, False: 54.4k]
  ------------------
 6435|      0|      BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_CODECS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6436|      0|      return BLOSC2_ERROR_FAILURE;
 6437|      0|    }
 6438|       |    /* This condition can never be fulfilled
 6439|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 6440|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 6441|       |      return BLOSC2_ERROR_FAILURE;
 6442|       |    }
 6443|       |     */
 6444|       |
 6445|   217k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (6445:21): [True: 163k, False: 54.4k]
  ------------------
 6446|   163k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (6446:11): [True: 0, False: 163k]
  ------------------
 6447|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (6447:13): [True: 0, False: 0]
  ------------------
 6448|      0|          BLOSC_TRACE_ERROR("The codec (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6449|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 6450|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 6451|      0|        }
 6452|      0|        else {
 6453|       |          // Already registered, so no more actions needed
 6454|      0|          return BLOSC2_ERROR_SUCCESS;
 6455|      0|        }
 6456|      0|      }
 6457|   163k|    }
 6458|       |
 6459|  54.4k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 6460|  54.4k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 6461|       |
 6462|  54.4k|    return BLOSC2_ERROR_SUCCESS;
 6463|  54.4k|}
register_tuner_private:
 6478|  7.77k|int register_tuner_private(blosc2_tuner *tuner) {
 6479|  7.77k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  7.77k|    do {                                            \
  |  |  105|  7.77k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 7.77k]
  |  |  ------------------
  |  |  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|  7.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 7.77k]
  |  |  ------------------
  ------------------
 6480|  7.77k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (6480:7): [True: 0, False: 7.77k]
  ------------------
 6481|      0|    BLOSC_TRACE_ERROR("Can not register more tuners");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6482|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 6483|      0|  }
 6484|  7.77k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (6484:7): [True: 0, False: 7.77k]
  ------------------
 6485|      0|    BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_TUNER_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6486|      0|    return BLOSC2_ERROR_FAILURE;
 6487|      0|  }
 6488|       |
 6489|  7.77k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6489:19): [True: 0, False: 7.77k]
  ------------------
 6490|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (6490:9): [True: 0, False: 0]
  ------------------
 6491|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (6491:11): [True: 0, False: 0]
  ------------------
 6492|      0|        BLOSC_TRACE_ERROR("The tuner (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6493|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 6494|      0|        return BLOSC2_ERROR_FAILURE;
 6495|      0|      }
 6496|      0|      else {
 6497|       |        // Already registered, so no more actions needed
 6498|      0|        return BLOSC2_ERROR_SUCCESS;
 6499|      0|      }
 6500|      0|    }
 6501|      0|  }
 6502|       |
 6503|  7.77k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 6504|  7.77k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 6505|       |
 6506|  7.77k|  return BLOSC2_ERROR_SUCCESS;
 6507|  7.77k|}
_blosc2_register_io_cb:
 6520|  15.5k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 6521|       |
 6522|  23.3k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6522:24): [True: 23.3k, False: 2]
  ------------------
 6523|  23.3k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (6523:9): [True: 15.5k, False: 7.77k]
  ------------------
 6524|  15.5k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (6524:11): [True: 0, False: 15.5k]
  ------------------
 6525|      0|        BLOSC_TRACE_ERROR("The IO (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6526|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 6527|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 6528|      0|      }
 6529|  15.5k|      else {
 6530|       |        // Already registered, so no more actions needed
 6531|  15.5k|        return BLOSC2_ERROR_SUCCESS;
 6532|  15.5k|      }
 6533|  15.5k|    }
 6534|  23.3k|  }
 6535|       |
 6536|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 6537|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 6538|       |
 6539|      2|  return BLOSC2_ERROR_SUCCESS;
 6540|  15.5k|}
blosc2_get_io_cb:
 6557|  11.1k|blosc2_io_cb *blosc2_get_io_cb(uint8_t id) {
 6558|       |  // If g_initlib is not set by blosc2_init() this function will try to read
 6559|       |  // uninitialized memory. We should therefore always return NULL in that case
 6560|  11.1k|  if (!g_initlib) {
  ------------------
  |  Branch (6560:7): [True: 0, False: 11.1k]
  ------------------
 6561|      0|    return NULL;
 6562|      0|  }
 6563|  11.1k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6563:24): [True: 11.1k, False: 0]
  ------------------
 6564|  11.1k|    if (g_ios[i].id == id) {
  ------------------
  |  Branch (6564:9): [True: 11.1k, False: 0]
  ------------------
 6565|  11.1k|      return &g_ios[i];
 6566|  11.1k|    }
 6567|  11.1k|  }
 6568|      0|  if (id == BLOSC2_IO_FILESYSTEM) {
  ------------------
  |  Branch (6568:7): [True: 0, False: 0]
  ------------------
 6569|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS) < 0) {
  ------------------
  |  Branch (6569:9): [True: 0, False: 0]
  ------------------
 6570|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6571|      0|      return NULL;
 6572|      0|    }
 6573|      0|    return blosc2_get_io_cb(id);
 6574|      0|  }
 6575|      0|  else if (id == BLOSC2_IO_FILESYSTEM_MMAP) {
  ------------------
  |  Branch (6575:12): [True: 0, False: 0]
  ------------------
 6576|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP) < 0) {
  ------------------
  |  Branch (6576:9): [True: 0, False: 0]
  ------------------
 6577|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6578|      0|      return NULL;
 6579|      0|    }
 6580|      0|    return blosc2_get_io_cb(id);
 6581|      0|  }
 6582|      0|  return NULL;
 6583|      0|}
blosc2_error_string:
 6652|      4|const char *blosc2_error_string(int error_code) {
 6653|      4|  switch (error_code) {
 6654|      4|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (6654:5): [True: 4, False: 0]
  ------------------
 6655|      4|      return "Generic failure";
 6656|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (6656:5): [True: 0, False: 4]
  ------------------
 6657|      0|      return "Bad stream";
 6658|      0|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (6658:5): [True: 0, False: 4]
  ------------------
 6659|      0|      return "Invalid data";
 6660|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (6660:5): [True: 0, False: 4]
  ------------------
 6661|      0|      return "Memory alloc/realloc failure";
 6662|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (6662:5): [True: 0, False: 4]
  ------------------
 6663|      0|      return "Not enough space to read";
 6664|      0|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (6664:5): [True: 0, False: 4]
  ------------------
 6665|      0|      return "Not enough space to write";
 6666|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (6666:5): [True: 0, False: 4]
  ------------------
 6667|      0|      return "Codec not supported";
 6668|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (6668:5): [True: 0, False: 4]
  ------------------
 6669|      0|      return "Invalid parameter supplied to codec";
 6670|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (6670:5): [True: 0, False: 4]
  ------------------
 6671|      0|      return "Codec dictionary error";
 6672|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (6672:5): [True: 0, False: 4]
  ------------------
 6673|      0|      return "Version not supported";
 6674|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (6674:5): [True: 0, False: 4]
  ------------------
 6675|      0|      return "Invalid value in header";
 6676|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (6676:5): [True: 0, False: 4]
  ------------------
 6677|      0|      return "Invalid parameter supplied to function";
 6678|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (6678:5): [True: 0, False: 4]
  ------------------
 6679|      0|      return "File read failure";
 6680|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (6680:5): [True: 0, False: 4]
  ------------------
 6681|      0|      return "File write failure";
 6682|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (6682:5): [True: 0, False: 4]
  ------------------
 6683|      0|      return "File open failure";
 6684|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (6684:5): [True: 0, False: 4]
  ------------------
 6685|      0|      return "Not found";
 6686|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (6686:5): [True: 0, False: 4]
  ------------------
 6687|      0|      return "Bad run length encoding";
 6688|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (6688:5): [True: 0, False: 4]
  ------------------
 6689|      0|      return "Filter pipeline error";
 6690|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (6690:5): [True: 0, False: 4]
  ------------------
 6691|      0|      return "Chunk insert failure";
 6692|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (6692:5): [True: 0, False: 4]
  ------------------
 6693|      0|      return "Chunk append failure";
 6694|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (6694:5): [True: 0, False: 4]
  ------------------
 6695|      0|      return "Chunk update failure";
 6696|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (6696:5): [True: 0, False: 4]
  ------------------
 6697|      0|      return "Sizes larger than 2gb not supported";
 6698|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (6698:5): [True: 0, False: 4]
  ------------------
 6699|      0|      return "Super-chunk copy failure";
 6700|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (6700:5): [True: 0, False: 4]
  ------------------
 6701|      0|      return "Wrong type for frame";
 6702|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (6702:5): [True: 0, False: 4]
  ------------------
 6703|      0|      return "File truncate failure";
 6704|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (6704:5): [True: 0, False: 4]
  ------------------
 6705|      0|      return "Thread or thread context creation failure";
 6706|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (6706:5): [True: 0, False: 4]
  ------------------
 6707|      0|      return "Postfilter failure";
 6708|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (6708:5): [True: 0, False: 4]
  ------------------
 6709|      0|      return "Special frame failure";
 6710|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (6710:5): [True: 0, False: 4]
  ------------------
 6711|      0|      return "Special super-chunk failure";
 6712|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (6712:5): [True: 0, False: 4]
  ------------------
 6713|      0|      return "IO plugin error";
 6714|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (6714:5): [True: 0, False: 4]
  ------------------
 6715|      0|      return "Remove file failure";
 6716|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (6716:5): [True: 0, False: 4]
  ------------------
 6717|      0|      return "Pointer is null";
 6718|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (6718:5): [True: 0, False: 4]
  ------------------
 6719|      0|      return "Invalid index";
 6720|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (6720:5): [True: 0, False: 4]
  ------------------
 6721|      0|      return "Metalayer has not been found";
 6722|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (6722:5): [True: 0, False: 4]
  ------------------
 6723|      0|      return "Maximum buffersize exceeded";
 6724|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (6724:5): [True: 0, False: 4]
  ------------------
 6725|      0|      return "Tuner failure";
 6726|      0|    default:
  ------------------
  |  Branch (6726:5): [True: 0, False: 4]
  ------------------
 6727|      0|      return "Unknown error";
 6728|      4|  }
 6729|      4|}
blosc2.c:flags_to_filters:
  633|   227k|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  634|       |  /* Initialize the filter pipeline */
  635|   227k|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  636|       |  /* Fill the filter pipeline */
  637|   227k|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (637:7): [True: 227k, False: 617]
  ------------------
  638|   227k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  639|   227k|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (639:7): [True: 226k, False: 1.04k]
  ------------------
  640|   226k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  641|   227k|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (641:7): [True: 3.75k, False: 223k]
  ------------------
  642|  3.75k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  643|   227k|}
blosc2.c:destroy_thread_context:
 2227|  4.45k|static void destroy_thread_context(struct thread_context* thread_context) {
 2228|  4.45k|  my_free(thread_context->tmp);
 2229|  4.45k|#if defined(HAVE_ZSTD)
 2230|  4.45k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2230:7): [True: 0, False: 4.45k]
  ------------------
 2231|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2232|      0|  }
 2233|  4.45k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2233:7): [True: 1.58k, False: 2.87k]
  ------------------
 2234|  1.58k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2235|  1.58k|  }
 2236|  4.45k|#endif
 2237|  4.45k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2237:7): [True: 0, False: 4.45k]
  ------------------
 2238|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2239|      0|  }
 2240|  4.45k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2240:7): [True: 0, False: 4.45k]
  ------------------
 2241|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2242|      0|  }
 2243|  4.45k|}
blosc2.c:my_free:
  218|  30.9k|static void my_free(void* block) {
  219|       |#if defined(_WIN32)
  220|       |  _aligned_free(block);
  221|       |#else
  222|  30.9k|  free(block);
  223|  30.9k|#endif  /* _WIN32 */
  224|  30.9k|}
blosc2.c:initialize_context_compression:
 2338|    278|        blosc2_schunk* schunk) {
 2339|       |
 2340|       |  /* Set parameters */
 2341|    278|  context->do_compress = 1;
 2342|    278|  context->src = (const uint8_t*)src;
 2343|    278|  context->srcsize = srcsize;
 2344|    278|  context->dest = (uint8_t*)dest;
 2345|    278|  context->output_bytes = 0;
 2346|    278|  context->destsize = destsize;
 2347|    278|  context->sourcesize = srcsize;
 2348|    278|  context->typesize = typesize;
 2349|    278|  context->filter_flags = filters_to_flags(filters);
 2350|  1.94k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (2350:19): [True: 1.66k, False: 278]
  ------------------
 2351|  1.66k|    context->filters[i] = filters[i];
 2352|  1.66k|    context->filters_meta[i] = filters_meta[i];
 2353|  1.66k|  }
 2354|    278|  context->compcode = compressor;
 2355|    278|  context->nthreads = nthreads;
 2356|    278|  context->new_nthreads = new_nthreads;
 2357|    278|  context->clevel = clevel;
 2358|    278|  context->schunk = schunk;
 2359|    278|  context->tuner_params = tuner_params;
 2360|    278|  context->tuner_id = tuner_id;
 2361|    278|  context->splitmode = splitmode;
 2362|    278|  context->header_blocksize = (int32_t)blocksize;
 2363|    278|  context->blosc2_flags2 = 0;
 2364|    278|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2364:7): [True: 0, False: 278]
  ------------------
 2365|      0|    free(context->blocknbytes);
 2366|      0|    context->blocknbytes = NULL;
 2367|      0|  }
 2368|    278|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2368:7): [True: 0, False: 278]
  ------------------
 2369|      0|    free(context->blockoffsets);
 2370|      0|    context->blockoffsets = NULL;
 2371|      0|  }
 2372|    278|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2372:7): [True: 0, False: 278]
  ------------------
 2373|      0|    free(context->blockcbytes);
 2374|      0|    context->blockcbytes = NULL;
 2375|      0|  }
 2376|    278|  context->vlblock_sources = NULL;
 2377|    278|  context->vlblock_dests = NULL;
 2378|       |  /* tuner some compression parameters */
 2379|    278|  context->blocksize = (int32_t)blocksize;
 2380|    278|  int rc = 0;
 2381|    278|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (2381:7): [True: 0, False: 278]
  ------------------
 2382|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2382:9): [True: 0, False: 0]
  |  Branch (2382:49): [True: 0, False: 0]
  ------------------
 2383|      0|      if (blosc_stune_next_cparams(context) < 0) {
  ------------------
  |  Branch (2383:11): [True: 0, False: 0]
  ------------------
 2384|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2385|      0|        return BLOSC2_ERROR_TUNER;
 2386|      0|      }
 2387|      0|    } else {
 2388|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2388:23): [True: 0, False: 0]
  ------------------
 2389|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2389:13): [True: 0, False: 0]
  ------------------
 2390|      0|          if (g_tuners[i].next_cparams == NULL) {
  ------------------
  |  Branch (2390:15): [True: 0, False: 0]
  ------------------
 2391|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2391:17): [True: 0, False: 0]
  ------------------
 2392|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2393|      0|              return BLOSC2_ERROR_FAILURE;
 2394|      0|            }
 2395|      0|          }
 2396|      0|          if (g_tuners[i].next_cparams(context) < 0) {
  ------------------
  |  Branch (2396:15): [True: 0, False: 0]
  ------------------
 2397|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2398|      0|            return BLOSC2_ERROR_TUNER;
 2399|      0|          }
 2400|      0|          if (g_tuners[i].id == BLOSC_BTUNE && context->blocksize == 0) {
  ------------------
  |  Branch (2400:15): [True: 0, False: 0]
  |  Branch (2400:48): [True: 0, False: 0]
  ------------------
 2401|       |            // Call stune for initializing blocksize
 2402|      0|            if (blosc_stune_next_blocksize(context) < 0) {
  ------------------
  |  Branch (2402:17): [True: 0, False: 0]
  ------------------
 2403|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2404|      0|              return BLOSC2_ERROR_TUNER;
 2405|      0|            }
 2406|      0|          }
 2407|      0|          goto urtunersuccess;
 2408|      0|        }
 2409|      0|      }
 2410|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2411|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2412|      0|    }
 2413|    278|  } else {
 2414|    278|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|    278|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2414:9): [True: 278, False: 0]
  |  Branch (2414:49): [True: 278, False: 0]
  ------------------
 2415|    278|      rc = blosc_stune_next_blocksize(context);
 2416|    278|    } else {
 2417|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2417:23): [True: 0, False: 0]
  ------------------
 2418|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2418:13): [True: 0, False: 0]
  ------------------
 2419|      0|          if (g_tuners[i].next_blocksize == NULL) {
  ------------------
  |  Branch (2419:15): [True: 0, False: 0]
  ------------------
 2420|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2420:17): [True: 0, False: 0]
  ------------------
 2421|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2422|      0|              return BLOSC2_ERROR_FAILURE;
 2423|      0|            }
 2424|      0|          }
 2425|      0|          rc = g_tuners[i].next_blocksize(context);
 2426|      0|          goto urtunersuccess;
 2427|      0|        }
 2428|      0|      }
 2429|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2430|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2431|      0|    }
 2432|    278|  }
 2433|    278|  urtunersuccess:;
 2434|    278|  if (rc < 0) {
  ------------------
  |  Branch (2434:7): [True: 0, False: 278]
  ------------------
 2435|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2436|      0|    return BLOSC2_ERROR_TUNER;
 2437|      0|  }
 2438|       |
 2439|       |
 2440|       |  /* Check buffer size limits */
 2441|    278|  if (srcsize > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (2441:7): [True: 0, False: 278]
  ------------------
 2442|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2443|      0|                      BLOSC2_MAX_BUFFERSIZE);
 2444|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2445|      0|  }
 2446|       |
 2447|    278|  if (destsize < BLOSC2_MAX_OVERHEAD) {
  ------------------
  |  Branch (2447:7): [True: 0, False: 278]
  ------------------
 2448|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2449|      0|                      BLOSC2_MAX_OVERHEAD);
 2450|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2451|      0|  }
 2452|       |
 2453|       |  /* Compression level */
 2454|    278|  if (clevel < 0 || clevel > 9) {
  ------------------
  |  Branch (2454:7): [True: 0, False: 278]
  |  Branch (2454:21): [True: 0, False: 278]
  ------------------
 2455|       |    /* If clevel not in 0..9, print an error */
 2456|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2457|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2458|      0|  }
 2459|       |
 2460|       |  /* Dictionary support is only available for ZSTD, LZ4, and LZ4HC.
 2461|       |   * Skip the check when src is NULL (special-value chunks): no compression
 2462|       |   * will actually happen, so codec compatibility is irrelevant. */
 2463|    278|  if (src != NULL && context->use_dict && context->compcode != BLOSC_ZSTD &&
  ------------------
  |  Branch (2463:7): [True: 0, False: 278]
  |  Branch (2463:22): [True: 0, False: 0]
  |  Branch (2463:43): [True: 0, False: 0]
  ------------------
 2464|      0|      context->compcode != BLOSC_LZ4 && context->compcode != BLOSC_LZ4HC) {
  ------------------
  |  Branch (2464:7): [True: 0, False: 0]
  |  Branch (2464:41): [True: 0, False: 0]
  ------------------
 2465|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2466|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2467|      0|  }
 2468|       |
 2469|       |  /* Check typesize limits */
 2470|    278|  if (context->typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (2470:7): [True: 0, False: 278]
  ------------------
 2471|       |    // If typesize is too large for Blosc2, return an error
 2472|      0|    BLOSC_TRACE_ERROR("Typesize cannot exceed %d bytes.", BLOSC2_MAXTYPESIZE);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2473|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2474|      0|  }
 2475|       |  /* Now, cap typesize so that blosc2 split machinery can continue to work */
 2476|    278|  if (context->typesize > BLOSC_MAX_TYPESIZE) {
  ------------------
  |  Branch (2476:7): [True: 49, False: 229]
  ------------------
 2477|       |    /* If typesize is too large, treat buffer as an 1-byte stream. */
 2478|     49|    context->typesize = 1;
 2479|     49|  }
 2480|       |
 2481|    278|  blosc2_calculate_blocks(context);
 2482|       |
 2483|    278|  return 1;
 2484|    278|}
blosc2.c:filters_to_flags:
  610|  5.65k|static uint8_t filters_to_flags(const uint8_t* filters) {
  611|  5.65k|  uint8_t flags = 0;
  612|       |
  613|  39.5k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (613:19): [True: 33.9k, False: 5.65k]
  ------------------
  614|  33.9k|    switch (filters[i]) {
  615|  3.06k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (615:7): [True: 3.06k, False: 30.8k]
  ------------------
  616|  3.06k|        flags |= BLOSC_DOSHUFFLE;
  617|  3.06k|        break;
  618|    667|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (618:7): [True: 667, False: 33.2k]
  ------------------
  619|    667|        flags |= BLOSC_DOBITSHUFFLE;
  620|    667|        break;
  621|  1.34k|      case BLOSC_DELTA:
  ------------------
  |  Branch (621:7): [True: 1.34k, False: 32.5k]
  ------------------
  622|  1.34k|        flags |= BLOSC_DODELTA;
  623|  1.34k|        break;
  624|  28.8k|      default :
  ------------------
  |  Branch (624:7): [True: 28.8k, False: 5.08k]
  ------------------
  625|  28.8k|        break;
  626|  33.9k|    }
  627|  33.9k|  }
  628|  5.65k|  return flags;
  629|  5.65k|}
blosc2.c:blosc2_calculate_blocks:
  798|  5.98k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  799|       |  /* Compute number of blocks in buffer */
  800|  5.98k|  context->nblocks = context->sourcesize / context->blocksize;
  801|  5.98k|  context->leftover = context->sourcesize % context->blocksize;
  802|  5.98k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (802:22): [True: 3.46k, False: 2.52k]
  ------------------
  803|  3.46k|                     (context->nblocks + 1) : context->nblocks;
  804|  5.98k|}
blosc2.c:clibcode_to_clibname:
  251|      1|static const char* clibcode_to_clibname(int clibcode) {
  252|      1|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (252:7): [True: 0, False: 1]
  ------------------
  253|      1|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (253:7): [True: 0, False: 1]
  ------------------
  254|      1|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (254:7): [True: 0, False: 1]
  ------------------
  255|      1|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (255:7): [True: 0, False: 1]
  ------------------
  256|      8|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (256:19): [True: 7, False: 1]
  ------------------
  257|      7|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (257:9): [True: 0, False: 7]
  ------------------
  258|      0|      return g_codecs[i].compname;
  259|      7|  }
  260|      1|  return NULL;                  /* should never happen */
  261|      1|}
blosc2.c:blosc_run_decompression_with_context:
 3857|  4.93k|                                                void* dest, int32_t destsize) {
 3858|  4.93k|  blosc_header header;
 3859|  4.93k|  int32_t ntbytes;
 3860|  4.93k|  int rc;
 3861|       |
 3862|  4.93k|  rc = read_chunk_header(src, srcsize, true, &header);
 3863|  4.93k|  if (rc < 0) {
  ------------------
  |  Branch (3863:7): [True: 10, False: 4.92k]
  ------------------
 3864|     10|    return rc;
 3865|     10|  }
 3866|       |
 3867|  4.92k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (3867:7): [True: 0, False: 4.92k]
  ------------------
 3868|       |    // Not enough space for writing into the destination
 3869|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 3870|      0|  }
 3871|       |
 3872|  4.92k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 3873|  4.92k|  if (rc < 0) {
  ------------------
  |  Branch (3873:7): [True: 1.01k, False: 3.91k]
  ------------------
 3874|  1.01k|    return rc;
 3875|  1.01k|  }
 3876|       |
 3877|       |  /* Do the actual decompression */
 3878|  3.91k|  ntbytes = do_job(context);
 3879|  3.91k|  if (ntbytes < 0) {
  ------------------
  |  Branch (3879:7): [True: 2.76k, False: 1.14k]
  ------------------
 3880|  2.76k|    return ntbytes;
 3881|  2.76k|  }
 3882|       |
 3883|  3.91k|  assert(ntbytes <= (int32_t)destsize);
 3884|  1.14k|  return ntbytes;
 3885|  3.91k|}
blosc2.c:initialize_context_decompression:
 2635|  4.92k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2636|  4.92k|  int32_t bstarts_end;
 2637|  4.92k|  bool vlblocks;
 2638|       |
 2639|  4.92k|  context->do_compress = 0;
 2640|  4.92k|  context->src = (const uint8_t*)src;
 2641|  4.92k|  context->srcsize = srcsize;
 2642|  4.92k|  context->dest = (uint8_t*)dest;
 2643|  4.92k|  context->destsize = destsize;
 2644|  4.92k|  context->output_bytes = 0;
 2645|  4.92k|  context->vlblock_sources = NULL;
 2646|  4.92k|  context->vlblock_dests = NULL;
 2647|  4.92k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2647:7): [True: 0, False: 4.92k]
  ------------------
 2648|      0|    free(context->blocknbytes);
 2649|      0|    context->blocknbytes = NULL;
 2650|      0|  }
 2651|  4.92k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2651:7): [True: 0, False: 4.92k]
  ------------------
 2652|      0|    free(context->blockoffsets);
 2653|      0|    context->blockoffsets = NULL;
 2654|      0|  }
 2655|  4.92k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2655:7): [True: 0, False: 4.92k]
  ------------------
 2656|      0|    free(context->blockcbytes);
 2657|      0|    context->blockcbytes = NULL;
 2658|      0|  }
 2659|       |
 2660|  4.92k|  int rc = blosc2_initialize_context_from_header(context, header);
 2661|  4.92k|  if (rc < 0) {
  ------------------
  |  Branch (2661:7): [True: 0, False: 4.92k]
  ------------------
 2662|      0|    return rc;
 2663|      0|  }
 2664|  4.92k|  clear_context_decompression_dict(context);
 2665|  4.92k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2666|  4.92k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2666:19): [True: 4.58k, False: 338]
  ------------------
 2667|  4.58k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2667:19): [True: 18, False: 4.56k]
  ------------------
 2668|       |
 2669|       |  /* Check that we have enough space to decompress */
 2670|  4.92k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2670:7): [True: 0, False: 4.92k]
  ------------------
 2671|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2672|      0|  }
 2673|       |
 2674|  4.92k|  if (context->block_maskout != NULL && context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2674:7): [True: 0, False: 4.92k]
  |  Branch (2674:41): [True: 0, False: 0]
  ------------------
 2675|      0|    BLOSC_TRACE_ERROR("The number of items in block_maskout (%d) must match the number"
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2676|      0|                      " of blocks in chunk (%d).",
 2677|      0|                      context->block_maskout_nitems, context->nblocks);
 2678|      0|    return BLOSC2_ERROR_DATA;
 2679|      0|  }
 2680|       |
 2681|  4.92k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2682|  4.92k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2682:7): [True: 0, False: 4.92k]
  ------------------
 2683|      0|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2684|      0|                      context->special_type);
 2685|      0|    return BLOSC2_ERROR_DATA;
 2686|      0|  }
 2687|       |
 2688|  4.92k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2689|  4.92k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2689:7): [True: 832, False: 4.08k]
  |  Branch (2689:19): [True: 216, False: 616]
  ------------------
 2690|    216|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   93|    216|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    216|    do {                                            \
  |  |  |  |   98|    216|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    216|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 216, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    216|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2691|    216|    return BLOSC2_ERROR_DATA;
 2692|    216|  }
 2693|       |
 2694|  4.70k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2694:7): [True: 0, False: 4.70k]
  |  Branch (2694:32): [True: 0, False: 0]
  ------------------
 2695|      0|      !context->special_type) {
  ------------------
  |  Branch (2695:7): [True: 0, False: 0]
  ------------------
 2696|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 2697|      0|    return 0;
 2698|      0|  }
 2699|       |
 2700|  4.70k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2701|  4.70k|  bstarts_end = context->header_overhead;
 2702|  4.70k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2702:7): [True: 4.52k, False: 182]
  |  Branch (2702:33): [True: 3.92k, False: 595]
  ------------------
 2703|  3.92k|    size_t bstarts_end_tmp;
 2704|  3.92k|    size_t bstarts_nbytes;
 2705|  3.92k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2705:9): [True: 1, False: 3.92k]
  ------------------
 2706|  3.92k|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2706:9): [True: 0, False: 3.92k]
  ------------------
 2707|  3.92k|        !checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2707:9): [True: 0, False: 3.92k]
  ------------------
 2708|  3.92k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2708:9): [True: 1, False: 3.92k]
  ------------------
 2709|      2|      BLOSC_TRACE_ERROR("Invalid bstarts size in chunk header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2710|      2|      return BLOSC2_ERROR_INVALID_HEADER;
 2711|      2|    }
 2712|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 2713|  3.92k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2714|  3.92k|  }
 2715|       |
 2716|  4.70k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2716:7): [True: 515, False: 4.18k]
  ------------------
 2717|    515|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|    515|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    515|    do {                                            \
  |  |  |  |   98|    515|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    515|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 515, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    515|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2718|    515|    return BLOSC2_ERROR_READ_BUFFER;
 2719|    515|  }
 2720|       |
 2721|  4.18k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2721:7): [True: 0, False: 4.18k]
  |  Branch (2721:19): [True: 0, False: 0]
  |  Branch (2721:30): [True: 0, False: 0]
  |  Branch (2721:56): [True: 0, False: 0]
  ------------------
 2722|      0|    size_t block_csizes_nbytes;
 2723|      0|    size_t trailer_meta_nbytes;
 2724|      0|    size_t lazy_trailer_end;
 2725|      0|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2725:9): [True: 0, False: 0]
  |  Branch (2725:33): [True: 0, False: 0]
  ------------------
 2726|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2726:9): [True: 0, False: 0]
  ------------------
 2727|      0|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2727:9): [True: 0, False: 0]
  ------------------
 2728|      0|        !checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2728:9): [True: 0, False: 0]
  ------------------
 2729|      0|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2729:9): [True: 0, False: 0]
  ------------------
 2730|      0|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2731|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2732|      0|    }
 2733|      0|  }
 2734|  4.18k|  srcsize -= bstarts_end;
 2735|       |
 2736|       |  /* Read optional dictionary if flag set */
 2737|  4.18k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2737:7): [True: 356, False: 3.83k]
  |  Branch (2737:51): [True: 348, False: 8]
  ------------------
 2738|    348|    context->use_dict = 1;
 2739|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2740|    348|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2740:9): [True: 3, False: 345]
  ------------------
 2741|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2742|      3|      return BLOSC2_ERROR_READ_BUFFER;
 2743|      3|    }
 2744|    345|    srcsize -= sizeof(int32_t);
 2745|       |    // Read dictionary size
 2746|    345|    context->dict_size = sw32_(context->src + bstarts_end);
 2747|    345|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2747:9): [True: 86, False: 259]
  |  Branch (2747:36): [True: 173, False: 86]
  ------------------
 2748|    259|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|    259|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    259|    do {                                            \
  |  |  |  |   98|    259|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    259|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 259, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    259|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2749|    259|      return BLOSC2_ERROR_CODEC_DICT;
 2750|    259|    }
 2751|     86|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2751:9): [True: 8, False: 78]
  ------------------
 2752|      8|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2753|      8|      return BLOSC2_ERROR_READ_BUFFER;
 2754|      8|    }
 2755|     78|    srcsize -= context->dict_size;
 2756|       |    // dict_buffer points directly into the source chunk — no copy needed
 2757|     78|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2758|     78|    context->dict_buffer_owned = false;
 2759|     78|#if defined(HAVE_ZSTD)
 2760|       |    // context->compcode during decompression holds the format code (flags >> 5),
 2761|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 2762|     78|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2762:9): [True: 12, False: 66]
  ------------------
 2763|     12|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2764|     12|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2764:11): [True: 0, False: 12]
  ------------------
 2765|      0|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2766|      0|        return BLOSC2_ERROR_CODEC_DICT;
 2767|      0|      }
 2768|     12|    }
 2769|     78|#endif   // HAVE_ZSTD
 2770|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2771|     78|  }
 2772|  3.84k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2772:12): [True: 8, False: 3.83k]
  |  Branch (2772:56): [True: 8, False: 0]
  ------------------
 2773|      8|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2774|      8|    if (rc < 0) {
  ------------------
  |  Branch (2774:9): [True: 8, False: 0]
  ------------------
 2775|      8|      return rc;
 2776|      8|    }
 2777|      8|  }
 2778|       |
 2779|  3.91k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2779:7): [True: 0, False: 3.91k]
  |  Branch (2779:19): [True: 0, False: 0]
  |  Branch (2779:45): [True: 0, False: 0]
  ------------------
 2780|      0|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2781|      0|    BLOSC_ERROR_NULL(context->blocknbytes, 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]
  |  |  ------------------
  ------------------
 2782|      0|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2783|      0|    BLOSC_ERROR_NULL(context->blockoffsets, 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]
  |  |  ------------------
  ------------------
 2784|      0|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2785|      0|    BLOSC_ERROR_NULL(context->blockcbytes, 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]
  |  |  ------------------
  ------------------
 2786|       |
 2787|      0|    if (is_lazy) {
  ------------------
  |  Branch (2787:9): [True: 0, False: 0]
  ------------------
 2788|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 2789|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 2790|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 2791|      0|      int32_t max_csize = 0;
 2792|      0|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2792:27): [True: 0, False: 0]
  ------------------
 2793|      0|        int32_t bstart = sw32_(context->bstarts + i);
 2794|      0|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2794:31): [True: 0, False: 0]
  ------------------
 2795|      0|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2796|      0|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2796:13): [True: 0, False: 0]
  |  Branch (2796:37): [True: 0, False: 0]
  ------------------
 2797|      0|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2797:13): [True: 0, False: 0]
  ------------------
 2798|      0|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2799|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2800|      0|        }
 2801|      0|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2802|      0|        context->blockoffsets[i] = 0;  // unknown
 2803|      0|        context->blockcbytes[i] = next_bstart - bstart;
 2804|      0|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2804:13): [True: 0, False: 0]
  ------------------
 2805|      0|          max_csize = context->blockcbytes[i];
 2806|      0|        }
 2807|      0|      }
 2808|      0|      context->blocksize = max_csize;
 2809|      0|      context->leftover = 0;
 2810|      0|    }
 2811|      0|    else {
 2812|      0|      int32_t max_blocksize = 0;
 2813|      0|      int64_t total_nbytes = 0;
 2814|      0|      int32_t prev_bstart = 0;
 2815|      0|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2815:27): [True: 0, False: 0]
  ------------------
 2816|      0|        int32_t bstart = sw32_(context->bstarts + i);
 2817|      0|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2817:31): [True: 0, False: 0]
  ------------------
 2818|      0|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2819|      0|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2819:13): [True: 0, False: 0]
  |  Branch (2819:37): [True: 0, False: 0]
  |  Branch (2819:62): [True: 0, False: 0]
  ------------------
 2820|      0|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2820:13): [True: 0, False: 0]
  |  Branch (2820:45): [True: 0, False: 0]
  ------------------
 2821|      0|          BLOSC_TRACE_ERROR("Invalid VL-block offsets 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2822|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2823|      0|        }
 2824|      0|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2825|      0|        context->blockcbytes[i] = next_bstart - bstart;
 2826|      0|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2826:13): [True: 0, False: 0]
  ------------------
 2827|      0|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2828|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2829|      0|        }
 2830|      0|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2830:13): [True: 0, False: 0]
  ------------------
 2831|      0|          BLOSC_TRACE_ERROR("Invalid VL-block cumulative size in chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2832|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2833|      0|        }
 2834|      0|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2835|      0|        total_nbytes += context->blocknbytes[i];
 2836|      0|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2836:13): [True: 0, False: 0]
  ------------------
 2837|      0|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2838|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2839|      0|        }
 2840|      0|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2840:13): [True: 0, False: 0]
  ------------------
 2841|      0|          max_blocksize = context->blocknbytes[i];
 2842|      0|        }
 2843|      0|        prev_bstart = bstart;
 2844|      0|      }
 2845|      0|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2845:11): [True: 0, False: 0]
  ------------------
 2846|      0|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2847|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2848|      0|      }
 2849|      0|      context->blocksize = max_blocksize;
 2850|      0|      context->leftover = 0;
 2851|      0|    }
 2852|      0|  }
 2853|       |
 2854|  3.91k|  return 0;
 2855|  3.91k|}
blosc2.c:clear_context_decompression_dict:
 2496|  4.92k|static void clear_context_decompression_dict(blosc2_context* context) {
 2497|  4.92k|  context->use_dict = 0;
 2498|  4.92k|  release_context_dict_buffer(context);
 2499|  4.92k|#if defined(HAVE_ZSTD)
 2500|  4.92k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2500:7): [True: 7, False: 4.91k]
  ------------------
 2501|      7|    ZSTD_freeDDict(context->dict_ddict);
 2502|      7|    context->dict_ddict = NULL;
 2503|      7|  }
 2504|       |#else
 2505|       |  context->dict_ddict = NULL;
 2506|       |#endif
 2507|  4.92k|}
blosc2.c:checked_mul_size:
  152|  3.92k|static inline bool checked_mul_size(size_t a, size_t b, size_t* out) {
  153|  3.92k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (153:7): [True: 3.92k, False: 1]
  |  Branch (153:17): [True: 0, False: 3.92k]
  ------------------
  154|      0|    return false;
  155|      0|  }
  156|  3.92k|  *out = a * b;
  157|       |  return true;
  158|  3.92k|}
blosc2.c:checked_add_size:
  160|  3.92k|static inline bool checked_add_size(size_t a, size_t b, size_t* out) {
  161|  3.92k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (161:7): [True: 0, False: 3.92k]
  ------------------
  162|      0|    return false;
  163|      0|  }
  164|  3.92k|  *out = a + b;
  165|       |  return true;
  166|  3.92k|}
blosc2.c:load_lazy_chunk_dict:
 2581|      8|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 2582|      8|  int32_t dict_offset = bstarts_end;
 2583|      8|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2583:7): [True: 0, False: 8]
  ------------------
 2584|      0|    BLOSC_TRACE_ERROR("Lazy chunk dictionary header exceeds chunk length.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2585|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2586|      0|  }
 2587|       |
 2588|      8|  uint8_t dict_size_buf[sizeof(int32_t)];
 2589|      8|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 2590|      8|                                 "Cannot open frame file for lazy chunk dictionary read.",
 2591|      8|                                 "Cannot read lazy chunk dictionary size from disk.");
 2592|      8|  if (rc < 0) {
  ------------------
  |  Branch (2592:7): [True: 8, False: 0]
  ------------------
 2593|      8|    return rc;
 2594|      8|  }
 2595|       |
 2596|      0|  context->dict_size = sw32_(dict_size_buf);
 2597|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2597:7): [True: 0, False: 0]
  |  Branch (2597:34): [True: 0, False: 0]
  ------------------
 2598|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2599|      0|    return BLOSC2_ERROR_CODEC_DICT;
 2600|      0|  }
 2601|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (2601:7): [True: 0, False: 0]
  ------------------
 2602|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2603|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2604|      0|  }
 2605|       |
 2606|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 2607|      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]
  |  |  ------------------
  ------------------
 2608|      0|  context->dict_buffer_owned = true;
 2609|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 2610|      0|                             context->dict_buffer, context->dict_size,
 2611|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 2612|      0|                             "Cannot read lazy chunk dictionary from disk.");
 2613|      0|  if (rc < 0) {
  ------------------
  |  Branch (2613:7): [True: 0, False: 0]
  ------------------
 2614|      0|    release_context_dict_buffer(context);
 2615|      0|    return rc;
 2616|      0|  }
 2617|       |
 2618|      0|  context->use_dict = 1;
 2619|      0|#if defined(HAVE_ZSTD)
 2620|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2620:7): [True: 0, False: 0]
  ------------------
 2621|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2622|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2622:9): [True: 0, False: 0]
  ------------------
 2623|      0|      release_context_dict_buffer(context);
 2624|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2625|      0|      return BLOSC2_ERROR_CODEC_DICT;
 2626|      0|    }
 2627|      0|  }
 2628|      0|#endif
 2629|       |
 2630|      0|  return 0;
 2631|      0|}
blosc2.c:read_lazy_chunk_bytes:
 2511|      8|                                 const char* open_error, const char* read_error) {
 2512|      8|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (2512:7): [True: 6, False: 2]
  |  Branch (2512:34): [True: 0, False: 2]
  ------------------
 2513|      6|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2514|      6|    return BLOSC2_ERROR_INVALID_PARAM;
 2515|      6|  }
 2516|       |
 2517|      2|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2518|      2|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2519|      2|  if (io_cb == NULL) {
  ------------------
  |  Branch (2519:7): [True: 0, False: 2]
  ------------------
 2520|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2521|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 2522|      0|  }
 2523|       |
 2524|      2|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 2525|      2|                           context->nblocks * (int32_t)sizeof(int32_t);
 2526|      2|  int32_t nchunk_lazy;
 2527|      2|  int64_t chunk_offset;
 2528|      2|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 2529|      2|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 2530|       |
 2531|      2|  void* fp = NULL;
 2532|      2|  int64_t io_pos;
 2533|      2|  if (frame->sframe) {
  ------------------
  |  Branch (2533:7): [True: 0, False: 2]
  ------------------
 2534|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 2535|      0|    io_pos = offset;
 2536|      0|  }
 2537|      2|  else {
 2538|      2|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (2538:9): [True: 0, False: 2]
  |  Branch (2538:29): [True: 0, False: 2]
  ------------------
 2539|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2540|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2541|      0|    }
 2542|      2|    fp = io_cb->open(frame->urlpath, "rb", context->schunk->storage->io->params);
 2543|      2|    if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (2543:9): [True: 0, False: 2]
  ------------------
 2544|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2545|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2545:11): [True: 0, False: 0]
  ------------------
 2546|      0|        io_cb->close(fp);
 2547|      0|      }
 2548|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2549|      0|    }
 2550|      2|    io_pos = frame->file_offset + chunk_offset;
 2551|      2|    if (io_pos > INT64_MAX - offset) {
  ------------------
  |  Branch (2551:9): [True: 0, False: 2]
  ------------------
 2552|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2553|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2553:11): [True: 0, False: 0]
  ------------------
 2554|      0|        io_cb->close(fp);
 2555|      0|      }
 2556|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2557|      0|    }
 2558|      2|    io_pos += offset;
 2559|      2|  }
 2560|      2|  if (fp == NULL) {
  ------------------
  |  Branch (2560:7): [True: 2, False: 0]
  ------------------
 2561|      2|    BLOSC_TRACE_ERROR("%s", open_error);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2562|      2|    return BLOSC2_ERROR_FILE_OPEN;
 2563|      2|  }
 2564|       |
 2565|      0|  uint8_t* read_buffer = buffer;
 2566|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 2567|      0|  io_cb->close(fp);
 2568|      0|  if (read_buffer != buffer) {
  ------------------
  |  Branch (2568:7): [True: 0, False: 0]
  ------------------
 2569|      0|    memcpy(buffer, read_buffer, (size_t)nbytes);
 2570|      0|    free(read_buffer);
 2571|      0|  }
 2572|      0|  if (rbytes != nbytes) {
  ------------------
  |  Branch (2572:7): [True: 0, False: 0]
  ------------------
 2573|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2574|      0|    return BLOSC2_ERROR_FILE_READ;
 2575|      0|  }
 2576|       |
 2577|      0|  return 0;
 2578|      0|}
blosc2.c:do_job:
 2300|  3.91k|static int do_job(blosc2_context* context) {
 2301|  3.91k|  int32_t ntbytes;
 2302|       |
 2303|       |  /* Set sentinels */
 2304|  3.91k|  context->dref_not_init = 1;
 2305|       |
 2306|       |  /* Check whether we need to restart threads */
 2307|  3.91k|  check_nthreads(context);
 2308|       |
 2309|       |  /* Run the serial version when nthreads is 1 or when the buffers are
 2310|       |     not larger than blocksize */
 2311|  3.91k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1) {
  ------------------
  |  Branch (2311:7): [True: 3.91k, False: 0]
  |  Branch (2311:33): [True: 0, False: 0]
  ------------------
 2312|       |    /* The context for this 'thread' has no been initialized yet */
 2313|  3.91k|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2313:9): [True: 3.65k, False: 251]
  ------------------
 2314|  3.65k|      context->serial_context = create_thread_context(context, 0);
 2315|  3.65k|    }
 2316|    251|    else if (context->blocksize != context->serial_context->tmp_blocksize) {
  ------------------
  |  Branch (2316:14): [True: 6, False: 245]
  ------------------
 2317|      6|      free_thread_context(context->serial_context);
 2318|      6|      context->serial_context = create_thread_context(context, 0);
 2319|      6|    }
 2320|  3.91k|    BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  3.91k|    do {                                            \
  |  |  105|  3.91k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.91k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  3.91k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.91k]
  |  |  ------------------
  ------------------
 2321|  3.91k|    ntbytes = serial_blosc(context->serial_context);
 2322|  3.91k|  }
 2323|      0|  else {
 2324|      0|    ntbytes = parallel_blosc(context);
 2325|      0|  }
 2326|       |
 2327|  3.91k|  return ntbytes;
 2328|  3.91k|}
blosc2.c:serial_blosc:
 2112|  3.91k|static int serial_blosc(struct thread_context* thread_context) {
 2113|  3.91k|  blosc2_context* context = thread_context->parent_context;
 2114|  3.91k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2115|  3.91k|  int32_t j, bsize, leftoverblock;
 2116|  3.91k|  int32_t cbytes;
 2117|  3.91k|  int32_t ntbytes = context->output_bytes;
 2118|  3.91k|  int32_t* bstarts = context->bstarts;
 2119|  3.91k|  uint8_t* tmp = thread_context->tmp;
 2120|  3.91k|  uint8_t* tmp2 = thread_context->tmp2;
 2121|  3.91k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2121:23): [True: 78, False: 3.83k]
  |  Branch (2121:44): [True: 78, False: 0]
  ------------------
 2122|  3.91k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2123|  3.91k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2123:7): [True: 3.91k, False: 0]
  |  Branch (2123:32): [True: 168, False: 3.74k]
  ------------------
 2124|       |    // Fake a runlen as if it was a memcpyed chunk
 2125|    168|    memcpyed = true;
 2126|    168|  }
 2127|       |
 2128|   221k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2128:15): [True: 219k, False: 1.14k]
  ------------------
 2129|   219k|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2129:9): [True: 0, False: 219k]
  |  Branch (2129:33): [True: 0, False: 0]
  |  Branch (2129:46): [True: 0, False: 0]
  ------------------
 2130|      0|      _sw32(bstarts + j, ntbytes);
 2131|      0|    }
 2132|   219k|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2132:13): [True: 0, False: 219k]
  ------------------
 2133|   219k|    leftoverblock = 0;
 2134|   219k|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2134:9): [True: 219k, False: 0]
  |  Branch (2134:22): [True: 1.65k, False: 218k]
  |  Branch (2134:53): [True: 234, False: 1.42k]
  ------------------
 2135|    234|      bsize = context->leftover;
 2136|    234|      leftoverblock = 1;
 2137|    234|    }
 2138|   219k|    if (context->do_compress) {
  ------------------
  |  Branch (2138:9): [True: 0, False: 219k]
  ------------------
 2139|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2139:11): [True: 0, False: 0]
  |  Branch (2139:23): [True: 0, False: 0]
  ------------------
 2140|       |        /* We want to memcpy only */
 2141|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2142|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2143|      0|        cbytes = (int32_t)bsize;
 2144|      0|      }
 2145|      0|      else {
 2146|       |        /* Regular compression */
 2147|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2148|      0|                         context->destsize,
 2149|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2149:26): [True: 0, False: 0]
  ------------------
 2150|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2150:26): [True: 0, False: 0]
  ------------------
 2151|      0|                         context->dest + ntbytes, tmp, tmp2);
 2152|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2152:13): [True: 0, False: 0]
  ------------------
 2153|      0|          ntbytes = 0;              /* incompressible data */
 2154|      0|          break;
 2155|      0|        }
 2156|      0|      }
 2157|      0|    }
 2158|   219k|    else {
 2159|       |      /* Regular decompression */
 2160|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2161|   219k|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2161:28): [True: 216k, False: 3.36k]
  ------------------
 2162|   216k|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2163|   219k|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2163:30): [True: 0, False: 219k]
  |  Branch (2163:42): [True: 0, False: 0]
  ------------------
 2164|   219k|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2164:30): [True: 0, False: 219k]
  |  Branch (2164:42): [True: 0, False: 0]
  ------------------
 2165|   219k|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2165:30): [True: 0, False: 219k]
  ------------------
 2166|   219k|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2167|   219k|                       context->src, context->srcsize, src_offset, j,
 2168|   219k|                       dest_block, dest_offset, tmp, tmp2);
 2169|   219k|    }
 2170|       |
 2171|   219k|    if (cbytes < 0) {
  ------------------
  |  Branch (2171:9): [True: 2.76k, False: 217k]
  ------------------
 2172|  2.76k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2173|  2.76k|      break;
 2174|  2.76k|    }
 2175|   217k|    ntbytes += cbytes;
 2176|   217k|  }
 2177|       |
 2178|  3.91k|  return ntbytes;
 2179|  3.91k|}
blosc2.c:set_values:
 1588|     81|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 1589|       |#if defined(BLOSC_STRICT_ALIGN)
 1590|       |  if (destsize % typesize != 0) {
 1591|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 1592|       |  }
 1593|       |  int32_t nitems = destsize / typesize;
 1594|       |  if (nitems == 0) {
 1595|       |    return 0;
 1596|       |  }
 1597|       |  for (int i = 0; i < nitems; i++) {
 1598|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1599|       |  }
 1600|       |#else
 1601|       |  // destsize can only be a multiple of typesize
 1602|     81|  int64_t val8;
 1603|     81|  int64_t* dest8;
 1604|     81|  int32_t val4;
 1605|     81|  int32_t* dest4;
 1606|     81|  int16_t val2;
 1607|     81|  int16_t* dest2;
 1608|     81|  int8_t val1;
 1609|     81|  int8_t* dest1;
 1610|       |
 1611|     81|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1611:7): [True: 0, False: 81]
  ------------------
 1612|      0|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1613|      0|  }
 1614|     81|  int32_t nitems = destsize / typesize;
 1615|     81|  if (nitems == 0) {
  ------------------
  |  Branch (1615:7): [True: 0, False: 81]
  ------------------
 1616|      0|    return 0;
 1617|      0|  }
 1618|       |
 1619|     81|  switch (typesize) {
 1620|      0|    case 8:
  ------------------
  |  Branch (1620:5): [True: 0, False: 81]
  ------------------
 1621|      0|      val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1622|      0|      dest8 = (int64_t*)dest;
 1623|      0|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1623:23): [True: 0, False: 0]
  ------------------
 1624|      0|        dest8[i] = val8;
 1625|      0|      }
 1626|      0|      break;
 1627|     21|    case 4:
  ------------------
  |  Branch (1627:5): [True: 21, False: 60]
  ------------------
 1628|     21|      val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1629|     21|      dest4 = (int32_t*)dest;
 1630|  4.12k|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1630:23): [True: 4.10k, False: 21]
  ------------------
 1631|  4.10k|        dest4[i] = val4;
 1632|  4.10k|      }
 1633|     21|      break;
 1634|     27|    case 2:
  ------------------
  |  Branch (1634:5): [True: 27, False: 54]
  ------------------
 1635|     27|      val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1636|     27|      dest2 = (int16_t*)dest;
 1637|  12.3k|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1637:23): [True: 12.2k, False: 27]
  ------------------
 1638|  12.2k|        dest2[i] = val2;
 1639|  12.2k|      }
 1640|     27|      break;
 1641|      0|    case 1:
  ------------------
  |  Branch (1641:5): [True: 0, False: 81]
  ------------------
 1642|      0|      val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1643|      0|      dest1 = (int8_t*)dest;
 1644|      0|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1644:23): [True: 0, False: 0]
  ------------------
 1645|      0|        dest1[i] = val1;
 1646|      0|      }
 1647|      0|      break;
 1648|     33|    default:
  ------------------
  |  Branch (1648:5): [True: 33, False: 48]
  ------------------
 1649|    564|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1649:23): [True: 531, False: 33]
  ------------------
 1650|    531|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1651|    531|      }
 1652|     81|  }
 1653|     81|#endif
 1654|       |
 1655|     81|  return nitems;
 1656|     81|}
blosc2.c:set_nans:
 1556|      6|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1557|      6|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1557:7): [True: 0, False: 6]
  ------------------
 1558|      0|    BLOSC_TRACE_ERROR("destsize can only 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1559|      0|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1560|      0|  }
 1561|      6|  int32_t nitems = destsize / typesize;
 1562|      6|  if (nitems == 0) {
  ------------------
  |  Branch (1562:7): [True: 0, False: 6]
  ------------------
 1563|      0|    return 0;
 1564|      0|  }
 1565|       |
 1566|      6|  if (typesize == 4) {
  ------------------
  |  Branch (1566:7): [True: 3, False: 3]
  ------------------
 1567|      3|    float* dest_ = (float*)dest;
 1568|      3|    float val = nanf("");
 1569|   150k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1569:21): [True: 150k, False: 3]
  ------------------
 1570|   150k|      dest_[i] = val;
 1571|   150k|    }
 1572|      3|    return nitems;
 1573|      3|  }
 1574|      3|  else if (typesize == 8) {
  ------------------
  |  Branch (1574:12): [True: 2, False: 1]
  ------------------
 1575|      2|    double* dest_ = (double*)dest;
 1576|      2|    double val = nan("");
 1577|    259|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1577:21): [True: 257, False: 2]
  ------------------
 1578|    257|      dest_[i] = val;
 1579|    257|    }
 1580|      2|    return nitems;
 1581|      2|  }
 1582|       |
 1583|      1|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1584|      1|  return BLOSC2_ERROR_DATA;
 1585|      6|}
blosc2.c:my_malloc:
  189|  30.9k|static uint8_t* my_malloc(size_t size) {
  190|  30.9k|  void* block = NULL;
  191|  30.9k|  int res = 0;
  192|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  193|  30.9k|  if (size == 0) {
  ------------------
  |  Branch (193:7): [True: 0, False: 30.9k]
  ------------------
  194|      0|    size = 1;
  195|      0|  }
  196|       |
  197|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  198|       |#if defined(_WIN32)
  199|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  200|       |  block = (void *)_aligned_malloc(size, 32);
  201|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  202|       |  /* Platform does have an implementation of posix_memalign */
  203|  30.9k|  res = posix_memalign(&block, 32, size);
  204|       |#else
  205|       |  block = malloc(size);
  206|       |#endif  /* _WIN32 */
  207|       |
  208|  30.9k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (208:7): [True: 0, False: 30.9k]
  |  Branch (208:24): [True: 0, False: 30.9k]
  ------------------
  209|      0|    BLOSC_TRACE_ERROR("Error allocating memory!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|      0|    return NULL;
  211|      0|  }
  212|       |
  213|  30.9k|  return (uint8_t*)block;
  214|  30.9k|}
blosc2.c:blosc_d:
 1663|   220k|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1664|   220k|  blosc2_context* context = thread_context->parent_context;
 1665|   220k|  uint8_t* filters = context->filters;
 1666|   220k|  uint8_t *tmp3 = thread_context->tmp4;
 1667|   220k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1668|   220k|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1669|   220k|  int dont_split = (context->header_flags & 0x10) >> 4;
 1670|   220k|  int32_t chunk_nbytes;
 1671|   220k|  int32_t chunk_cbytes;
 1672|   220k|  int nstreams;
 1673|   220k|  int32_t neblock;
 1674|   220k|  int32_t nbytes;                /* number of decompressed bytes in split */
 1675|   220k|  int32_t cbytes;                /* number of compressed bytes in split */
 1676|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1677|   220k|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1678|   220k|  uint8_t* _dest;
 1679|   220k|  int32_t typesize = context->typesize;
 1680|   220k|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1681|   220k|  const char* compname;
 1682|   220k|  int rc;
 1683|       |
 1684|   220k|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1684:7): [True: 0, False: 220k]
  |  Branch (1684:41): [True: 0, False: 0]
  ------------------
 1685|       |    // Do not decompress, but act as if we successfully decompressed everything
 1686|      0|    return bsize;
 1687|      0|  }
 1688|       |
 1689|   220k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1690|   220k|  if (rc < 0) {
  ------------------
  |  Branch (1690:7): [True: 0, False: 220k]
  ------------------
 1691|      0|    return rc;
 1692|      0|  }
 1693|   220k|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1693:7): [True: 54, False: 220k]
  ------------------
 1694|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1695|     54|    typesize = chunk_cbytes - context->header_overhead;
 1696|     54|  }
 1697|       |
 1698|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1699|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1700|   220k|  if (context->src == NULL) {
  ------------------
  |  Branch (1700:7): [True: 0, False: 220k]
  ------------------
 1701|      0|    context->src = src;
 1702|      0|  }
 1703|       |
 1704|       |  // Chunks with special values cannot be lazy
 1705|   220k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1705:19): [True: 219k, False: 129]
  ------------------
 1706|   219k|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1706:11): [True: 15, False: 219k]
  |  Branch (1706:46): [True: 0, False: 15]
  ------------------
 1707|   220k|  if (is_lazy) {
  ------------------
  |  Branch (1707:7): [True: 0, False: 220k]
  ------------------
 1708|       |    // The chunk is on disk, so just lazily load the block
 1709|      0|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1709:9): [True: 0, False: 0]
  ------------------
 1710|      0|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1711|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1712|      0|    }
 1713|      0|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1713:9): [True: 0, False: 0]
  ------------------
 1714|      0|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1715|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1716|      0|    }
 1717|      0|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1718|      0|    char* urlpath = frame->urlpath;
 1719|      0|    size_t bstarts_nbytes;
 1720|      0|    size_t trailer_offset;
 1721|      0|    size_t block_csizes_nbytes;
 1722|      0|    size_t trailer_meta_nbytes;
 1723|      0|    size_t lazy_trailer_end;
 1724|      0|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1724:9): [True: 0, False: 0]
  |  Branch (1724:24): [True: 0, False: 0]
  ------------------
 1725|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1725:9): [True: 0, False: 0]
  ------------------
 1726|      0|        !checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1726:9): [True: 0, False: 0]
  ------------------
 1727|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1727:9): [True: 0, False: 0]
  ------------------
 1728|      0|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1728:9): [True: 0, False: 0]
  ------------------
 1729|      0|        !checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1729:9): [True: 0, False: 0]
  ------------------
 1730|      0|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1730:9): [True: 0, False: 0]
  ------------------
 1731|      0|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1732|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1733|      0|    }
 1734|      0|    int32_t nchunk;
 1735|      0|    int64_t chunk_offset;
 1736|       |    // The nchunk and the offset of the current chunk are in the trailer
 1737|      0|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1738|      0|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1739|       |    // Get the csize of the nblock
 1740|      0|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1740:9): [True: 0, False: 0]
  |  Branch (1740:23): [True: 0, False: 0]
  ------------------
 1741|      0|      BLOSC_TRACE_ERROR("Invalid block index in lazy trailer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1742|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1743|      0|    }
 1744|      0|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1745|      0|    int32_t block_csize = block_csizes[nblock];
 1746|      0|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1747|      0|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1747:9): [True: 0, False: 0]
  |  Branch (1747:29): [True: 0, False: 0]
  ------------------
 1748|      0|      BLOSC_TRACE_ERROR("Invalid lazy block size in trailer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1749|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1750|      0|    }
 1751|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1751:9): [True: 0, False: 0]
  |  Branch (1751:21): [True: 0, False: 0]
  ------------------
 1752|      0|      BLOSC_TRACE_ERROR("Lazy VL block compressed size is too small.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1753|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1754|      0|    }
 1755|       |    // Read the lazy block on disk
 1756|      0|    void* fp = NULL;
 1757|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1758|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1758:9): [True: 0, False: 0]
  ------------------
 1759|      0|      BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1760|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1761|      0|    }
 1762|       |
 1763|      0|    int64_t io_pos = 0;
 1764|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1764:9): [True: 0, False: 0]
  ------------------
 1765|       |      // The chunk is not in the frame
 1766|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1767|      0|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1768|       |      // The offset of the block is src_offset
 1769|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1769:11): [True: 0, False: 0]
  ------------------
 1770|      0|        io_cb->close(fp);
 1771|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1772|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1773|      0|      }
 1774|      0|      io_pos = src_offset;
 1775|      0|    }
 1776|      0|    else {
 1777|      0|      fp = io_cb->open(urlpath, "rb", context->schunk->storage->io->params);
 1778|      0|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1779|       |      // The offset of the block is src_offset
 1780|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1780:11): [True: 0, False: 0]
  ------------------
 1781|      0|        io_cb->close(fp);
 1782|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1783|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1784|      0|      }
 1785|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1785:11): [True: 0, False: 0]
  ------------------
 1786|      0|        io_cb->close(fp);
 1787|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1788|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1789|      0|      }
 1790|      0|      if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (1790:11): [True: 0, False: 0]
  ------------------
 1791|      0|        io_cb->close(fp);
 1792|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1793|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1794|      0|      }
 1795|      0|      io_pos = frame->file_offset + chunk_offset;
 1796|      0|      if (io_pos > INT64_MAX - src_offset) {
  ------------------
  |  Branch (1796:11): [True: 0, False: 0]
  ------------------
 1797|      0|        io_cb->close(fp);
 1798|      0|        BLOSC_TRACE_ERROR("Lazy block offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1799|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1800|      0|      }
 1801|      0|      io_pos += src_offset;
 1802|      0|    }
 1803|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1804|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1805|      0|    io_cb->close(fp);
 1806|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1806:9): [True: 0, False: 0]
  ------------------
 1807|      0|      BLOSC_TRACE_ERROR("Cannot read the (lazy) block out of the fileframe.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1808|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1809|      0|    }
 1810|      0|    src = tmp3;
 1811|      0|    src_offset = 0;
 1812|      0|    srcsize = block_csize;
 1813|      0|  }
 1814|       |
 1815|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1816|   220k|  if (memcpyed) {
  ------------------
  |  Branch (1816:7): [True: 216k, False: 3.53k]
  ------------------
 1817|   216k|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1817:18): [True: 40, False: 216k]
  ------------------
 1818|   216k|    if (!context->special_type) {
  ------------------
  |  Branch (1818:9): [True: 595, False: 215k]
  ------------------
 1819|    595|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1819:11): [True: 0, False: 595]
  ------------------
 1820|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1821|      0|      }
 1822|    595|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1822:11): [True: 0, False: 595]
  ------------------
 1823|       |        /* Not enough input to copy block */
 1824|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1825|      0|      }
 1826|    595|    }
 1827|   216k|    if (!is_lazy) {
  ------------------
  |  Branch (1827:9): [True: 216k, False: 0]
  ------------------
 1828|   216k|      src += context->header_overhead + nblock * context->blocksize;
 1829|   216k|    }
 1830|   216k|    _dest = dest + dest_offset;
 1831|   216k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1831:9): [True: 0, False: 216k]
  ------------------
 1832|       |      // We are making use of a postfilter, so use a temp for destination
 1833|      0|      _dest = tmp;
 1834|      0|    }
 1835|   216k|    rc = 0;
 1836|   216k|    switch (context->special_type) {
 1837|     54|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1837:7): [True: 54, False: 216k]
  ------------------
 1838|       |        // All repeated values
 1839|     54|        rc = set_values(typesize, context->src, _dest, bsize_);
 1840|     54|        if (rc < 0) {
  ------------------
  |  Branch (1840:13): [True: 0, False: 54]
  ------------------
 1841|      0|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1842|      0|          return BLOSC2_ERROR_DATA;
 1843|      0|        }
 1844|     54|        break;
 1845|     54|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1845:7): [True: 5, False: 216k]
  ------------------
 1846|      5|        rc = set_nans(context->typesize, _dest, bsize_);
 1847|      5|        if (rc < 0) {
  ------------------
  |  Branch (1847:13): [True: 1, False: 4]
  ------------------
 1848|      1|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1849|      1|          return BLOSC2_ERROR_DATA;
 1850|      1|        }
 1851|      4|        break;
 1852|   215k|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1852:7): [True: 215k, False: 657]
  ------------------
 1853|   215k|        memset(_dest, 0, bsize_);
 1854|   215k|        break;
 1855|      3|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1855:7): [True: 3, False: 216k]
  ------------------
 1856|       |        // We do nothing here
 1857|      3|        break;
 1858|    595|      default:
  ------------------
  |  Branch (1858:7): [True: 595, False: 215k]
  ------------------
 1859|    595|        memcpy(_dest, src, bsize_);
 1860|   216k|    }
 1861|   216k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1861:9): [True: 0, False: 216k]
  ------------------
 1862|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1863|      0|      blosc2_postfilter_params postparams;
 1864|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1865|      0|      postparams.input = tmp;
 1866|      0|      postparams.output = dest + dest_offset;
 1867|      0|      postparams.size = bsize;
 1868|      0|      postparams.typesize = typesize;
 1869|      0|      postparams.offset = nblock * context->blocksize;
 1870|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1870:27): [True: 0, False: 0]
  ------------------
 1871|      0|      postparams.nblock = nblock;
 1872|      0|      postparams.tid = thread_context->tid;
 1873|      0|      postparams.ttmp = thread_context->tmp;
 1874|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1875|      0|      postparams.ctx = context;
 1876|       |
 1877|       |      // Execute the postfilter (the processed block will be copied to dest)
 1878|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1878:11): [True: 0, False: 0]
  ------------------
 1879|      0|        BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1880|      0|        return BLOSC2_ERROR_POSTFILTER;
 1881|      0|      }
 1882|      0|    }
 1883|   216k|    thread_context->zfp_cell_nitems = 0;
 1884|       |
 1885|   216k|    return bsize_;
 1886|   216k|  }
 1887|       |
 1888|  3.53k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1888:7): [True: 3.53k, False: 0]
  |  Branch (1888:20): [True: 44, False: 3.49k]
  |  Branch (1888:39): [True: 43, False: 3.45k]
  ------------------
 1889|       |    /* Invalid block src offset encountered */
 1890|     87|    return BLOSC2_ERROR_DATA;
 1891|     87|  }
 1892|       |
 1893|  3.45k|  src += src_offset;
 1894|  3.45k|  if (vlblocks) {
  ------------------
  |  Branch (1894:7): [True: 0, False: 3.45k]
  ------------------
 1895|      0|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1895:9): [True: 0, False: 0]
  |  Branch (1895:41): [True: 0, False: 0]
  ------------------
 1896|      0|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1896:9): [True: 0, False: 0]
  ------------------
 1897|      0|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1897:9): [True: 0, False: 0]
  ------------------
 1898|      0|      return BLOSC2_ERROR_DATA;
 1899|      0|    }
 1900|      0|    srcsize = context->blockcbytes[nblock];
 1901|      0|  }
 1902|  3.45k|  else {
 1903|  3.45k|    srcsize -= src_offset;
 1904|  3.45k|  }
 1905|       |
 1906|  3.45k|  int last_filter_index = last_filter(filters, 'd');
 1907|  3.45k|  if (instr_codec) {
  ------------------
  |  Branch (1907:7): [True: 751, False: 2.69k]
  ------------------
 1908|       |    // If instrumented, we don't want to run the filters
 1909|    751|    _dest = dest + dest_offset;
 1910|    751|  }
 1911|  2.69k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1911:13): [True: 2.65k, False: 44]
  ------------------
 1912|  2.65k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1912:8): [True: 2.47k, False: 177]
  ------------------
 1913|  2.47k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1913:5): [True: 0, False: 221]
  ------------------
 1914|       |    // We are making use of some filter, so use a temp for destination
 1915|  2.47k|    _dest = tmp;
 1916|  2.47k|  }
 1917|    221|  else {
 1918|       |    // If no filters, or only DELTA in pipeline
 1919|    221|    _dest = dest + dest_offset;
 1920|    221|  }
 1921|       |
 1922|       |  /* The number of compressed data streams for this block */
 1923|  3.45k|  if (vlblocks) {
  ------------------
  |  Branch (1923:7): [True: 0, False: 3.45k]
  ------------------
 1924|      0|    nstreams = 1;
 1925|      0|  }
 1926|  3.45k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1926:12): [True: 674, False: 2.77k]
  |  Branch (1926:27): [True: 671, False: 3]
  ------------------
 1927|    671|    nstreams = context->typesize;
 1928|    671|  }
 1929|  2.77k|  else {
 1930|  2.77k|    nstreams = 1;
 1931|  2.77k|  }
 1932|       |
 1933|  3.45k|  neblock = bsize / nstreams;
 1934|  3.45k|  if (neblock == 0) {
  ------------------
  |  Branch (1934:7): [True: 0, False: 3.45k]
  ------------------
 1935|       |    /* Not enough space to output bytes */
 1936|      0|    BLOSC_ERROR(BLOSC2_ERROR_WRITE_BUFFER);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1937|      0|  }
 1938|  4.49k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (1938:19): [True: 3.60k, False: 886]
  ------------------
 1939|  3.60k|    if (vlblocks) {
  ------------------
  |  Branch (1939:9): [True: 0, False: 3.60k]
  ------------------
 1940|      0|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1940:11): [True: 0, False: 0]
  ------------------
 1941|       |        /* Not enough input to read compressed bytes */
 1942|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1943|      0|      }
 1944|      0|      neblock = sw32_(src);
 1945|      0|      if (neblock != bsize) {
  ------------------
  |  Branch (1945:11): [True: 0, False: 0]
  ------------------
 1946|      0|        return BLOSC2_ERROR_DATA;
 1947|      0|      }
 1948|      0|      src += sizeof(int32_t);
 1949|      0|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 1950|      0|      srcsize = 0;
 1951|      0|    }
 1952|  3.60k|    else {
 1953|  3.60k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1953:11): [True: 2, False: 3.60k]
  ------------------
 1954|       |        /* Not enough input to read compressed size */
 1955|      2|        return BLOSC2_ERROR_READ_BUFFER;
 1956|      2|      }
 1957|  3.60k|      srcsize -= sizeof(int32_t);
 1958|  3.60k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 1959|  3.60k|      if (cbytes > 0) {
  ------------------
  |  Branch (1959:11): [True: 2.79k, False: 811]
  ------------------
 1960|  2.79k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (1960:13): [True: 14, False: 2.77k]
  ------------------
 1961|       |          /* Not enough input to read compressed bytes */
 1962|     14|          return BLOSC2_ERROR_READ_BUFFER;
 1963|     14|        }
 1964|  2.77k|        srcsize -= cbytes;
 1965|  2.77k|      }
 1966|  3.58k|      src += sizeof(int32_t);
 1967|  3.58k|    }
 1968|       |    // ctbytes += (signed)sizeof(int32_t);
 1969|       |
 1970|       |    /* Uncompress */
 1971|  3.58k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (1971:9): [True: 3.58k, False: 0]
  |  Branch (1971:22): [True: 464, False: 3.12k]
  ------------------
 1972|       |      // A run of 0's
 1973|    464|      memset(_dest, 0, (unsigned int)neblock);
 1974|    464|      nbytes = neblock;
 1975|    464|    }
 1976|  3.12k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (1976:14): [True: 3.12k, False: 0]
  |  Branch (1976:27): [True: 347, False: 2.77k]
  ------------------
 1977|       |      // A negative number means some encoding depending on the token that comes next
 1978|    347|      uint8_t token;
 1979|       |
 1980|    347|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (1980:11): [True: 2, False: 345]
  ------------------
 1981|       |        // Not enough input to read token */
 1982|      2|        return BLOSC2_ERROR_READ_BUFFER;
 1983|      2|      }
 1984|    345|      srcsize -= sizeof(uint8_t);
 1985|       |
 1986|    345|      token = src[0];
 1987|    345|      src += 1;
 1988|       |      // ctbytes += 1;
 1989|       |
 1990|    345|      if (token & 0x1) {
  ------------------
  |  Branch (1990:11): [True: 343, False: 2]
  ------------------
 1991|       |        // A run of bytes that are different than 0
 1992|    343|        if (cbytes < -255) {
  ------------------
  |  Branch (1992:13): [True: 29, False: 314]
  ------------------
 1993|       |          // Runs can only encode a byte
 1994|     29|          return BLOSC2_ERROR_RUN_LENGTH;
 1995|     29|        }
 1996|    314|        uint8_t value = -cbytes;
 1997|    314|        memset(_dest, value, (unsigned int)neblock);
 1998|    314|      } else {
 1999|      2|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|      2|        return BLOSC2_ERROR_RUN_LENGTH;
 2001|      2|      }
 2002|    314|      nbytes = neblock;
 2003|    314|      cbytes = 0;  // everything is encoded in the cbytes token
 2004|    314|    }
 2005|  2.77k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2005:14): [True: 0, False: 2.77k]
  ------------------
 2006|      0|      memcpy(_dest, src, (unsigned int)neblock);
 2007|      0|      nbytes = (int32_t)neblock;
 2008|      0|    }
 2009|  2.77k|    else {
 2010|  2.77k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2010:11): [True: 201, False: 2.57k]
  ------------------
 2011|    201|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2012|    201|      }
 2013|  2.57k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2013:16): [True: 199, False: 2.37k]
  ------------------
 2014|    199|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2015|    199|                                     (char*)_dest, (size_t)neblock,
 2016|    199|                                     thread_context);
 2017|    199|      }
 2018|  2.37k|  #if defined(HAVE_ZLIB)
 2019|  2.37k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2019:16): [True: 499, False: 1.87k]
  ------------------
 2020|    499|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2021|    499|                                      (char*)_dest, (size_t)neblock);
 2022|    499|      }
 2023|  1.87k|  #endif /*  HAVE_ZLIB */
 2024|  1.87k|  #if defined(HAVE_ZSTD)
 2025|  1.87k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2025:16): [True: 1.63k, False: 241]
  ------------------
 2026|  1.63k|        nbytes = zstd_wrap_decompress(thread_context,
 2027|  1.63k|                                      (char*)src, (size_t)cbytes,
 2028|  1.63k|                                      (char*)_dest, (size_t)neblock);
 2029|  1.63k|      }
 2030|    241|  #endif /*  HAVE_ZSTD */
 2031|    241|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2031:16): [True: 240, False: 1]
  ------------------
 2032|    240|        bool getcell = false;
 2033|       |
 2034|    240|#if defined(HAVE_ZFP)
 2035|    240|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2035:13): [True: 0, False: 240]
  ------------------
 2036|      0|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2036:13): [True: 0, False: 0]
  ------------------
 2037|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2038|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2038:15): [True: 0, False: 0]
  ------------------
 2039|      0|            return BLOSC2_ERROR_DATA;
 2040|      0|          }
 2041|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2041:15): [True: 0, False: 0]
  ------------------
 2042|      0|            getcell = true;
 2043|      0|          }
 2044|      0|        }
 2045|    240|#endif /* HAVE_ZFP */
 2046|    240|        if (!getcell) {
  ------------------
  |  Branch (2046:13): [True: 240, False: 0]
  ------------------
 2047|    240|          thread_context->zfp_cell_nitems = 0;
 2048|    277|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2048:27): [True: 273, False: 4]
  ------------------
 2049|    273|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2049:17): [True: 236, False: 37]
  ------------------
 2050|    236|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2050:19): [True: 1, False: 235]
  ------------------
 2051|       |                // Dynamically load codec plugin
 2052|      1|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2052:21): [True: 1, False: 0]
  ------------------
 2053|      1|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2054|      1|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2055|      1|                }
 2056|      1|              }
 2057|    235|              blosc2_dparams dparams;
 2058|    235|              blosc2_ctx_get_dparams(context, &dparams);
 2059|    235|              nbytes = g_codecs[i].decoder(src,
 2060|    235|                                           cbytes,
 2061|    235|                                           _dest,
 2062|    235|                                           neblock,
 2063|    235|                                           context->compcode_meta,
 2064|    235|                                           &dparams,
 2065|    235|                                           context->src);
 2066|    235|              goto urcodecsuccess;
 2067|    236|            }
 2068|    273|          }
 2069|      4|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2070|      4|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2071|    240|        }
 2072|    235|      urcodecsuccess:
 2073|    235|        ;
 2074|    235|      }
 2075|      1|      else {
 2076|      1|        compname = clibcode_to_clibname(compformat);
 2077|      1|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2078|      1|                "Blosc has not been compiled with decompression "
 2079|      1|                "support for '%s' format.  "
 2080|      1|                "Please recompile for adding this support.", compname);
 2081|      1|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2082|      1|      }
 2083|       |
 2084|       |      /* Check that decompressed bytes number is correct */
 2085|  2.77k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2085:11): [True: 2.50k, False: 263]
  |  Branch (2085:34): [True: 2.50k, False: 0]
  ------------------
 2086|  2.50k|        return BLOSC2_ERROR_DATA;
 2087|  2.50k|      }
 2088|       |
 2089|  2.77k|    }
 2090|  1.04k|    src += cbytes;
 2091|       |    // ctbytes += cbytes;
 2092|  1.04k|    _dest += nbytes;
 2093|  1.04k|    ntbytes += nbytes;
 2094|  1.04k|  } /* Closes j < nstreams */
 2095|       |
 2096|    886|  if (!instr_codec) {
  ------------------
  |  Branch (2096:7): [True: 861, False: 25]
  ------------------
 2097|    861|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2097:9): [True: 855, False: 6]
  |  Branch (2097:35): [True: 0, False: 6]
  ------------------
 2098|       |      /* Apply regular filter pipeline */
 2099|    855|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2100|    855|                                      last_filter_index, nblock);
 2101|    855|      if (errcode < 0)
  ------------------
  |  Branch (2101:11): [True: 111, False: 744]
  ------------------
 2102|    111|        return errcode;
 2103|    855|    }
 2104|    861|  }
 2105|       |
 2106|       |  /* Return the number of uncompressed bytes */
 2107|    775|  return (int)ntbytes;
 2108|    886|}
blosc2.c:lz4_wrap_decompress:
  447|    199|                               struct thread_context* thread_context) {
  448|    199|  int nbytes;
  449|    199|  blosc2_context* context = thread_context->parent_context;
  450|    199|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (450:7): [True: 15, False: 184]
  |  Branch (450:28): [True: 15, False: 0]
  |  Branch (450:60): [True: 15, False: 0]
  ------------------
  451|     15|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  452|     15|                                           (int)compressed_length, (int)maxout,
  453|     15|                                           (const char*)context->dict_buffer,
  454|     15|                                           (int)context->dict_size);
  455|    184|  } else {
  456|    184|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  457|    184|  }
  458|    199|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (458:7): [True: 139, False: 60]
  ------------------
  459|    139|    return 0;
  460|    139|  }
  461|     60|  return (int)maxout;
  462|    199|}
blosc2.c:zlib_wrap_decompress:
  486|    499|                                char* output, size_t maxout) {
  487|    499|  int status;
  488|    499|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  489|    499|  size_t ul = maxout;
  490|    499|  status = zng_uncompress(
  491|    499|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  492|       |#else
  493|       |  uLongf ul = (uLongf)maxout;
  494|       |  status = uncompress(
  495|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  496|       |#endif
  497|    499|  if (status != Z_OK) {
  ------------------
  |  |  180|    499|#define Z_OK            0
  ------------------
  |  Branch (497:7): [True: 458, False: 41]
  ------------------
  498|    458|    return 0;
  499|    458|  }
  500|     41|  return (int)ul;
  501|    499|}
blosc2.c:zstd_wrap_decompress:
  538|  1.63k|                                char* output, size_t maxout) {
  539|  1.63k|  size_t code;
  540|  1.63k|  blosc2_context* context = thread_context->parent_context;
  541|       |
  542|  1.63k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (542:7): [True: 1.58k, False: 57]
  ------------------
  543|  1.58k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  544|  1.58k|  }
  545|       |
  546|  1.63k|  if (context->use_dict) {
  ------------------
  |  Branch (546:7): [True: 6, False: 1.63k]
  ------------------
  547|      6|    assert(context->dict_ddict != NULL);
  548|      6|    code = ZSTD_decompress_usingDDict(
  549|      6|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  550|      6|            compressed_length, context->dict_ddict);
  551|  1.63k|  } else {
  552|  1.63k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  553|  1.63k|        (void*)output, maxout, (void*)input, compressed_length);
  554|  1.63k|  }
  555|  1.63k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (555:7): [True: 1.57k, False: 64]
  ------------------
  556|  1.57k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  1.57k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  1.57k|    do {                                            \
  |  |  |  |   98|  1.57k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  1.57k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1.57k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  1.57k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  557|  1.57k|                      ZDICT_getErrorName(code));
  558|  1.57k|    return 0;
  559|  1.57k|  }
  560|     64|  return (int)code;
  561|  1.63k|}
blosc2.c:blosc2_initialize_context_from_header:
  806|  5.71k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  807|  5.71k|  context->header_flags = header->flags;
  808|  5.71k|  context->typesize = header->typesize;
  809|  5.71k|  context->sourcesize = header->nbytes;
  810|  5.71k|  context->header_blocksize = header->blocksize;
  811|  5.71k|  context->blocksize = header->blocksize;
  812|  5.71k|  context->blosc2_flags2 = header->blosc2_flags2;
  813|  5.71k|  context->blosc2_flags = header->blosc2_flags;
  814|  5.71k|  context->compcode = header->flags >> 5;
  815|  5.71k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (815:7): [True: 569, False: 5.14k]
  ------------------
  816|    569|    context->compcode = header->udcompcode;
  817|    569|  }
  818|  5.71k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (818:7): [True: 2, False: 5.70k]
  ------------------
  819|      2|    context->nblocks = header->blocksize;
  820|      2|    context->leftover = 0;
  821|      2|    context->blocksize = 0;
  822|      2|  }
  823|  5.70k|  else {
  824|  5.70k|    blosc2_calculate_blocks(context);
  825|  5.70k|  }
  826|       |
  827|  5.71k|  bool is_lazy = false;
  828|  5.71k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (828:7): [True: 5.53k, False: 174]
  ------------------
  829|  5.53k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (829:7): [True: 5.37k, False: 164]
  ------------------
  830|       |    /* Extended header */
  831|  5.37k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  832|       |
  833|  5.37k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  834|  5.37k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  835|  5.37k|    context->compcode_meta = header->compcode_meta;
  836|       |
  837|  5.37k|    context->filter_flags = filters_to_flags(header->filters);
  838|  5.37k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  839|       |
  840|  5.37k|    is_lazy = (context->blosc2_flags & 0x08u);
  841|  5.37k|  }
  842|    338|  else {
  843|    338|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  844|    338|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  845|    338|    flags_to_filters(context->header_flags, context->filters);
  846|    338|  }
  847|       |
  848|       |  // Some checks for malformed headers
  849|  5.71k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (849:7): [True: 5.68k, False: 26]
  |  Branch (849:19): [True: 0, False: 5.68k]
  ------------------
  850|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  851|      0|  }
  852|       |
  853|  5.71k|  return 0;
  854|  5.71k|}
blosc2.c:get_filter_flags:
  648|    338|                                const int32_t typesize) {
  649|    338|  uint8_t flags = 0;
  650|       |
  651|    338|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (651:7): [True: 164, False: 174]
  |  Branch (651:43): [True: 148, False: 16]
  ------------------
  652|    148|    flags |= BLOSC_DOSHUFFLE;
  653|    148|  }
  654|    338|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (654:7): [True: 59, False: 279]
  ------------------
  655|     59|    flags |= BLOSC_DOBITSHUFFLE;
  656|     59|  }
  657|    338|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (657:7): [True: 145, False: 193]
  ------------------
  658|    145|    flags |= BLOSC_DODELTA;
  659|    145|  }
  660|    338|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (660:7): [True: 201, False: 137]
  ------------------
  661|    201|    flags |= BLOSC_MEMCPYED;
  662|    201|  }
  663|    338|  return flags;
  664|    338|}
blosc2.c:create_thread_context:
 2215|  4.45k|create_thread_context(blosc2_context* context, int32_t tid) {
 2216|  4.45k|  struct thread_context* thread_context;
 2217|  4.45k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2218|  4.45k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  4.45k|    do {                                            \
  |  |  105|  4.45k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 4.45k]
  |  |  ------------------
  |  |  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|  4.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 4.45k]
  |  |  ------------------
  ------------------
 2219|  4.45k|  int rc = init_thread_context(thread_context, context, tid);
 2220|  4.45k|  if (rc < 0) {
  ------------------
  |  Branch (2220:7): [True: 0, False: 4.45k]
  ------------------
 2221|      0|    return NULL;
 2222|      0|  }
 2223|  4.45k|  return thread_context;
 2224|  4.45k|}
blosc2.c:init_thread_context:
 2185|  4.45k|{
 2186|  4.45k|  int32_t ebsize;
 2187|       |
 2188|  4.45k|  thread_context->parent_context = context;
 2189|  4.45k|  thread_context->owner_pool = NULL;
 2190|  4.45k|  thread_context->tid = tid;
 2191|       |
 2192|  4.45k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2192:23): [True: 4.45k, False: 0]
  ------------------
 2193|  4.45k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2193:22): [True: 4.45k, False: 0]
  ------------------
 2194|  4.45k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2195|  4.45k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2196|  4.45k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2197|  4.45k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  4.45k|    do {                                            \
  |  |  105|  4.45k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 4.45k]
  |  |  ------------------
  |  |  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|  4.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 4.45k]
  |  |  ------------------
  ------------------
 2198|  4.45k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2199|  4.45k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2200|  4.45k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2201|  4.45k|  thread_context->tmp_blocksize = blocksize;
 2202|  4.45k|  thread_context->zfp_cell_nitems = 0;
 2203|  4.45k|  thread_context->zfp_cell_start = 0;
 2204|  4.45k|  #if defined(HAVE_ZSTD)
 2205|  4.45k|  thread_context->zstd_cctx = NULL;
 2206|  4.45k|  thread_context->zstd_dctx = NULL;
 2207|  4.45k|  #endif
 2208|  4.45k|  thread_context->lz4_cstream = NULL;
 2209|  4.45k|  thread_context->lz4hc_cstream = NULL;
 2210|       |
 2211|  4.45k|  return 0;
 2212|  4.45k|}
blosc2.c:release_thread_backend:
 5152|  22.0k|static int release_thread_backend(blosc2_context *context) {
 5153|  22.0k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|  44.1k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5153:7): [True: 0, False: 22.0k]
  |  Branch (5153:60): [True: 0, False: 0]
  ------------------
 5154|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5154:25): [True: 0, False: 0]
  ------------------
 5155|      0|      destroy_thread_context(context->thread_contexts + t);
 5156|      0|    }
 5157|      0|    my_free(context->thread_contexts);
 5158|      0|    context->thread_contexts = NULL;
 5159|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5160|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5161|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5162|      0|  }
 5163|       |#if defined(_WIN32)
 5164|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5165|       |    /* Signal all workers to exit. */
 5166|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5167|       |    context->end_threads = 1;
 5168|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5169|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5170|       |
 5171|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5172|       |      blosc2_pthread_join(context->threads[t], NULL);
 5173|       |    }
 5174|       |    my_free(context->threads);
 5175|       |    context->threads = NULL;
 5176|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5177|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5178|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5179|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5180|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5181|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5182|       |  }
 5183|       |#endif  /* _WIN32 */
 5184|  22.0k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|  44.1k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5184:12): [True: 0, False: 22.0k]
  |  Branch (5184:68): [True: 0, False: 0]
  ------------------
 5185|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5186|      0|    struct blosc_shared_pool **prev;
 5187|      0|    bool destroy_pool = false;
 5188|       |
 5189|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5189:9): [True: 0, False: 0]
  ------------------
 5190|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5191|       |       * Just clear the dangling pointer; nothing else to do. */
 5192|      0|      context->thread_pool = NULL;
 5193|      0|      context->threads_started = 0;
 5194|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5195|      0|      return 0;
 5196|      0|    }
 5197|       |
 5198|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5199|      0|    pool->context_refs--;
 5200|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5200:9): [True: 0, False: 0]
  ------------------
 5201|       |      /* Check pool-internal state under the pool's own mutex */
 5202|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5203|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5203:20): [True: 0, False: 0]
  |  Branch (5203:46): [True: 0, False: 0]
  ------------------
 5204|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5205|      0|      if (idle) {
  ------------------
  |  Branch (5205:11): [True: 0, False: 0]
  ------------------
 5206|      0|        prev = &shared_pools;
 5207|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5207:16): [True: 0, False: 0]
  |  Branch (5207:33): [True: 0, False: 0]
  ------------------
 5208|      0|          prev = &(*prev)->next;
 5209|      0|        }
 5210|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5210:13): [True: 0, False: 0]
  ------------------
 5211|      0|          *prev = pool->next;
 5212|      0|        }
 5213|      0|        destroy_pool = true;
 5214|      0|      }
 5215|      0|    }
 5216|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5217|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5217:9): [True: 0, False: 0]
  ------------------
 5218|      0|      destroy_shared_pool(pool);
 5219|      0|    }
 5220|      0|    context->thread_pool = NULL;
 5221|      0|  }
 5222|       |
 5223|  22.0k|  context->threads_started = 0;
 5224|  22.0k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  22.0k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5225|  22.0k|  return 0;
 5226|  22.0k|}
blosc2.c:release_context_dict_buffer:
 2486|  26.9k|static void release_context_dict_buffer(blosc2_context* context) {
 2487|  26.9k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2487:7): [True: 0, False: 26.9k]
  |  Branch (2487:37): [True: 0, False: 0]
  ------------------
 2488|      0|    free(context->dict_buffer);
 2489|      0|  }
 2490|  26.9k|  context->dict_buffer = NULL;
 2491|       |  context->dict_buffer_owned = false;
 2492|  26.9k|  context->dict_size = 0;
 2493|  26.9k|}

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

delta_decoder:
   97|    725|                   int32_t typesize, uint8_t* dest) {
   98|    725|  int32_t i;
   99|       |
  100|    725|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 552, False: 173]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|    552|    switch (typesize) {
  103|    129|      case 1:
  ------------------
  |  Branch (103:7): [True: 129, False: 423]
  ------------------
  104|   793M|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 793M, False: 129]
  ------------------
  105|   793M|          dest[i] ^= dref[i-1];
  106|   793M|        }
  107|    129|        break;
  108|     73|      case 2:
  ------------------
  |  Branch (108:7): [True: 73, False: 479]
  ------------------
  109|  58.5M|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 58.5M, False: 73]
  ------------------
  110|  58.5M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|  58.5M|        }
  112|     73|        break;
  113|     49|      case 4:
  ------------------
  |  Branch (113:7): [True: 49, False: 503]
  ------------------
  114|  39.4M|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 39.4M, False: 49]
  ------------------
  115|  39.4M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|  39.4M|        }
  117|     49|        break;
  118|    208|      case 8:
  ------------------
  |  Branch (118:7): [True: 208, False: 344]
  ------------------
  119|  40.8M|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 40.8M, False: 208]
  ------------------
  120|  40.8M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|  40.8M|        }
  122|    208|        break;
  123|     93|      default:
  ------------------
  |  Branch (123:7): [True: 93, False: 459]
  ------------------
  124|     93|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 1, False: 92]
  ------------------
  125|      1|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|     92|        } else {
  127|     92|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|     92|        }
  129|    552|    }
  130|    552|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|    173|    switch (typesize) {
  133|     38|      case 1:
  ------------------
  |  Branch (133:7): [True: 38, False: 135]
  ------------------
  134|  8.04k|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 8.00k, False: 38]
  ------------------
  135|  8.00k|          dest[i] ^= dref[i];
  136|  8.00k|        }
  137|     38|        break;
  138|     24|      case 2:
  ------------------
  |  Branch (138:7): [True: 24, False: 149]
  ------------------
  139|  1.91k|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 1.89k, False: 24]
  ------------------
  140|  1.89k|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  1.89k|        }
  142|     24|        break;
  143|     15|      case 4:
  ------------------
  |  Branch (143:7): [True: 15, False: 158]
  ------------------
  144|  18.2k|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 18.2k, False: 15]
  ------------------
  145|  18.2k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|  18.2k|        }
  147|     15|        break;
  148|     66|      case 8:
  ------------------
  |  Branch (148:7): [True: 66, False: 107]
  ------------------
  149|  5.17M|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 5.17M, False: 66]
  ------------------
  150|  5.17M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|  5.17M|        }
  152|     66|        break;
  153|     30|      default:
  ------------------
  |  Branch (153:7): [True: 30, False: 143]
  ------------------
  154|     30|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 0, False: 30]
  ------------------
  155|      0|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|     30|        } else {
  157|     30|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|     30|        }
  159|    173|    }
  160|    173|  }
  161|    725|}

fastcopy:
  504|     91|unsigned char *fastcopy(unsigned char *out, const unsigned char *from, unsigned len) {
  505|     91|  switch (len) {
  506|      0|    case 32:
  ------------------
  |  Branch (506:5): [True: 0, False: 91]
  ------------------
  507|      0|      return copy_32_bytes(out, from);
  508|      1|    case 16:
  ------------------
  |  Branch (508:5): [True: 1, False: 90]
  ------------------
  509|      1|      return copy_16_bytes(out, from);
  510|      0|    case 8:
  ------------------
  |  Branch (510:5): [True: 0, False: 91]
  ------------------
  511|      0|      return copy_8_bytes(out, from);
  512|     90|    default: {
  ------------------
  |  Branch (512:5): [True: 90, False: 1]
  ------------------
  513|     90|    }
  514|     91|  }
  515|     90|  if (len < 8) {
  ------------------
  |  Branch (515:7): [True: 12, False: 78]
  ------------------
  516|     12|    return copy_bytes(out, from, len);
  517|     12|  }
  518|     78|#if defined(__SSE2__)
  519|     78|  if (len < 16) {
  ------------------
  |  Branch (519:7): [True: 1, False: 77]
  ------------------
  520|      1|    return chunk_memcpy(out, from, len);
  521|      1|  }
  522|     77|#if !defined(__AVX2__)
  523|     77|  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|     78|}
copy_match:
  537|  1.12k|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.12k|  unsigned overlap_dist = (unsigned) (out - from);
  556|  1.12k|  if (overlap_dist > sz) {
  ------------------
  |  Branch (556:7): [True: 91, False: 1.03k]
  ------------------
  557|     91|    return fastcopy(out, from, len);
  558|     91|  }
  559|       |
  560|       |  // Otherwise we need to be more careful so as not to overwrite destination
  561|  1.03k|  switch (overlap_dist) {
  562|      0|    case 32:
  ------------------
  |  Branch (562:5): [True: 0, False: 1.03k]
  ------------------
  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.03k]
  ------------------
  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.03k]
  ------------------
  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.03k]
  ------------------
  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.03k]
  ------------------
  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.03k]
  ------------------
  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.03k]
  ------------------
  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.03k]
  ------------------
  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|      0|    case 16:
  ------------------
  |  Branch (614:5): [True: 0, False: 1.03k]
  ------------------
  615|      0|      for (; len >= 16; len -= 16) {
  ------------------
  |  Branch (615:14): [True: 0, False: 0]
  ------------------
  616|      0|        out = copy_16_bytes(out, from);
  617|      0|      }
  618|      0|      break;
  619|      0|    case 8:
  ------------------
  |  Branch (619:5): [True: 0, False: 1.03k]
  ------------------
  620|      0|      for (; len >= 8; len -= 8) {
  ------------------
  |  Branch (620:14): [True: 0, False: 0]
  ------------------
  621|      0|        out = copy_8_bytes(out, from);
  622|      0|      }
  623|      0|      break;
  624|    328|    case 4:
  ------------------
  |  Branch (624:5): [True: 328, False: 707]
  ------------------
  625|   170k|      for (; len >= 4; len -= 4) {
  ------------------
  |  Branch (625:14): [True: 170k, False: 328]
  ------------------
  626|   170k|        out = copy_4_bytes(out, from);
  627|   170k|      }
  628|    328|      break;
  629|    435|    case 2:
  ------------------
  |  Branch (629:5): [True: 435, False: 600]
  ------------------
  630|   127k|      for (; len >= 2; len -= 2) {
  ------------------
  |  Branch (630:14): [True: 127k, False: 435]
  ------------------
  631|   127k|        out = copy_2_bytes(out, from);
  632|   127k|      }
  633|    435|      break;
  634|    272|    default:
  ------------------
  |  Branch (634:5): [True: 272, False: 763]
  ------------------
  635|  84.2k|      for (; len > 0; len--) {
  ------------------
  |  Branch (635:14): [True: 83.9k, False: 272]
  ------------------
  636|  83.9k|        *out++ = *from++;
  637|  83.9k|      }
  638|  1.03k|  }
  639|       |
  640|       |  // Copy the leftovers
  641|  1.58k|  for (; len > 0; len--) {
  ------------------
  |  Branch (641:10): [True: 552, False: 1.03k]
  ------------------
  642|    552|    *out++ = *from++;
  643|    552|  }
  644|       |
  645|  1.03k|  return out;
  646|  1.03k|}
fastcopy.c:copy_16_bytes:
   98|   151k|static inline unsigned char *copy_16_bytes(unsigned char *out, const unsigned char *from) {
   99|   151k|#if defined(__SSE2__)
  100|   151k|  __m128i chunk;
  101|   151k|  chunk = _mm_loadu_si128((__m128i*)from);
  102|   151k|  _mm_storeu_si128((__m128i*)out, chunk);
  103|   151k|  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|   151k|  return out;
  116|   151k|}
fastcopy.c:copy_8_bytes:
   86|      2|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|  *(uint64_t *) out = *(uint64_t *) from;
   93|      2|#endif
   94|      2|  return out + 8;
   95|      2|}
fastcopy.c:copy_bytes:
  161|     12|static inline unsigned char *copy_bytes(unsigned char *out, const unsigned char *from, unsigned len) {
  162|     12|  assert(len < 8);
  163|       |
  164|       |#ifdef BLOSC_STRICT_ALIGN
  165|       |  while (len--) {
  166|       |    *out++ = *from++;
  167|       |  }
  168|       |#else
  169|     12|  switch (len) {
  170|      0|    case 7:
  ------------------
  |  Branch (170:5): [True: 0, False: 12]
  ------------------
  171|      0|      return copy_7_bytes(out, from);
  172|      3|    case 6:
  ------------------
  |  Branch (172:5): [True: 3, False: 9]
  ------------------
  173|      3|      return copy_6_bytes(out, from);
  174|      2|    case 5:
  ------------------
  |  Branch (174:5): [True: 2, False: 10]
  ------------------
  175|      2|      return copy_5_bytes(out, from);
  176|      3|    case 4:
  ------------------
  |  Branch (176:5): [True: 3, False: 9]
  ------------------
  177|      3|      return copy_4_bytes(out, from);
  178|      4|    case 3:
  ------------------
  |  Branch (178:5): [True: 4, False: 8]
  ------------------
  179|      4|      return copy_3_bytes(out, from);
  180|      0|    case 2:
  ------------------
  |  Branch (180:5): [True: 0, False: 12]
  ------------------
  181|      0|      return copy_2_bytes(out, from);
  182|      0|    case 1:
  ------------------
  |  Branch (182:5): [True: 0, False: 12]
  ------------------
  183|      0|      return copy_1_bytes(out, from);
  184|      0|    case 0:
  ------------------
  |  Branch (184:5): [True: 0, False: 12]
  ------------------
  185|      0|      return out;
  186|      0|    default:
  ------------------
  |  Branch (186:5): [True: 0, False: 12]
  ------------------
  187|      0|      assert(0);
  188|     12|  }
  189|      0|#endif /* BLOSC_STRICT_ALIGN */
  190|      0|  return out;
  191|     12|}
fastcopy.c:copy_6_bytes:
   75|      3|static inline unsigned char *copy_6_bytes(unsigned char *out, const unsigned char *from) {
   76|      3|  out = copy_2_bytes(out, from);
   77|      3|  return copy_4_bytes(out, from + 2);
   78|      3|}
fastcopy.c:copy_5_bytes:
   70|      2|static inline unsigned char *copy_5_bytes(unsigned char *out, const unsigned char *from) {
   71|      2|  out = copy_1_bytes(out, from);
   72|      2|  return copy_4_bytes(out, from + 1);
   73|      2|}
fastcopy.c:copy_3_bytes:
   65|      4|static inline unsigned char *copy_3_bytes(unsigned char *out, const unsigned char *from) {
   66|      4|  out = copy_1_bytes(out, from);
   67|      4|  return copy_2_bytes(out, from + 1);
   68|      4|}
fastcopy.c:copy_1_bytes:
   60|      6|static inline unsigned char *copy_1_bytes(unsigned char *out, const unsigned char *from) {
   61|      6|  *out++ = *from;
   62|      6|  return out;
   63|      6|}
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|     77|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|     77|#endif
  416|     77|  unsigned rem = len % sz;
  417|     77|  unsigned ilen;
  418|       |
  419|     77|  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|     77|#endif
  427|       |
  428|     77|  len /= sz;
  429|     77|  out += rem;
  430|     77|  from += rem;
  431|       |
  432|   151k|  for (ilen = 0; ilen < len; ilen++) {
  ------------------
  |  Branch (432:18): [True: 151k, False: 77]
  ------------------
  433|       |#if defined(__AVX2__)
  434|       |    copy_32_bytes(out, from);
  435|       |#elif defined(__SSE2__)
  436|       |    copy_16_bytes(out, from);
  437|   151k|#endif
  438|   151k|    out += sz;
  439|   151k|    from += sz;
  440|   151k|  }
  441|       |
  442|     77|  return out;
  443|     77|}
fastcopy.c:copy_4_bytes:
   48|   170k|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|   170k|  *(uint32_t *) out = *(uint32_t *) from;
   55|   170k|#endif
   56|   170k|  return out + 4;
   57|   170k|}
fastcopy.c:copy_2_bytes:
   37|   127k|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|   127k|  *(uint16_t *) out = *(uint16_t *) from;
   44|   127k|#endif
   45|   127k|  return out + 2;
   46|   127k|}

frame_free:
   59|  4.86k|int frame_free(blosc2_frame_s* frame) {
   60|       |
   61|  4.86k|  if (frame->cframe != NULL && !frame->avoid_cframe_free) {
  ------------------
  |  Branch (61:7): [True: 4.86k, False: 0]
  |  Branch (61:32): [True: 0, False: 4.86k]
  ------------------
   62|      0|    free(frame->cframe);
   63|      0|  }
   64|       |
   65|  4.86k|  if (frame->coffsets != NULL && frame->coffsets_needs_free) {
  ------------------
  |  Branch (65:7): [True: 0, False: 4.86k]
  |  Branch (65:34): [True: 0, False: 0]
  ------------------
   66|      0|    free(frame->coffsets);
   67|      0|  }
   68|       |
   69|  4.86k|  if (frame->urlpath != NULL) {
  ------------------
  |  Branch (69:7): [True: 0, False: 4.86k]
  ------------------
   70|      0|    free(frame->urlpath);
   71|      0|  }
   72|       |
   73|  4.86k|  free(frame);
   74|       |
   75|  4.86k|  return 0;
   76|  4.86k|}
get_header_info:
  386|  6.04k|                    uint8_t *splitmode, uint8_t *use_dict, const blosc2_io *io) {
  387|  6.04k|  uint8_t* framep = frame->cframe;
  388|  6.04k|  uint8_t* header_ptr;
  389|  6.04k|  uint8_t header[FRAME_HEADER_MINLEN];
  390|       |
  391|  6.04k|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
  392|  6.04k|  if (io_cb == NULL) {
  ------------------
  |  Branch (392:7): [True: 0, False: 6.04k]
  ------------------
  393|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  394|      0|    return BLOSC2_ERROR_PLUGIN_IO;
  395|      0|  }
  396|       |
  397|  6.04k|  if (frame->len <= 0) {
  ------------------
  |  Branch (397:7): [True: 0, False: 6.04k]
  ------------------
  398|      0|    return BLOSC2_ERROR_READ_BUFFER;
  399|      0|  }
  400|       |
  401|  6.04k|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (401:7): [True: 0, False: 6.04k]
  ------------------
  402|      0|    int64_t rbytes = 0;
  403|      0|    void* fp = NULL;
  404|      0|    int64_t io_pos = 0;
  405|      0|    if (frame->sframe) {
  ------------------
  |  Branch (405:9): [True: 0, False: 0]
  ------------------
  406|      0|      fp = sframe_open_index(frame->urlpath, "rb", io);
  407|      0|      if (fp == NULL) {
  ------------------
  |  Branch (407:11): [True: 0, False: 0]
  ------------------
  408|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  409|      0|        return BLOSC2_ERROR_FILE_OPEN;
  410|      0|      }
  411|      0|    }
  412|      0|    else {
  413|      0|      fp = io_cb->open(frame->urlpath, "rb", io->params);
  414|      0|      if (fp == NULL) {
  ------------------
  |  Branch (414:11): [True: 0, False: 0]
  ------------------
  415|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  416|      0|        return BLOSC2_ERROR_FILE_OPEN;
  417|      0|      }
  418|      0|      io_pos = frame->file_offset;
  419|      0|    }
  420|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (420:9): [True: 0, False: 0]
  ------------------
  421|      0|      header_ptr = header;
  422|      0|    rbytes = io_cb->read((void**)&header_ptr, 1, FRAME_HEADER_MINLEN, io_pos, fp);
  ------------------
  |  |   48|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   43|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  423|      0|    io_cb->close(fp);
  424|      0|    if (rbytes != FRAME_HEADER_MINLEN) {
  ------------------
  |  |   48|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   43|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (424:9): [True: 0, False: 0]
  ------------------
  425|      0|      return BLOSC2_ERROR_FILE_READ;
  426|      0|    }
  427|      0|    framep = header_ptr;
  428|      0|  }
  429|       |
  430|       |  // Consistency check for frame type
  431|  6.04k|  uint8_t frame_type = framep[FRAME_TYPE];
  ------------------
  |  |   32|  6.04k|#define FRAME_TYPE (FRAME_FLAGS + 1)  // 26
  |  |  ------------------
  |  |  |  |   31|  6.04k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  6.04k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   29|  6.04k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   28|  6.04k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  432|  6.04k|  uint8_t frame_version = framep[FRAME_FLAGS] & 0x0fu;
  ------------------
  |  |   31|  6.04k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  ------------------
  |  |  |  |   30|  6.04k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  6.04k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|  6.04k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  6.04k|  if (frame_version > BLOSC2_VERSION_FRAME_FORMAT) {
  ------------------
  |  Branch (433:7): [True: 0, False: 6.04k]
  ------------------
  434|      0|    BLOSC_TRACE_ERROR("Unsupported cframe version: %u", frame_version);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  435|      0|    return BLOSC2_ERROR_VERSION_SUPPORT;
  436|      0|  }
  437|  6.04k|  if (frame->sframe) {
  ------------------
  |  Branch (437:7): [True: 0, False: 6.04k]
  ------------------
  438|      0|    if (frame_type != FRAME_DIRECTORY_TYPE) {
  ------------------
  |  |   21|      0|#define FRAME_DIRECTORY_TYPE 1
  ------------------
  |  Branch (438:9): [True: 0, False: 0]
  ------------------
  439|      0|      return BLOSC2_ERROR_FRAME_TYPE;
  440|      0|    }
  441|  6.04k|  } else {
  442|  6.04k|    if (frame_type != FRAME_CONTIGUOUS_TYPE) {
  ------------------
  |  |   20|  6.04k|#define FRAME_CONTIGUOUS_TYPE 0
  ------------------
  |  Branch (442:9): [True: 0, False: 6.04k]
  ------------------
  443|      0|      return BLOSC2_ERROR_FRAME_TYPE;
  444|      0|    }
  445|  6.04k|  }
  446|       |
  447|       |  // Fetch some internal lengths
  448|  6.04k|  from_big(header_len, framep + FRAME_HEADER_LEN, sizeof(*header_len));
  ------------------
  |  |   32|  6.04k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  449|  6.04k|  if (*header_len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   48|  6.04k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   43|  6.04k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  6.04k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  6.04k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  6.04k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  6.04k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  6.04k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  6.04k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  6.04k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  6.04k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  6.04k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  6.04k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  6.04k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  6.04k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (449:7): [True: 1, False: 6.04k]
  ------------------
  450|      1|    BLOSC_TRACE_ERROR("Header length is zero or smaller than min allowed.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  451|      1|    return BLOSC2_ERROR_INVALID_HEADER;
  452|      1|  }
  453|  6.04k|  from_big(frame_len, framep + FRAME_LEN, sizeof(*frame_len));
  ------------------
  |  |   32|  6.04k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  454|  6.04k|  if (*header_len > *frame_len) {
  ------------------
  |  Branch (454:7): [True: 0, False: 6.04k]
  ------------------
  455|      0|    BLOSC_TRACE_ERROR("Header length exceeds length 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  456|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  457|      0|  }
  458|  6.04k|  from_big(nbytes, framep + FRAME_NBYTES, sizeof(*nbytes));
  ------------------
  |  |   32|  6.04k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  459|  6.04k|  from_big(cbytes, framep + FRAME_CBYTES, sizeof(*cbytes));
  ------------------
  |  |   32|  6.04k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  460|  6.04k|  from_big(blocksize, framep + FRAME_BLOCKSIZE, sizeof(*blocksize));
  ------------------
  |  |   32|  6.04k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  461|  6.04k|  if (chunksize != NULL) {
  ------------------
  |  Branch (461:7): [True: 6.04k, False: 0]
  ------------------
  462|  6.04k|    from_big(chunksize, framep + FRAME_CHUNKSIZE, sizeof(*chunksize));
  ------------------
  |  |   32|  6.04k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  463|  6.04k|  }
  464|  6.04k|  if (typesize != NULL) {
  ------------------
  |  Branch (464:7): [True: 5.65k, False: 391]
  ------------------
  465|  5.65k|    from_big(typesize, framep + FRAME_TYPESIZE, sizeof(*typesize));
  ------------------
  |  |   32|  5.65k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  466|  5.65k|    if (*typesize <= 0) {
  ------------------
  |  Branch (466:9): [True: 4, False: 5.64k]
  ------------------
  467|      4|      BLOSC_TRACE_ERROR("`typesize` cannot be zero or negative.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|      4|      return BLOSC2_ERROR_INVALID_HEADER;
  469|      4|    }
  470|  5.65k|  }
  471|       |
  472|       |  // Codecs
  473|  6.03k|  uint8_t frame_codecs = framep[FRAME_CODECS];
  ------------------
  |  |   33|  6.03k|#define FRAME_CODECS (FRAME_FLAGS + 2)  // 27
  |  |  ------------------
  |  |  |  |   31|  6.03k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  6.03k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   29|  6.03k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   28|  6.03k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  474|  6.03k|  if (clevel != NULL) {
  ------------------
  |  Branch (474:7): [True: 4.85k, False: 1.18k]
  ------------------
  475|  4.85k|    *clevel = frame_codecs >> 4u;
  476|  4.85k|  }
  477|  6.03k|  if (compcode != NULL) {
  ------------------
  |  Branch (477:7): [True: 4.85k, False: 1.18k]
  ------------------
  478|  4.85k|    *compcode = frame_codecs & 0xFu;
  479|  4.85k|    if (*compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (479:9): [True: 87, False: 4.77k]
  ------------------
  480|     87|      from_big(compcode, framep + FRAME_UDCODEC, sizeof(*compcode));
  ------------------
  |  |   32|     87|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  481|     87|    }
  482|  4.85k|  }
  483|       |
  484|       |  // Other flags
  485|  6.03k|  uint8_t other_flags = framep[FRAME_OTHER_FLAGS];
  ------------------
  |  |   34|  6.03k|#define FRAME_OTHER_FLAGS (FRAME_FLAGS + 3)  // 28
  |  |  ------------------
  |  |  |  |   31|  6.03k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  6.03k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   29|  6.03k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   28|  6.03k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|  6.03k|  if (splitmode != NULL) {
  ------------------
  |  Branch (486:7): [True: 4.85k, False: 1.18k]
  ------------------
  487|  4.85k|    *splitmode = (other_flags & 0x03u) + 1;
  488|  4.85k|  }
  489|       |
  490|       |  // Other flags 2: bit 0 = use_dict
  491|  6.03k|  if (use_dict != NULL) {
  ------------------
  |  Branch (491:7): [True: 4.85k, False: 1.18k]
  ------------------
  492|  4.85k|    *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   46|  4.85k|#define FRAME_OTHER_FLAGS2 (FRAME_FILTER_PIPELINE + 1 + 14)  // 85
  |  |  ------------------
  |  |  |  |   43|  4.85k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.85k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  4.85k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  4.85k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  4.85k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  4.85k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  4.85k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  4.85k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  4.85k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  4.85k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  4.85k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  4.85k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  4.85k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   47|  4.85k|#define FRAME_USE_DICT (1U << 0)   //!< bit 0 of other_flags2: use dictionary compression
  ------------------
  |  Branch (492:17): [True: 1.79k, False: 3.06k]
  ------------------
  493|  4.85k|  }
  494|       |
  495|  6.03k|  if (compcode_meta != NULL) {
  ------------------
  |  Branch (495:7): [True: 4.85k, False: 1.18k]
  ------------------
  496|  4.85k|    from_big(compcode_meta, framep + FRAME_CODEC_META, sizeof(*compcode_meta));
  ------------------
  |  |   32|  4.85k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  497|  4.85k|  }
  498|       |
  499|       |  // Filters
  500|  6.03k|  if (filters != NULL && filters_meta != NULL) {
  ------------------
  |  Branch (500:7): [True: 4.85k, False: 1.18k]
  |  Branch (500:26): [True: 4.85k, False: 0]
  ------------------
  501|  4.85k|    uint8_t nfilters = framep[FRAME_FILTER_PIPELINE];
  ------------------
  |  |   43|  4.85k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   42|  4.85k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  4.85k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|  4.85k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|  4.85k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   38|  4.85k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  4.85k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  4.85k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  4.85k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  4.85k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  4.85k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  4.85k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  4.85k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  502|  4.85k|    if (nfilters > BLOSC2_MAX_FILTERS) {
  ------------------
  |  Branch (502:9): [True: 0, False: 4.85k]
  ------------------
  503|      0|      BLOSC_TRACE_ERROR("The number of filters in frame header are too large for Blosc2.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  504|      0|      return BLOSC2_ERROR_INVALID_HEADER;
  505|      0|    }
  506|  4.85k|    uint8_t *filters_ = framep + FRAME_FILTER_PIPELINE + 1;
  ------------------
  |  |   43|  4.85k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   42|  4.85k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  4.85k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|  4.85k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|  4.85k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   38|  4.85k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  4.85k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  4.85k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  4.85k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  4.85k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  4.85k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  4.85k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  4.85k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  507|  4.85k|    uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   43|  4.85k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   42|  4.85k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  4.85k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|  4.85k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   39|  4.85k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   38|  4.85k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  4.85k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  4.85k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  4.85k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  4.85k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  4.85k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  4.85k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  4.85k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   52|  4.85k|#define FRAME_FILTER_PIPELINE_MAX (8)  // the maximum number of filters that can be stored in header
  ------------------
  508|  11.6k|    for (int i = 0; i < nfilters; i++) {
  ------------------
  |  Branch (508:21): [True: 6.83k, False: 4.85k]
  ------------------
  509|  6.83k|      filters[i] = filters_[i];
  510|  6.83k|      filters_meta[i] = filters_meta_[i];
  511|  6.83k|    }
  512|  4.85k|  }
  513|       |
  514|  6.03k|  if (*nbytes > 0) {
  ------------------
  |  Branch (514:7): [True: 6.00k, False: 32]
  ------------------
  515|  6.00k|    if (*chunksize > 0) {
  ------------------
  |  Branch (515:9): [True: 5.24k, False: 762]
  ------------------
  516|       |      // We can compute the number of chunks directly when there is a fixed chunk size.
  517|  5.24k|      *nchunks = *nbytes / *chunksize;
  518|  5.24k|      if (*nbytes % *chunksize > 0) {
  ------------------
  |  Branch (518:11): [True: 2.61k, False: 2.62k]
  ------------------
  519|  2.61k|        *nchunks += 1;
  520|  2.61k|      }
  521|       |
  522|       |      // Sanity check for compressed sizes
  523|  5.24k|      if ((*cbytes < 0) || ((int64_t)*nchunks * *chunksize < *nbytes)) {
  ------------------
  |  Branch (523:11): [True: 4, False: 5.24k]
  |  Branch (523:28): [True: 0, False: 5.24k]
  ------------------
  524|      4|        BLOSC_TRACE_ERROR("Invalid compressed size in frame header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  525|      4|        return BLOSC2_ERROR_INVALID_HEADER;
  526|      4|      }
  527|  5.24k|    }
  528|    762|    else if (*chunksize == 0) {
  ------------------
  |  Branch (528:14): [True: 757, False: 5]
  ------------------
  529|    757|      int32_t coffsets_nbytes;
  530|    757|      int rc2 = get_coffsets_nbytes(frame, *header_len, *cbytes, &coffsets_nbytes, io);
  531|    757|      if (rc2 < 0) {
  ------------------
  |  Branch (531:11): [True: 84, False: 673]
  ------------------
  532|     84|        return rc2;
  533|     84|      }
  534|    673|      if (coffsets_nbytes < 0 || coffsets_nbytes % (int32_t)sizeof(int64_t) != 0) {
  ------------------
  |  Branch (534:11): [True: 13, False: 660]
  |  Branch (534:34): [True: 3, False: 657]
  ------------------
  535|     16|        BLOSC_TRACE_ERROR("Invalid offsets chunk in frame header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  536|     16|        return BLOSC2_ERROR_INVALID_HEADER;
  537|     16|      }
  538|    657|      *nchunks = coffsets_nbytes / (int32_t)sizeof(int64_t);
  539|    657|    }
  540|      5|    else {
  541|      5|      BLOSC_TRACE_ERROR("Invalid chunk size in frame 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  542|      5|      return BLOSC2_ERROR_INVALID_HEADER;
  543|      5|    }
  544|  6.00k|  } else {
  545|     32|    *nchunks = 0;
  546|     32|  }
  547|       |
  548|  5.93k|  if (*nchunks > 0) {
  ------------------
  |  Branch (548:7): [True: 5.89k, False: 32]
  ------------------
  549|  5.89k|    int32_t off_nbytes;
  550|  5.89k|    if (!blosc2_nchunks_to_offsets_nbytes(*nchunks, &off_nbytes)) {
  ------------------
  |  Branch (550:9): [True: 5, False: 5.89k]
  ------------------
  551|      5|      BLOSC_TRACE_ERROR("Invalid number of chunks in frame 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  552|      5|      return BLOSC2_ERROR_INVALID_HEADER;
  553|      5|    }
  554|  5.89k|  }
  555|       |
  556|  5.92k|  return 0;
  557|  5.93k|}
get_trailer_offset:
  560|    194|int64_t get_trailer_offset(blosc2_frame_s *frame, int32_t header_len, bool has_coffsets) {
  561|    194|  if (!has_coffsets) {
  ------------------
  |  Branch (561:7): [True: 9, False: 185]
  ------------------
  562|       |    // No data chunks yet
  563|      9|    return header_len;
  564|      9|  }
  565|    185|  return frame->len - frame->trailer_len;
  566|    194|}
frame_from_cframe:
 1072|  7.51k|blosc2_frame_s* frame_from_cframe(uint8_t *cframe, int64_t len, bool copy) {
 1073|       |  // Get the length of the frame
 1074|  7.51k|  const uint8_t* header = cframe;
 1075|  7.51k|  int64_t frame_len;
 1076|  7.51k|  if (len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   48|  7.51k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   43|  7.51k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  7.51k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  7.51k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  7.51k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  7.51k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  7.51k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  7.51k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  7.51k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  7.51k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  7.51k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  7.51k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  7.51k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  7.51k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1076:7): [True: 0, False: 7.51k]
  ------------------
 1077|      0|    return NULL;
 1078|      0|  }
 1079|       |
 1080|  7.51k|  from_big(&frame_len, header + FRAME_LEN, sizeof(frame_len));
  ------------------
  |  |   32|  7.51k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1081|  7.51k|  if (frame_len != len) {   // sanity check
  ------------------
  |  Branch (1081:7): [True: 47, False: 7.47k]
  ------------------
 1082|     47|    return NULL;
 1083|     47|  }
 1084|       |
 1085|  7.47k|  blosc2_frame_s* frame = calloc(1, sizeof(blosc2_frame_s));
 1086|  7.47k|  frame->len = frame_len;
 1087|  7.47k|  frame->file_offset = 0;
 1088|       |
 1089|       |  // Now, the trailer length
 1090|  7.47k|  const uint8_t* trailer = cframe + frame_len - FRAME_TRAILER_MINLEN;
  ------------------
  |  |   57|  7.47k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 1091|  7.47k|  int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   57|  7.47k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
                int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   58|  7.47k|#define FRAME_TRAILER_LEN_OFFSET (22)  // offset to trailer length (counting from the end)
  ------------------
 1092|  7.47k|  if (trailer[trailer_offset - 1] != 0xce) {
  ------------------
  |  Branch (1092:7): [True: 9, False: 7.46k]
  ------------------
 1093|      9|    free(frame);
 1094|      9|    return NULL;
 1095|      9|  }
 1096|  7.46k|  uint32_t trailer_len;
 1097|  7.46k|  from_big(&trailer_len, trailer + trailer_offset, sizeof(trailer_len));
  ------------------
  |  |   32|  7.46k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1098|  7.46k|  if (trailer_len < FRAME_TRAILER_MINLEN || trailer_len > INT32_MAX ||
  ------------------
  |  |   57|  14.9k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1098:7): [True: 133, False: 7.32k]
  |  Branch (1098:45): [True: 761, False: 6.56k]
  ------------------
 1099|  6.56k|      (int64_t)trailer_len > frame_len ||
  ------------------
  |  Branch (1099:7): [True: 998, False: 5.57k]
  ------------------
 1100|  5.57k|      (int64_t)trailer_len > frame_len - FRAME_HEADER_MINLEN) {
  ------------------
  |  |   48|  5.57k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   43|  5.57k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  5.57k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  5.57k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  5.57k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  5.57k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  5.57k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  5.57k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  5.57k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  5.57k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  5.57k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  5.57k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  5.57k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  5.57k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1100:7): [True: 706, False: 4.86k]
  ------------------
 1101|  2.59k|    free(frame);
 1102|  2.59k|    return NULL;
 1103|  2.59k|  }
 1104|  4.86k|  frame->trailer_len = trailer_len;
 1105|       |
 1106|  4.86k|  if (copy) {
  ------------------
  |  Branch (1106:7): [True: 0, False: 4.86k]
  ------------------
 1107|      0|    frame->cframe = malloc((size_t)len);
 1108|      0|    memcpy(frame->cframe, cframe, (size_t)len);
 1109|      0|  }
 1110|  4.86k|  else {
 1111|  4.86k|    frame->cframe = cframe;
 1112|  4.86k|    frame->avoid_cframe_free = true;
 1113|  4.86k|  }
 1114|       |
 1115|  4.86k|  return frame;
 1116|  7.46k|}
get_coffsets:
 1295|  5.51k|                      int64_t nchunks, int32_t *off_cbytes) {
 1296|  5.51k|  int32_t chunk_cbytes;
 1297|  5.51k|  int rc;
 1298|       |
 1299|  5.51k|  if (frame->coffsets != NULL) {
  ------------------
  |  Branch (1299:7): [True: 0, False: 5.51k]
  ------------------
 1300|      0|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (1300:9): [True: 0, False: 0]
  ------------------
 1301|      0|      rc = blosc2_cbuffer_sizes(frame->coffsets, NULL, &chunk_cbytes, NULL);
 1302|      0|      if (rc < 0) {
  ------------------
  |  Branch (1302:11): [True: 0, False: 0]
  ------------------
 1303|      0|        return NULL;
 1304|      0|      }
 1305|      0|      *off_cbytes = (int32_t)chunk_cbytes;
 1306|      0|    }
 1307|      0|    return frame->coffsets;
 1308|      0|  }
 1309|  5.51k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (1309:7): [True: 5.51k, False: 0]
  ------------------
 1310|  5.51k|    int64_t off_pos = header_len;
 1311|  5.51k|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (1311:9): [True: 1.29k, False: 4.21k]
  ------------------
 1312|  1.29k|      off_pos += cbytes;
 1313|  1.29k|    }
 1314|       |    // Check that there is enough room to read Blosc header
 1315|  5.51k|    if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (1315:9): [True: 0, False: 5.51k]
  |  Branch (1315:24): [True: 0, False: 5.51k]
  ------------------
 1316|  5.51k|        off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (1316:9): [True: 68, False: 5.44k]
  ------------------
 1317|     68|      BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1318|     68|      return NULL;
 1319|     68|    }
 1320|       |    // For in-memory frames, the coffset is just one pointer away
 1321|  5.44k|    uint8_t* off_start = frame->cframe + off_pos;
 1322|  5.44k|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (1322:9): [True: 5.44k, False: 0]
  ------------------
 1323|  5.44k|      int32_t chunk_nbytes;
 1324|  5.44k|      int32_t chunk_blocksize;
 1325|  5.44k|      rc = blosc2_cbuffer_sizes(off_start, &chunk_nbytes, &chunk_cbytes, &chunk_blocksize);
 1326|  5.44k|      if (rc < 0) {
  ------------------
  |  Branch (1326:11): [True: 31, False: 5.41k]
  ------------------
 1327|     31|        return NULL;
 1328|     31|      }
 1329|  5.41k|      *off_cbytes = (int32_t)chunk_cbytes;
 1330|  5.41k|      if (*off_cbytes < 0 || off_pos + *off_cbytes > frame->len) {
  ------------------
  |  Branch (1330:11): [True: 0, False: 5.41k]
  |  Branch (1330:30): [True: 34, False: 5.37k]
  ------------------
 1331|     34|        BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1332|     34|        return NULL;
 1333|     34|      }
 1334|  5.37k|      int32_t expected_off_nbytes;
 1335|  5.37k|      if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &expected_off_nbytes)) {
  ------------------
  |  Branch (1335:11): [True: 0, False: 5.37k]
  ------------------
 1336|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1337|      0|        return NULL;
 1338|      0|      }
 1339|  5.37k|      if (chunk_nbytes != expected_off_nbytes) {
  ------------------
  |  Branch (1339:11): [True: 44, False: 5.33k]
  ------------------
 1340|     44|        BLOSC_TRACE_ERROR("The number of chunks in offset idx "
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1341|     44|                          "does not match the ones in the header frame.");
 1342|     44|        return NULL;
 1343|     44|      }
 1344|       |
 1345|  5.37k|    }
 1346|  5.33k|    return off_start;
 1347|  5.44k|  }
 1348|       |
 1349|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
 1350|       |
 1351|      0|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + FRAME_TRAILER_MINLEN > frame->len) {
  ------------------
  |  |   57|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1351:7): [True: 0, False: 0]
  |  Branch (1351:56): [True: 0, False: 0]
  ------------------
 1352|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1353|      0|    return NULL;
 1354|      0|  }
 1355|       |
 1356|      0|  int64_t coffsets_cbytes64;
 1357|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1357:7): [True: 0, False: 0]
  ------------------
 1358|      0|    coffsets_cbytes64 = trailer_offset - header_len;
 1359|      0|  }
 1360|      0|  else {
 1361|      0|    coffsets_cbytes64 = trailer_offset - (header_len + cbytes);
 1362|      0|  }
 1363|      0|  if (coffsets_cbytes64 <= 0 || coffsets_cbytes64 > INT32_MAX) {
  ------------------
  |  Branch (1363:7): [True: 0, False: 0]
  |  Branch (1363:33): [True: 0, False: 0]
  ------------------
 1364|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1365|      0|    return NULL;
 1366|      0|  }
 1367|      0|  int32_t coffsets_cbytes = (int32_t)coffsets_cbytes64;
 1368|       |
 1369|      0|  if (off_cbytes != NULL) {
  ------------------
  |  Branch (1369:7): [True: 0, False: 0]
  ------------------
 1370|      0|    *off_cbytes = coffsets_cbytes;
 1371|      0|  }
 1372|       |
 1373|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 1374|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (1374:7): [True: 0, False: 0]
  ------------------
 1375|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1376|      0|    return NULL;
 1377|      0|  }
 1378|       |
 1379|      0|  void* fp = NULL;
 1380|      0|  uint8_t* coffsets;
 1381|      0|  if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (1381:7): [True: 0, False: 0]
  ------------------
 1382|      0|    coffsets = malloc((size_t)coffsets_cbytes);
 1383|      0|    frame->coffsets_needs_free = true;
 1384|      0|  }
 1385|      0|  else {
 1386|      0|    frame->coffsets_needs_free = false;
 1387|      0|  }
 1388|       |
 1389|      0|  int64_t io_pos = 0;
 1390|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1390:7): [True: 0, False: 0]
  ------------------
 1391|      0|    fp = sframe_open_index(frame->urlpath, "rb",
 1392|      0|                           frame->schunk->storage->io);
 1393|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1393:9): [True: 0, False: 0]
  ------------------
 1394|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1395|      0|      return NULL;
 1396|      0|    }
 1397|      0|    io_pos = header_len + 0;
 1398|      0|  }
 1399|      0|  else {
 1400|      0|    fp = io_cb->open(frame->urlpath, "rb", frame->schunk->storage->io->params);
 1401|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1401:9): [True: 0, False: 0]
  ------------------
 1402|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1403|      0|      return NULL;
 1404|      0|    }
 1405|      0|    io_pos = frame->file_offset + header_len + cbytes;
 1406|      0|  }
 1407|      0|  int64_t rbytes = io_cb->read((void**)&coffsets, 1, coffsets_cbytes, io_pos, fp);
 1408|      0|  io_cb->close(fp);
 1409|      0|  if (rbytes != coffsets_cbytes) {
  ------------------
  |  Branch (1409:7): [True: 0, False: 0]
  ------------------
 1410|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1411|      0|    if (frame->coffsets_needs_free)
  ------------------
  |  Branch (1411:9): [True: 0, False: 0]
  ------------------
 1412|      0|      free(coffsets);
 1413|      0|    return NULL;
 1414|      0|  }
 1415|      0|  frame->coffsets = coffsets;
 1416|      0|  return coffsets;
 1417|      0|}
frame_get_metalayers:
 1706|    197|int frame_get_metalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 1707|    197|  int32_t header_len;
 1708|    197|  int64_t frame_len;
 1709|    197|  int64_t nbytes;
 1710|    197|  int64_t cbytes;
 1711|    197|  int32_t blocksize;
 1712|    197|  int32_t chunksize;
 1713|    197|  int64_t nchunks;
 1714|    197|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 1715|    197|                            &blocksize, &chunksize, &nchunks,
 1716|    197|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 1717|    197|                            schunk->storage->io);
 1718|    197|  if (ret < 0) {
  ------------------
  |  Branch (1718:7): [True: 0, False: 197]
  ------------------
 1719|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1720|      0|    return ret;
 1721|      0|  }
 1722|       |
 1723|       |  // Get the header
 1724|    197|  uint8_t* header = NULL;
 1725|    197|  bool needs_free = false;
 1726|    197|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (1726:7): [True: 197, False: 0]
  ------------------
 1727|    197|    header = frame->cframe;
 1728|    197|  } else {
 1729|      0|    int64_t rbytes = 0;
 1730|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 1731|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1731:9): [True: 0, False: 0]
  ------------------
 1732|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1733|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1734|      0|    }
 1735|       |
 1736|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (1736:9): [True: 0, False: 0]
  ------------------
 1737|      0|      header = malloc(header_len);
 1738|      0|      needs_free = true;
 1739|      0|    }
 1740|      0|    else {
 1741|      0|      needs_free = false;
 1742|      0|    }
 1743|       |
 1744|      0|    void* fp = NULL;
 1745|      0|    int64_t io_pos = 0;
 1746|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1746:9): [True: 0, False: 0]
  ------------------
 1747|      0|      fp = sframe_open_index(frame->urlpath, "rb",
 1748|      0|                             frame->schunk->storage->io);
 1749|      0|      if (fp == NULL) {
  ------------------
  |  Branch (1749:11): [True: 0, False: 0]
  ------------------
 1750|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1751|      0|        return BLOSC2_ERROR_FILE_OPEN;
 1752|      0|      }
 1753|      0|    }
 1754|      0|    else {
 1755|      0|      fp = io_cb->open(frame->urlpath, "rb", frame->schunk->storage->io->params);
 1756|      0|      if (fp == NULL) {
  ------------------
  |  Branch (1756:11): [True: 0, False: 0]
  ------------------
 1757|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1758|      0|        return BLOSC2_ERROR_FILE_OPEN;
 1759|      0|      }
 1760|      0|      io_pos = frame->file_offset;
 1761|      0|    }
 1762|      0|    if (fp != NULL) {
  ------------------
  |  Branch (1762:9): [True: 0, False: 0]
  ------------------
 1763|      0|      rbytes = io_cb->read((void**)&header, 1, header_len, io_pos, fp);
 1764|      0|      io_cb->close(fp);
 1765|      0|    }
 1766|      0|    if (rbytes != header_len) {
  ------------------
  |  Branch (1766:9): [True: 0, False: 0]
  ------------------
 1767|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1768|      0|      if (needs_free)
  ------------------
  |  Branch (1768:11): [True: 0, False: 0]
  ------------------
 1769|      0|        free(header);
 1770|      0|      return BLOSC2_ERROR_FILE_READ;
 1771|      0|    }
 1772|      0|  }
 1773|       |
 1774|    197|  ret = get_meta_from_header(frame, schunk, header, header_len);
 1775|       |
 1776|    197|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (1776:7): [True: 0, False: 197]
  |  Branch (1776:32): [True: 0, False: 0]
  ------------------
 1777|      0|    free(header);
 1778|      0|  }
 1779|       |
 1780|    197|  return ret;
 1781|    197|}
frame_get_vlmetalayers:
 1917|    194|int frame_get_vlmetalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 1918|    194|  int32_t header_len;
 1919|    194|  int64_t frame_len;
 1920|    194|  int64_t nbytes;
 1921|    194|  int64_t cbytes;
 1922|    194|  int32_t blocksize;
 1923|    194|  int32_t chunksize;
 1924|    194|  int64_t nchunks;
 1925|    194|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 1926|    194|                            &blocksize, &chunksize, &nchunks,
 1927|    194|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 1928|    194|                            schunk->storage->io);
 1929|    194|  if (ret < 0) {
  ------------------
  |  Branch (1929:7): [True: 0, False: 194]
  ------------------
 1930|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1931|      0|    return ret;
 1932|      0|  }
 1933|       |
 1934|    194|  int64_t trailer_offset = get_trailer_offset(frame, header_len, nbytes > 0);
 1935|    194|  int32_t trailer_len = (int32_t) frame->trailer_len;
 1936|       |
 1937|    194|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + trailer_len > frame->len) {
  ------------------
  |  Branch (1937:7): [True: 0, False: 194]
  |  Branch (1937:56): [True: 2, False: 192]
  ------------------
 1938|      2|    BLOSC_TRACE_ERROR("Cannot access the trailer out of the frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1939|      2|    return BLOSC2_ERROR_READ_BUFFER;
 1940|      2|  }
 1941|       |
 1942|       |  // Get the trailer
 1943|    192|  uint8_t* trailer = NULL;
 1944|    192|  bool needs_free = false;
 1945|    192|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (1945:7): [True: 192, False: 0]
  ------------------
 1946|    192|    trailer = frame->cframe + trailer_offset;
 1947|    192|  } else {
 1948|      0|    int64_t rbytes = 0;
 1949|       |
 1950|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 1951|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1951:9): [True: 0, False: 0]
  ------------------
 1952|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1953|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1954|      0|    }
 1955|       |
 1956|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (1956:9): [True: 0, False: 0]
  ------------------
 1957|      0|      trailer = malloc(trailer_len);
 1958|      0|      needs_free = true;
 1959|      0|    }
 1960|      0|    else {
 1961|      0|      needs_free = false;
 1962|      0|    }
 1963|       |
 1964|      0|    void* fp = NULL;
 1965|      0|    int64_t io_pos = 0;
 1966|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1966:9): [True: 0, False: 0]
  ------------------
 1967|       |      // Check for overflow before calculating length
 1968|      0|      if (strlen(frame->urlpath) > SIZE_MAX - strlen("/chunks.b2frame") - 1) {
  ------------------
  |  Branch (1968:11): [True: 0, False: 0]
  ------------------
 1969|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1970|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (1970:13): [True: 0, False: 0]
  ------------------
 1971|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 1972|      0|      }
 1973|      0|      size_t _len = strlen(frame->urlpath) + strlen("/chunks.b2frame") + 1;
 1974|      0|      char* eframe_name = malloc(_len);
 1975|      0|      if (eframe_name == NULL) {
  ------------------
  |  Branch (1975:11): [True: 0, False: 0]
  ------------------
 1976|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1977|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (1977:13): [True: 0, False: 0]
  ------------------
 1978|      0|        return BLOSC2_ERROR_MEMORY_ALLOC;
 1979|      0|      }
 1980|      0|      int _w = snprintf(eframe_name, _len, "%s/chunks.b2frame", frame->urlpath);
 1981|      0|      if (_w < 0 || (size_t)_w >= _len) {
  ------------------
  |  Branch (1981:11): [True: 0, False: 0]
  |  Branch (1981:21): [True: 0, False: 0]
  ------------------
 1982|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1983|      0|        free(eframe_name);
 1984|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (1984:13): [True: 0, False: 0]
  ------------------
 1985|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 1986|      0|      }
 1987|      0|      fp = io_cb->open(eframe_name, "rb", frame->schunk->storage->io->params);
 1988|      0|      if (fp == NULL) {
  ------------------
  |  Branch (1988:11): [True: 0, False: 0]
  ------------------
 1989|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1990|      0|        free(eframe_name);
 1991|      0|        return BLOSC2_ERROR_FILE_OPEN;
 1992|      0|      }
 1993|      0|      free(eframe_name);
 1994|      0|      io_pos = trailer_offset;
 1995|      0|    }
 1996|      0|    else {
 1997|      0|      fp = io_cb->open(frame->urlpath, "rb", frame->schunk->storage->io->params);
 1998|      0|      if (fp == NULL) {
  ------------------
  |  Branch (1998:11): [True: 0, False: 0]
  ------------------
 1999|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2001|      0|      }
 2002|      0|      io_pos = frame->file_offset + trailer_offset;
 2003|      0|    }
 2004|      0|    if (fp != NULL) {
  ------------------
  |  Branch (2004:9): [True: 0, False: 0]
  ------------------
 2005|      0|      rbytes = io_cb->read((void**)&trailer, 1, trailer_len, io_pos, fp);
 2006|      0|      io_cb->close(fp);
 2007|      0|    }
 2008|      0|    if (rbytes != trailer_len) {
  ------------------
  |  Branch (2008:9): [True: 0, False: 0]
  ------------------
 2009|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2010|      0|      if (needs_free)
  ------------------
  |  Branch (2010:11): [True: 0, False: 0]
  ------------------
 2011|      0|        free(trailer);
 2012|      0|      return BLOSC2_ERROR_FILE_READ;
 2013|      0|    }
 2014|      0|  }
 2015|       |
 2016|    192|  ret = get_vlmeta_from_trailer(frame, schunk, trailer, trailer_len);
 2017|       |
 2018|    192|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (2018:7): [True: 0, False: 192]
  |  Branch (2018:32): [True: 0, False: 0]
  ------------------
 2019|      0|    free(trailer);
 2020|      0|  }
 2021|       |
 2022|    192|  return ret;
 2023|    192|}
get_new_storage:
 2029|  4.73k|                                const blosc2_io* iodefaults) {
 2030|       |
 2031|  4.73k|  blosc2_storage* new_storage = (blosc2_storage*)calloc(1, sizeof(blosc2_storage));
 2032|  4.73k|  memcpy(new_storage, storage, sizeof(blosc2_storage));
 2033|  4.73k|  if (storage->urlpath != NULL) {
  ------------------
  |  Branch (2033:7): [True: 0, False: 4.73k]
  ------------------
 2034|      0|    char* urlpath = normalize_urlpath(storage->urlpath);
 2035|      0|    new_storage->urlpath = malloc(strlen(urlpath) + 1);
 2036|      0|    strcpy(new_storage->urlpath, urlpath);
 2037|      0|  }
 2038|       |
 2039|       |  // cparams
 2040|  4.73k|  blosc2_cparams* cparams = malloc(sizeof(blosc2_cparams));
 2041|  4.73k|  if (storage->cparams != NULL) {
  ------------------
  |  Branch (2041:7): [True: 0, False: 4.73k]
  ------------------
 2042|      0|    memcpy(cparams, storage->cparams, sizeof(blosc2_cparams));
 2043|  4.73k|  } else {
 2044|  4.73k|    memcpy(cparams, cdefaults, sizeof(blosc2_cparams));
 2045|  4.73k|  }
 2046|  4.73k|  new_storage->cparams = cparams;
 2047|       |
 2048|       |  // dparams
 2049|  4.73k|  blosc2_dparams* dparams = malloc(sizeof(blosc2_dparams));
 2050|  4.73k|  if (storage->dparams != NULL) {
  ------------------
  |  Branch (2050:7): [True: 0, False: 4.73k]
  ------------------
 2051|      0|    memcpy(dparams, storage->dparams, sizeof(blosc2_dparams));
 2052|      0|  }
 2053|  4.73k|  else {
 2054|  4.73k|    memcpy(dparams, ddefaults, sizeof(blosc2_dparams));
 2055|  4.73k|  }
 2056|  4.73k|  new_storage->dparams = dparams;
 2057|       |
 2058|       |  // iodefaults
 2059|  4.73k|  blosc2_io* udio = malloc(sizeof(blosc2_io));
 2060|  4.73k|  if (storage->io != NULL) {
  ------------------
  |  Branch (2060:7): [True: 0, False: 4.73k]
  ------------------
 2061|      0|    memcpy(udio, storage->io, sizeof(blosc2_io));
 2062|      0|  }
 2063|  4.73k|  else {
 2064|  4.73k|    memcpy(udio, iodefaults, sizeof(blosc2_io));
 2065|  4.73k|  }
 2066|  4.73k|  new_storage->io = udio;
 2067|       |
 2068|  4.73k|  return new_storage;
 2069|  4.73k|}
frame_to_schunk:
 2133|  4.86k|blosc2_schunk* frame_to_schunk(blosc2_frame_s* frame, bool copy, const blosc2_io *udio) {
 2134|  4.86k|  int32_t header_len;
 2135|  4.86k|  int64_t frame_len;
 2136|  4.86k|  int rc;
 2137|  4.86k|  bool frame_attached = true;
 2138|  4.86k|  blosc2_schunk* schunk = calloc(1, sizeof(blosc2_schunk));
 2139|  4.86k|  blosc2_cparams *cparams = NULL;
 2140|  4.86k|  blosc2_dparams *dparams = NULL;
 2141|  4.86k|  int64_t *offsets = NULL;
 2142|  4.86k|  if (schunk == NULL) {
  ------------------
  |  Branch (2142:7): [True: 0, False: 4.86k]
  ------------------
 2143|      0|    return NULL;
 2144|      0|  }
 2145|  4.86k|  schunk->frame = (blosc2_frame*)frame;
 2146|  4.86k|  frame->schunk = schunk;
 2147|       |
 2148|  4.86k|  rc = get_header_info(frame, &header_len, &frame_len, &schunk->nbytes,
 2149|  4.86k|                       &schunk->cbytes, &schunk->blocksize,
 2150|  4.86k|                       &schunk->chunksize, &schunk->nchunks, &schunk->typesize,
 2151|  4.86k|                       &schunk->compcode, &schunk->compcode_meta, &schunk->clevel, schunk->filters,
 2152|  4.86k|                       schunk->filters_meta, &schunk->splitmode, &schunk->use_dict, udio);
 2153|  4.86k|  if (rc < 0) {
  ------------------
  |  Branch (2153:7): [True: 119, False: 4.74k]
  ------------------
 2154|    119|    BLOSC_TRACE_ERROR("Unable to get meta info from frame.");
  ------------------
  |  |   93|    119|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    119|    do {                                            \
  |  |  |  |   98|    119|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    119|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 119, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    119|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2155|    119|    goto error;
 2156|    119|  }
 2157|  4.74k|  int64_t nchunks = schunk->nchunks;
 2158|  4.74k|  int64_t nbytes = schunk->nbytes;
 2159|  4.74k|  (void) nbytes;
 2160|  4.74k|  int64_t cbytes = schunk->cbytes;
 2161|       |
 2162|       |  // Compression and decompression contexts
 2163|  4.74k|  blosc2_schunk_get_cparams(schunk, &cparams);
 2164|  4.74k|  schunk->cctx = blosc2_create_cctx(*cparams);
 2165|  4.74k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (2165:7): [True: 11, False: 4.73k]
  ------------------
 2166|     11|    BLOSC_TRACE_ERROR("Error while creating the compression context");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2167|     11|    goto error;
 2168|     11|  }
 2169|  4.73k|  blosc2_schunk_get_dparams(schunk, &dparams);
 2170|  4.73k|  schunk->dctx = blosc2_create_dctx(*dparams);
 2171|  4.73k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (2171:7): [True: 0, False: 4.73k]
  ------------------
 2172|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2173|      0|    goto error;
 2174|      0|  }
 2175|  4.73k|  blosc2_storage storage = {.contiguous = copy ? false : true};
  ------------------
  |  Branch (2175:43): [True: 0, False: 4.73k]
  ------------------
 2176|  4.73k|  schunk->storage = get_new_storage(&storage, cparams, dparams, udio);
 2177|  4.73k|  free(cparams);
 2178|  4.73k|  cparams = NULL;
 2179|  4.73k|  free(dparams);
 2180|  4.73k|  dparams = NULL;
 2181|  4.73k|  if (nchunks > 0) {
  ------------------
  |  Branch (2181:7): [True: 4.72k, False: 11]
  ------------------
 2182|  4.72k|    rc = validate_offsets_chunk(frame, header_len, cbytes, nchunks);
 2183|  4.72k|    if (rc < 0) {
  ------------------
  |  Branch (2183:9): [True: 4.37k, False: 352]
  ------------------
 2184|  4.37k|      BLOSC_TRACE_ERROR("Cannot validate frame offsets.");
  ------------------
  |  |   93|  4.37k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  4.37k|    do {                                            \
  |  |  |  |   98|  4.37k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  4.37k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4.37k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  4.37k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2185|  4.37k|      goto error;
 2186|  4.37k|    }
 2187|  4.72k|  }
 2188|    363|  if (nchunks > 0) {
  ------------------
  |  Branch (2188:7): [True: 352, False: 11]
  ------------------
 2189|    352|    uint8_t *chunk;
 2190|    352|    bool needs_free;
 2191|    352|    rc = frame_get_chunk(frame, 0, &chunk, &needs_free);
 2192|    352|    if (rc < 0) {
  ------------------
  |  Branch (2192:9): [True: 166, False: 186]
  ------------------
 2193|    166|      BLOSC_TRACE_ERROR("Cannot inspect the first chunk in frame.");
  ------------------
  |  |   93|    166|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    166|    do {                                            \
  |  |  |  |   98|    166|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    166|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 166, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    166|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2194|    166|      goto error;
 2195|    166|    }
 2196|    186|    schunk->flags2 = chunk[BLOSC2_CHUNK_BLOSC2_FLAGS2];
 2197|    186|    if (needs_free) {
  ------------------
  |  Branch (2197:9): [True: 166, False: 20]
  ------------------
 2198|    166|      free(chunk);
 2199|    166|    }
 2200|    186|  }
 2201|    197|  if (!copy) {
  ------------------
  |  Branch (2201:7): [True: 197, False: 0]
  ------------------
 2202|    197|    goto out;
 2203|    197|  }
 2204|       |
 2205|       |  // We are not attached to a frame anymore
 2206|      0|  schunk->frame = NULL;
 2207|      0|  frame_attached = false;
 2208|       |
 2209|      0|  if (nchunks == 0) {
  ------------------
  |  Branch (2209:7): [True: 0, False: 0]
  ------------------
 2210|      0|    frame->schunk = NULL;
 2211|      0|    goto out;
 2212|      0|  }
 2213|       |
 2214|       |  // Get the compressed offsets
 2215|      0|  int32_t coffsets_cbytes = 0;
 2216|      0|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 2217|      0|  if (coffsets == NULL) {
  ------------------
  |  Branch (2217:7): [True: 0, False: 0]
  ------------------
 2218|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2219|      0|    goto error;
 2220|      0|  }
 2221|       |
 2222|       |  // Decompress offsets
 2223|      0|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 2224|      0|  blosc2_context *dctx = blosc2_create_dctx(off_dparams);
 2225|      0|  if (dctx == NULL) {
  ------------------
  |  Branch (2225:7): [True: 0, False: 0]
  ------------------
 2226|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2227|      0|    goto error;
 2228|      0|  }
 2229|      0|  int32_t offsets_nbytes;
 2230|      0|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (2230:7): [True: 0, False: 0]
  ------------------
 2231|      0|    blosc2_free_ctx(dctx);
 2232|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|      0|    goto error;
 2234|      0|  }
 2235|      0|  offsets = (int64_t *) malloc((size_t)offsets_nbytes);
 2236|      0|  if (offsets == NULL) {
  ------------------
  |  Branch (2236:7): [True: 0, False: 0]
  ------------------
 2237|      0|    blosc2_free_ctx(dctx);
 2238|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2239|      0|    goto error;
 2240|      0|  }
 2241|      0|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 2242|      0|                                             offsets, offsets_nbytes);
 2243|      0|  blosc2_free_ctx(dctx);
 2244|      0|  if (off_nbytes < 0) {
  ------------------
  |  Branch (2244:7): [True: 0, False: 0]
  ------------------
 2245|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2246|      0|    goto error;
 2247|      0|  }
 2248|       |
 2249|       |  // We want the contiguous schunk, so create the actual data chunks (and, while doing this,
 2250|       |  // get a guess at the blocksize used in this frame)
 2251|      0|  int64_t acc_nbytes = 0;
 2252|      0|  int64_t acc_cbytes = 0;
 2253|      0|  int32_t blocksize = 0;
 2254|      0|  int32_t chunk_nbytes;
 2255|      0|  int32_t chunk_cbytes;
 2256|      0|  int32_t chunk_blocksize;
 2257|      0|  size_t prev_alloc = BLOSC_EXTENDED_HEADER_LENGTH;
 2258|      0|  uint8_t* data_chunk = NULL;
 2259|      0|  bool needs_free = false;
 2260|      0|  const blosc2_io_cb *io_cb = blosc2_get_io_cb(udio->id);
 2261|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (2261:7): [True: 0, False: 0]
  ------------------
 2262|      0|    blosc2_schunk_free(schunk);
 2263|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2264|      0|    return NULL;
 2265|      0|  }
 2266|       |
 2267|      0|  void* fp = NULL;
 2268|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (2268:7): [True: 0, False: 0]
  ------------------
 2269|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2269:9): [True: 0, False: 0]
  ------------------
 2270|      0|      data_chunk = malloc((size_t)prev_alloc);
 2271|      0|      needs_free = true;
 2272|      0|    }
 2273|      0|    else {
 2274|      0|      needs_free = false;
 2275|      0|    }
 2276|       |
 2277|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (2277:9): [True: 0, False: 0]
  ------------------
 2278|       |      // If not the chunks won't be in the frame
 2279|      0|      fp = io_cb->open(frame->urlpath, "rb", udio->params);
 2280|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2280:11): [True: 0, False: 0]
  ------------------
 2281|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2282|      0|        rc = BLOSC2_ERROR_FILE_OPEN;
 2283|      0|        goto end;
 2284|      0|      }
 2285|      0|    }
 2286|      0|  }
 2287|      0|  schunk->data = malloc(nchunks * sizeof(void*));
 2288|      0|  for (int64_t i = 0; i < nchunks; i++) {
  ------------------
  |  Branch (2288:23): [True: 0, False: 0]
  ------------------
 2289|      0|    if (frame->cframe != NULL) {
  ------------------
  |  Branch (2289:9): [True: 0, False: 0]
  ------------------
 2290|      0|      if (needs_free) {
  ------------------
  |  Branch (2290:11): [True: 0, False: 0]
  ------------------
 2291|      0|        free(data_chunk);
 2292|      0|      }
 2293|      0|      if (offsets[i] < 0) {
  ------------------
  |  Branch (2293:11): [True: 0, False: 0]
  ------------------
 2294|      0|        int64_t rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 2295|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (2295:13): [True: 0, False: 0]
  ------------------
 2296|      0|          break;
 2297|      0|        }
 2298|      0|      }
 2299|      0|      else {
 2300|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (2300:13): [True: 0, False: 0]
  ------------------
 2301|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2301:13): [True: 0, False: 0]
  ------------------
 2302|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2302:13): [True: 0, False: 0]
  ------------------
 2303|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 2304|      0|          break;
 2305|      0|        }
 2306|      0|        data_chunk = frame->cframe + header_len + offsets[i];
 2307|      0|        needs_free = false;
 2308|      0|      }
 2309|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 2310|      0|      if (rc < 0) {
  ------------------
  |  Branch (2310:11): [True: 0, False: 0]
  ------------------
 2311|      0|        break;
 2312|      0|      }
 2313|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (2313:11): [True: 0, False: 0]
  ------------------
 2314|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2314:12): [True: 0, False: 0]
  ------------------
 2315|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (2315:12): [True: 0, False: 0]
  ------------------
 2316|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (2316:12): [True: 0, False: 0]
  ------------------
 2317|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 2318|      0|        break;
 2319|      0|      }
 2320|      0|    }
 2321|      0|    else {
 2322|      0|      int64_t rbytes;
 2323|      0|      if (offsets[i] < 0 || frame->sframe) {
  ------------------
  |  Branch (2323:11): [True: 0, False: 0]
  |  Branch (2323:29): [True: 0, False: 0]
  ------------------
 2324|      0|        if (needs_free) {
  ------------------
  |  Branch (2324:13): [True: 0, False: 0]
  ------------------
 2325|      0|          free(data_chunk);
 2326|      0|        }
 2327|      0|        rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 2328|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (2328:13): [True: 0, False: 0]
  ------------------
 2329|      0|          break;
 2330|      0|        }
 2331|      0|      }
 2332|      0|      else {
 2333|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (2333:13): [True: 0, False: 0]
  ------------------
 2334|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2334:13): [True: 0, False: 0]
  ------------------
 2335|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2335:13): [True: 0, False: 0]
  ------------------
 2336|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 2337|      0|          break;
 2338|      0|        }
 2339|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 2340|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 2341|      0|      }
 2342|      0|      if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2342:11): [True: 0, False: 0]
  ------------------
 2343|      0|        rc = BLOSC2_ERROR_READ_BUFFER;
 2344|      0|        break;
 2345|      0|      }
 2346|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 2347|      0|      if (rc < 0) {
  ------------------
  |  Branch (2347:11): [True: 0, False: 0]
  ------------------
 2348|      0|        break;
 2349|      0|      }
 2350|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (2350:11): [True: 0, False: 0]
  ------------------
 2351|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2351:12): [True: 0, False: 0]
  ------------------
 2352|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (2352:12): [True: 0, False: 0]
  ------------------
 2353|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (2353:12): [True: 0, False: 0]
  ------------------
 2354|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 2355|      0|        break;
 2356|      0|      }
 2357|      0|      if (chunk_cbytes > (int32_t)prev_alloc) {
  ------------------
  |  Branch (2357:11): [True: 0, False: 0]
  ------------------
 2358|      0|        if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (2358:13): [True: 0, False: 0]
  ------------------
 2359|      0|          data_chunk = realloc(data_chunk, chunk_cbytes);
 2360|      0|        if (data_chunk == NULL) {
  ------------------
  |  Branch (2360:13): [True: 0, False: 0]
  ------------------
 2361|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2362|      0|          rc = BLOSC2_ERROR_MEMORY_ALLOC;
 2363|      0|          break;
 2364|      0|        }
 2365|      0|        prev_alloc = chunk_cbytes;
 2366|      0|      }
 2367|      0|      if (!frame->sframe) {
  ------------------
  |  Branch (2367:11): [True: 0, False: 0]
  ------------------
 2368|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 2369|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, chunk_cbytes, io_pos, fp);
 2370|      0|        if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (2370:13): [True: 0, False: 0]
  ------------------
 2371|      0|          rc = BLOSC2_ERROR_READ_BUFFER;
 2372|      0|          break;
 2373|      0|        }
 2374|      0|      }
 2375|      0|    }
 2376|      0|    uint8_t* new_chunk = malloc(chunk_cbytes);
 2377|      0|    memcpy(new_chunk, data_chunk, chunk_cbytes);
 2378|      0|    schunk->data[i] = new_chunk;
 2379|      0|    rc = blosc2_cbuffer_sizes(data_chunk, &chunk_nbytes, NULL, &chunk_blocksize);
 2380|      0|    if (rc < 0) {
  ------------------
  |  Branch (2380:9): [True: 0, False: 0]
  ------------------
 2381|      0|      break;
 2382|      0|    }
 2383|      0|    acc_nbytes += chunk_nbytes;
 2384|      0|    acc_cbytes += chunk_cbytes;
 2385|      0|    if (i == 0) {
  ------------------
  |  Branch (2385:9): [True: 0, False: 0]
  ------------------
 2386|      0|      blocksize = chunk_blocksize;
 2387|      0|    }
 2388|      0|    else if (blocksize != chunk_blocksize) {
  ------------------
  |  Branch (2388:14): [True: 0, False: 0]
  ------------------
 2389|       |      // Blocksize varies
 2390|      0|      blocksize = 0;
 2391|      0|    }
 2392|      0|  }
 2393|       |
 2394|       |  // We are not attached to a schunk anymore
 2395|      0|  frame->schunk = NULL;
 2396|       |
 2397|      0|  end:
 2398|      0|  if (needs_free) {
  ------------------
  |  Branch (2398:7): [True: 0, False: 0]
  ------------------
 2399|      0|    free(data_chunk);
 2400|      0|  }
 2401|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (2401:7): [True: 0, False: 0]
  ------------------
 2402|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (2402:9): [True: 0, False: 0]
  ------------------
 2403|      0|      io_cb->close(fp);
 2404|      0|    }
 2405|      0|  }
 2406|      0|  free(offsets);
 2407|       |  // Avoid a double-free in the `error:` cleanup below, which is reached
 2408|       |  // when frame_get_metalayers / frame_get_vlmetalayers reject a malformed
 2409|       |  // metalayer index after we've already freed `offsets` here.
 2410|      0|  offsets = NULL;
 2411|       |
 2412|       |  // cframes and sframes have different ways to store chunks with special values:
 2413|       |  // 1) cframes represent special chunks as negative offsets
 2414|       |  // 2) sframes does not have the concept of offsets, but rather of data pointers (.data)
 2415|       |  //    so they always have a pointer to a special chunk
 2416|       |  // This is why cframes and sframes have different cbytes and hence, we cannot enforce acc_bytes == schunk->cbytes
 2417|       |  // In the future, maybe we could provide special meanings for .data[i] > 0x7FFFFFFF, but not there yet
 2418|       |  // if (rc < 0 || acc_nbytes != nbytes || acc_cbytes != cbytes) {
 2419|      0|  if (rc < 0 || acc_nbytes != nbytes) {
  ------------------
  |  Branch (2419:7): [True: 0, False: 0]
  |  Branch (2419:17): [True: 0, False: 0]
  ------------------
 2420|      0|    goto error;
 2421|      0|  }
 2422|       |  // Update counters
 2423|      0|  schunk->cbytes = acc_cbytes;
 2424|      0|  schunk->blocksize = blocksize;
 2425|       |
 2426|    197|  out:
 2427|    197|  rc = frame_get_metalayers(frame, schunk);
 2428|    197|  if (rc < 0) {
  ------------------
  |  Branch (2428:7): [True: 3, False: 194]
  ------------------
 2429|      3|    BLOSC_TRACE_ERROR("Cannot access the metalayers.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2430|      3|    goto error;
 2431|      3|  }
 2432|       |
 2433|    194|  rc = frame_get_vlmetalayers(frame, schunk);
 2434|    194|  if (rc < 0) {
  ------------------
  |  Branch (2434:7): [True: 68, False: 126]
  ------------------
 2435|     68|    BLOSC_TRACE_ERROR("Cannot access the vlmetalayers.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2436|     68|    goto error;
 2437|     68|  }
 2438|       |
 2439|    126|  return schunk;
 2440|       |
 2441|  4.73k|error:
 2442|  4.73k|  free(cparams);
 2443|  4.73k|  free(dparams);
 2444|  4.73k|  free(offsets);
 2445|  4.73k|  if (schunk != NULL) {
  ------------------
  |  Branch (2445:7): [True: 4.73k, False: 0]
  ------------------
 2446|  4.73k|    blosc2_schunk_free(schunk);
 2447|  4.73k|  }
 2448|  4.73k|  if (!frame_attached) {
  ------------------
  |  Branch (2448:7): [True: 0, False: 4.73k]
  ------------------
 2449|      0|    frame->schunk = NULL;
 2450|      0|    frame_free(frame);
 2451|      0|  }
 2452|       |  return NULL;
 2453|    194|}
get_coffset:
 2475|    789|                int64_t nchunk, int64_t nchunks, int64_t *offset) {
 2476|    789|  int32_t off_cbytes;
 2477|       |  // Get the offset to nchunk
 2478|    789|  uint8_t *coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &off_cbytes);
 2479|    789|  if (coffsets == NULL) {
  ------------------
  |  Branch (2479:7): [True: 0, False: 789]
  ------------------
 2480|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2481|      0|    return BLOSC2_ERROR_DATA;
 2482|      0|  }
 2483|       |
 2484|       |  // Get the 64-bit offset
 2485|    789|  int rc = blosc2_getitem(coffsets, off_cbytes, (int32_t)nchunk, 1, offset, (int32_t)sizeof(int64_t));
 2486|    789|  if (rc < 0) {
  ------------------
  |  Branch (2486:7): [True: 1, False: 788]
  ------------------
 2487|      1|    BLOSC_TRACE_ERROR("Problems retrieving a chunk offset.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2488|    788|  } else if (!frame->sframe && *offset >= 0) {
  ------------------
  |  Branch (2488:14): [True: 788, False: 0]
  |  Branch (2488:32): [True: 503, False: 285]
  ------------------
 2489|    503|    if (cbytes < 0 || cbytes > INT64_MAX - header_len) {
  ------------------
  |  Branch (2489:9): [True: 0, False: 503]
  |  Branch (2489:23): [True: 143, False: 360]
  ------------------
 2490|    143|      BLOSC_TRACE_ERROR("Invalid compressed size in frame header.");
  ------------------
  |  |   93|    143|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    143|    do {                                            \
  |  |  |  |   98|    143|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    143|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 143, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    143|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2491|    143|      return BLOSC2_ERROR_INVALID_HEADER;
 2492|    143|    }
 2493|    360|    if (*offset > INT64_MAX - header_len) {
  ------------------
  |  Branch (2493:9): [True: 0, False: 360]
  ------------------
 2494|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2495|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2496|      0|    }
 2497|    360|    int64_t chunk_pos = header_len + *offset;
 2498|    360|    int64_t data_limit = header_len + cbytes;
 2499|    360|    if (chunk_pos < header_len ||
  ------------------
  |  Branch (2499:9): [True: 0, False: 360]
  ------------------
 2500|    360|        chunk_pos > data_limit - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2500:9): [True: 0, False: 360]
  ------------------
 2501|    360|        chunk_pos > frame->len - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2501:9): [True: 0, False: 360]
  ------------------
 2502|      0|      BLOSC_TRACE_ERROR("Cannot read chunk %" PRId64 " outside of frame boundary.", 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2504|      0|    }
 2505|    360|  }
 2506|       |
 2507|    646|  return rc;
 2508|    789|}
frame_special_chunk:
 2513|    285|                        uint8_t** chunk, int32_t cbytes, bool *needs_free) {
 2514|    285|  int rc = 0;
 2515|    285|  *chunk = malloc(cbytes);
 2516|    285|  *needs_free = true;
 2517|       |
 2518|       |  // Detect the kind of special value
 2519|    285|  uint64_t zeros_mask = (uint64_t) BLOSC2_SPECIAL_ZERO << (8 * 7);  // chunk of zeros
 2520|    285|  uint64_t nans_mask = (uint64_t) BLOSC2_SPECIAL_NAN << (8 * 7);  // chunk of NaNs
 2521|    285|  uint64_t uninit_mask = (uint64_t) BLOSC2_SPECIAL_UNINIT << (8 * 7);  // chunk of uninit values
 2522|       |
 2523|    285|  blosc2_cparams cparams = BLOSC2_CPARAMS_DEFAULTS;
 2524|    285|  cparams.typesize = typesize;
 2525|    285|  cparams.blocksize = blocksize;
 2526|    285|  if (special_value & zeros_mask) {
  ------------------
  |  Branch (2526:7): [True: 274, False: 11]
  ------------------
 2527|    274|    rc = blosc2_chunk_zeros(cparams, nbytes, *chunk, cbytes);
 2528|    274|    if (rc < 0) {
  ------------------
  |  Branch (2528:9): [True: 4, False: 270]
  ------------------
 2529|      4|      BLOSC_TRACE_ERROR("Error creating a zero chunk");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2530|      4|    }
 2531|    274|  }
 2532|     11|  else if (special_value & uninit_mask) {
  ------------------
  |  Branch (2532:12): [True: 7, False: 4]
  ------------------
 2533|      7|    rc = blosc2_chunk_uninit(cparams, nbytes, *chunk, cbytes);
 2534|      7|    if (rc < 0) {
  ------------------
  |  Branch (2534:9): [True: 1, False: 6]
  ------------------
 2535|      1|      BLOSC_TRACE_ERROR("Error creating a non initialized chunk");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2536|      1|    }
 2537|      7|  }
 2538|      4|  else if (special_value & nans_mask) {
  ------------------
  |  Branch (2538:12): [True: 2, False: 2]
  ------------------
 2539|      2|    rc = blosc2_chunk_nans(cparams, nbytes, *chunk, cbytes);
 2540|      2|    if (rc < 0) {
  ------------------
  |  Branch (2540:9): [True: 0, False: 2]
  ------------------
 2541|      0|      BLOSC_TRACE_ERROR("Error creating a nan 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2542|      0|    }
 2543|      2|  }
 2544|      2|  else {
 2545|      2|    BLOSC_TRACE_ERROR("Special value not recognized: %" PRId64 "", special_value);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2546|      2|    rc = BLOSC2_ERROR_DATA;
 2547|      2|  }
 2548|       |
 2549|    285|  if (rc < 0) {
  ------------------
  |  Branch (2549:7): [True: 7, False: 278]
  ------------------
 2550|      7|    free(*chunk);
 2551|      7|    *needs_free = false;
 2552|      7|    *chunk = NULL;
 2553|      7|  }
 2554|       |
 2555|    285|  return rc;
 2556|    285|}
frame_get_chunk:
 2569|    789|int frame_get_chunk(blosc2_frame_s *frame, int64_t nchunk, uint8_t **chunk, bool *needs_free) {
 2570|    789|  int32_t header_len;
 2571|    789|  int64_t frame_len;
 2572|    789|  int64_t nbytes;
 2573|    789|  int64_t cbytes;
 2574|    789|  int32_t blocksize;
 2575|    789|  int32_t chunksize;
 2576|    789|  int64_t nchunks;
 2577|    789|  int32_t typesize;
 2578|    789|  int64_t offset;
 2579|    789|  int32_t chunk_cbytes;
 2580|    789|  int rc;
 2581|       |
 2582|    789|  *chunk = NULL;
 2583|    789|  *needs_free = false;
 2584|    789|  rc = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 2585|    789|                       &blocksize, &chunksize, &nchunks,
 2586|    789|                       &typesize, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 2587|    789|                       frame->schunk->storage->io);
 2588|    789|  if (rc < 0) {
  ------------------
  |  Branch (2588:7): [True: 0, False: 789]
  ------------------
 2589|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2590|      0|    return rc;
 2591|      0|  }
 2592|       |
 2593|    789|  if ((nchunks > 0) && (nchunk >= nchunks)) {
  ------------------
  |  Branch (2593:7): [True: 789, False: 0]
  |  Branch (2593:24): [True: 0, False: 789]
  ------------------
 2594|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2595|      0|                    "('%" PRId64 "') in frame.", nchunk, nchunks);
 2596|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2597|      0|  }
 2598|       |
 2599|       |  // Get the offset to nchunk
 2600|    789|  rc = get_coffset(frame, header_len, cbytes, nchunk, nchunks, &offset);
 2601|    789|  if (rc < 0) {
  ------------------
  |  Branch (2601:7): [True: 144, False: 645]
  ------------------
 2602|    144|    BLOSC_TRACE_ERROR("Unable to get offset to chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    144|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    144|    do {                                            \
  |  |  |  |   98|    144|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    144|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 144, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    144|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2603|    144|    return rc;
 2604|    144|  }
 2605|       |
 2606|    645|  if (offset < 0) {
  ------------------
  |  Branch (2606:7): [True: 285, False: 360]
  ------------------
 2607|       |    // Special value
 2608|    285|    chunk_cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 2609|    285|    int32_t chunksize_ = chunksize;
 2610|    285|    if ((nchunk == nchunks - 1) && (nbytes % chunksize)) {
  ------------------
  |  Branch (2610:9): [True: 0, False: 285]
  |  Branch (2610:36): [True: 0, False: 0]
  ------------------
 2611|       |      // Last chunk is incomplete.  Compute its actual size.
 2612|      0|      chunksize_ = (int32_t) (nbytes % chunksize);
 2613|      0|    }
 2614|    285|    rc = frame_special_chunk(offset, chunksize_, typesize, blocksize, chunk, chunk_cbytes, needs_free);
 2615|    285|    if (rc < 0) {
  ------------------
  |  Branch (2615:9): [True: 7, False: 278]
  ------------------
 2616|      7|      return rc;
 2617|      7|    }
 2618|    278|    goto end;
 2619|    285|  }
 2620|       |
 2621|    360|  if (frame->sframe) {
  ------------------
  |  Branch (2621:7): [True: 0, False: 360]
  ------------------
 2622|       |    // Sparse on-disk
 2623|      0|    nchunk = offset;
 2624|      0|    return sframe_get_chunk(frame, nchunk, chunk, needs_free);
 2625|      0|  }
 2626|       |
 2627|    360|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2628|    360|  if (io_cb == NULL) {
  ------------------
  |  Branch (2628:7): [True: 0, False: 360]
  ------------------
 2629|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2630|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 2631|      0|  }
 2632|       |
 2633|    360|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (2633:7): [True: 0, False: 360]
  ------------------
 2634|      0|    uint8_t* header_ptr;
 2635|      0|    uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 2636|      0|    void* fp = io_cb->open(frame->urlpath, "rb", frame->schunk->storage->io->params);
 2637|      0|    if (fp == NULL) {
  ------------------
  |  Branch (2637:9): [True: 0, False: 0]
  ------------------
 2638|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2639|      0|      return BLOSC2_ERROR_FILE_OPEN;
 2640|      0|    }
 2641|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (2641:9): [True: 0, False: 0]
  ------------------
 2642|      0|      header_ptr = header;
 2643|      0|    int64_t io_pos = frame->file_offset + header_len + offset;
 2644|      0|    int64_t rbytes = io_cb->read((void**)&header_ptr, 1, sizeof(header), io_pos, fp);
 2645|      0|    if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2645:9): [True: 0, False: 0]
  ------------------
 2646|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2647|      0|      io_cb->close(fp);
 2648|      0|      return BLOSC2_ERROR_FILE_READ;
 2649|      0|    }
 2650|      0|    rc = blosc2_cbuffer_sizes(header_ptr, NULL, &chunk_cbytes, NULL);
 2651|      0|    if (rc < 0) {
  ------------------
  |  Branch (2651:9): [True: 0, False: 0]
  ------------------
 2652|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2653|      0|      io_cb->close(fp);
 2654|      0|      return rc;
 2655|      0|    }
 2656|      0|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2656:9): [True: 0, False: 0]
  ------------------
 2657|      0|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (2657:9): [True: 0, False: 0]
  ------------------
 2658|      0|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (2658:9): [True: 0, False: 0]
  ------------------
 2659|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2660|      0|      io_cb->close(fp);
 2661|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2662|      0|    }
 2663|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2663:9): [True: 0, False: 0]
  ------------------
 2664|      0|      *chunk = malloc(chunk_cbytes);
 2665|      0|      *needs_free = true;
 2666|      0|    }
 2667|      0|    else {
 2668|      0|      *needs_free = false;
 2669|      0|    }
 2670|       |
 2671|      0|    io_pos = frame->file_offset + header_len + offset;
 2672|      0|    rbytes = io_cb->read((void**)chunk, 1, chunk_cbytes, io_pos, fp);
 2673|      0|    io_cb->close(fp);
 2674|      0|    if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (2674:9): [True: 0, False: 0]
  ------------------
 2675|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2676|      0|      return BLOSC2_ERROR_FILE_READ;
 2677|      0|    }
 2678|       |
 2679|    360|  } else {
 2680|       |    // The chunk is in memory and just one pointer away
 2681|    360|    *chunk = frame->cframe + header_len + offset;
 2682|    360|    rc = blosc2_cbuffer_sizes(*chunk, NULL, &chunk_cbytes, NULL);
 2683|    360|    if (rc < 0) {
  ------------------
  |  Branch (2683:9): [True: 2, False: 358]
  ------------------
 2684|      2|      return rc;
 2685|      2|    }
 2686|    358|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2686:9): [True: 0, False: 358]
  ------------------
 2687|    358|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (2687:9): [True: 0, False: 358]
  ------------------
 2688|    358|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (2688:9): [True: 63, False: 295]
  ------------------
 2689|     63|      BLOSC_TRACE_ERROR("Invalid chunk size in frame for chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|     63|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     63|    do {                                            \
  |  |  |  |   98|     63|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     63|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 63, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     63|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2690|     63|      return BLOSC2_ERROR_INVALID_HEADER;
 2691|     63|    }
 2692|    358|  }
 2693|       |
 2694|    573|  end:
 2695|    573|  return (int32_t)chunk_cbytes;
 2696|    360|}
frame_decompress_chunk:
 4389|    437|int frame_decompress_chunk(blosc2_context *dctx, blosc2_frame_s* frame, int64_t nchunk, void *dest, int32_t nbytes) {
 4390|    437|  uint8_t* src;
 4391|    437|  bool needs_free;
 4392|    437|  int32_t chunk_nbytes;
 4393|    437|  int32_t chunk_cbytes;
 4394|    437|  int rc;
 4395|       |
 4396|    437|  rc = frame_get_chunk(frame, nchunk, &src, &needs_free);
 4397|    437|  if (rc < 0) {
  ------------------
  |  Branch (4397:7): [True: 50, False: 387]
  ------------------
 4398|     50|    BLOSC_TRACE_ERROR("Cannot get the chunk in position %" PRId64 ".", nchunk);
  ------------------
  |  |   93|     50|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     50|    do {                                            \
  |  |  |  |   98|     50|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     50|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 50, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     50|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4399|     50|    goto end;
 4400|     50|  }
 4401|    387|  chunk_cbytes = rc;
 4402|    387|  if (chunk_cbytes < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (4402:7): [True: 0, False: 387]
  ------------------
 4403|       |    /* Not enough input to read `nbytes` */
 4404|      0|    rc = BLOSC2_ERROR_READ_BUFFER;
 4405|      0|  }
 4406|       |
 4407|    387|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 4408|    387|  if (rc < 0) {
  ------------------
  |  Branch (4408:7): [True: 0, False: 387]
  ------------------
 4409|      0|    goto end;
 4410|      0|  }
 4411|       |
 4412|       |  /* Create a buffer for destination */
 4413|    387|  if (chunk_nbytes > nbytes) {
  ------------------
  |  Branch (4413:7): [True: 2, False: 385]
  ------------------
 4414|      2|    BLOSC_TRACE_ERROR("Not enough space for decompressing in dest.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4415|      2|    rc = BLOSC2_ERROR_WRITE_BUFFER;
 4416|      2|    goto end;
 4417|      2|  }
 4418|       |  /* And decompress it */
 4419|    385|  dctx->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
 4420|    385|  int chunksize = rc = blosc2_decompress_ctx(dctx, src, chunk_cbytes, dest, nbytes);
 4421|    385|  if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (4421:7): [True: 67, False: 318]
  |  Branch (4421:24): [True: 1, False: 317]
  ------------------
 4422|     68|    BLOSC_TRACE_ERROR("Error in decompressing chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4423|     68|    if (chunksize >= 0)
  ------------------
  |  Branch (4423:9): [True: 1, False: 67]
  ------------------
 4424|      1|      rc = BLOSC2_ERROR_FAILURE;
 4425|     68|  }
 4426|    437|  end:
 4427|    437|  if (needs_free) {
  ------------------
  |  Branch (4427:7): [True: 112, False: 325]
  ------------------
 4428|    112|    free(src);
 4429|    112|  }
 4430|    437|  return rc;
 4431|    385|}
frame.c:get_coffsets_nbytes:
  569|    757|                               int32_t *coffsets_nbytes, const blosc2_io *io) {
  570|    757|  int32_t chunk_cbytes;
  571|    757|  int rc;
  572|    757|  int64_t off_pos = header_len;
  573|    757|  if (!frame->sframe) {
  ------------------
  |  Branch (573:7): [True: 757, False: 0]
  ------------------
  574|    757|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (574:9): [True: 59, False: 698]
  ------------------
  575|     59|      off_pos += cbytes;
  576|     59|    }
  577|    757|  }
  578|       |
  579|    757|  if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (579:7): [True: 30, False: 727]
  |  Branch (579:22): [True: 0, False: 727]
  ------------------
  580|    727|      off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (580:7): [True: 25, False: 702]
  ------------------
  581|     55|    BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   93|     55|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     55|    do {                                            \
  |  |  |  |   98|     55|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     55|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 55, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     55|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  582|     55|    return BLOSC2_ERROR_INVALID_HEADER;
  583|     55|  }
  584|       |
  585|    702|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (585:7): [True: 702, False: 0]
  ------------------
  586|    702|    uint8_t *off_start = frame->cframe + off_pos;
  587|    702|    rc = blosc2_cbuffer_sizes(off_start, coffsets_nbytes, &chunk_cbytes, NULL);
  588|    702|    if (rc < 0) {
  ------------------
  |  Branch (588:9): [True: 7, False: 695]
  ------------------
  589|      7|      return rc;
  590|      7|    }
  591|    695|    if (chunk_cbytes < 0 || off_pos + chunk_cbytes > frame->len) {
  ------------------
  |  Branch (591:9): [True: 0, False: 695]
  |  Branch (591:29): [True: 22, False: 673]
  ------------------
  592|     22|      BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   93|     22|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     22|    do {                                            \
  |  |  |  |   98|     22|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     22|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 22, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     22|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  593|     22|      return BLOSC2_ERROR_INVALID_HEADER;
  594|     22|    }
  595|    673|    return 0;
  596|    695|  }
  597|       |
  598|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
  599|      0|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + FRAME_TRAILER_MINLEN > frame->len) {
  ------------------
  |  |   57|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (599:7): [True: 0, False: 0]
  |  Branch (599:56): [True: 0, False: 0]
  ------------------
  600|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  602|      0|  }
  603|       |
  604|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
  605|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (605:7): [True: 0, False: 0]
  ------------------
  606|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|      0|    return BLOSC2_ERROR_PLUGIN_IO;
  608|      0|  }
  609|       |
  610|      0|  uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
  611|      0|  uint8_t *header_ptr = header;
  612|      0|  void *fp = NULL;
  613|      0|  int64_t io_pos = 0;
  614|      0|  if (frame->sframe) {
  ------------------
  |  Branch (614:7): [True: 0, False: 0]
  ------------------
  615|      0|    fp = sframe_open_index(frame->urlpath, "rb", io);
  616|      0|    if (fp == NULL) {
  ------------------
  |  Branch (616:9): [True: 0, False: 0]
  ------------------
  617|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  618|      0|      return BLOSC2_ERROR_FILE_OPEN;
  619|      0|    }
  620|      0|    io_pos = off_pos;
  621|      0|  }
  622|      0|  else {
  623|      0|    fp = io_cb->open(frame->urlpath, "rb", io->params);
  624|      0|    if (fp == NULL) {
  ------------------
  |  Branch (624:9): [True: 0, False: 0]
  ------------------
  625|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  626|      0|      return BLOSC2_ERROR_FILE_OPEN;
  627|      0|    }
  628|      0|    io_pos = frame->file_offset + off_pos;
  629|      0|  }
  630|      0|  int64_t rbytes = io_cb->read((void**)&header_ptr, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
  631|      0|  io_cb->close(fp);
  632|      0|  if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (632:7): [True: 0, False: 0]
  ------------------
  633|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  634|      0|    return BLOSC2_ERROR_FILE_READ;
  635|      0|  }
  636|       |
  637|      0|  rc = blosc2_cbuffer_sizes(header_ptr, coffsets_nbytes, &chunk_cbytes, NULL);
  638|      0|  if (rc < 0) {
  ------------------
  |  Branch (638:7): [True: 0, False: 0]
  ------------------
  639|      0|    return rc;
  640|      0|  }
  641|       |
  642|      0|  if (chunk_cbytes < 0 || off_pos + chunk_cbytes > trailer_offset) {
  ------------------
  |  Branch (642:7): [True: 0, False: 0]
  |  Branch (642:27): [True: 0, False: 0]
  ------------------
  643|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  644|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  645|      0|  }
  646|       |
  647|      0|  return 0;
  648|      0|}
frame.c:get_meta_from_header:
 1581|    197|                                int32_t header_len) {
 1582|    197|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|    197|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 1583|    197|  int64_t header_pos = FRAME_IDX_SIZE;
  ------------------
  |  |   50|    197|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   49|    197|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|    197|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|    197|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   42|    197|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   41|    197|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|    197|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|    197|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|    197|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|    197|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|    197|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|    197|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|    197|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|    197|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|    197|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|    197|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1584|       |
 1585|       |  // Get the size for the index of metalayers
 1586|    197|  uint16_t idx_size;
 1587|    197|  header_pos += sizeof(idx_size);
 1588|    197|  if (header_len < header_pos) {
  ------------------
  |  Branch (1588:7): [True: 0, False: 197]
  ------------------
 1589|      0|    return BLOSC2_ERROR_READ_BUFFER;
 1590|      0|  }
 1591|    197|  from_big(&idx_size, header + FRAME_IDX_SIZE, sizeof(idx_size));
  ------------------
  |  |   32|    197|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1592|       |
 1593|       |  // Get the actual index of metalayers
 1594|    197|  uint8_t* metalayers_idx = header + FRAME_IDX_SIZE + 2;
  ------------------
  |  |   50|    197|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   49|    197|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   48|    197|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|    197|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   42|    197|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   41|    197|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|    197|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|    197|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|    197|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|    197|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|    197|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|    197|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|    197|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|    197|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|    197|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|    197|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1595|    197|  header_pos += 1;
 1596|    197|  if (header_len < header_pos) {
  ------------------
  |  Branch (1596:7): [True: 0, False: 197]
  ------------------
 1597|      0|    return BLOSC2_ERROR_READ_BUFFER;
 1598|      0|  }
 1599|    197|  if (metalayers_idx[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (1599:7): [True: 1, False: 196]
  ------------------
 1600|      1|    return BLOSC2_ERROR_DATA;
 1601|      1|  }
 1602|    196|  uint8_t* idxp = metalayers_idx + 1;
 1603|    196|  uint16_t nmetalayers;
 1604|    196|  header_pos += sizeof(nmetalayers);
 1605|    196|  if (header_len < header_pos) {
  ------------------
  |  Branch (1605:7): [True: 0, False: 196]
  ------------------
 1606|      0|    return BLOSC2_ERROR_READ_BUFFER;
 1607|      0|  }
 1608|    196|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   32|    196|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1609|    196|  idxp += 2;
 1610|    196|  if (nmetalayers > BLOSC2_MAX_METALAYERS) {
  ------------------
  |  | 1698|    196|#define BLOSC2_MAX_METALAYERS 16
  ------------------
  |  Branch (1610:7): [True: 1, False: 195]
  ------------------
 1611|      1|    return BLOSC2_ERROR_DATA;
 1612|      1|  }
 1613|    195|  schunk->nmetalayers = nmetalayers;
 1614|       |
 1615|       |  // Populate the metalayers and its serialized values
 1616|    195|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (1616:28): [True: 1, False: 194]
  ------------------
 1617|      1|    header_pos += 1;
 1618|      1|    if (header_len < header_pos) {
  ------------------
  |  Branch (1618:9): [True: 0, False: 1]
  ------------------
 1619|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1620|      0|    }
 1621|      1|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (1621:9): [True: 1, False: 0]
  ------------------
 1622|      1|      return BLOSC2_ERROR_DATA;
 1623|      1|    }
 1624|      0|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 1625|      0|    if (metalayer == NULL) {
  ------------------
  |  Branch (1625:9): [True: 0, False: 0]
  ------------------
 1626|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 1627|      0|    }
 1628|      0|    schunk->metalayers[nmetalayer] = metalayer;
 1629|       |
 1630|       |    // Populate the metalayer string
 1631|      0|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 1632|      0|    idxp += 1;
 1633|      0|    header_pos += nslen;
 1634|      0|    if (header_len < header_pos) {
  ------------------
  |  Branch (1634:9): [True: 0, False: 0]
  ------------------
 1635|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1636|      0|    }
 1637|      0|    char* ns = malloc((size_t)nslen + 1);
 1638|      0|    if (ns == NULL) {
  ------------------
  |  Branch (1638:9): [True: 0, False: 0]
  ------------------
 1639|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 1640|      0|    }
 1641|      0|    memcpy(ns, idxp, nslen);
 1642|      0|    ns[nslen] = '\0';
 1643|      0|    idxp += nslen;
 1644|      0|    metalayer->name = ns;
 1645|       |
 1646|       |    // Populate the serialized value for this metalayer
 1647|       |    // Get the offset
 1648|      0|    header_pos += 1;
 1649|      0|    if (header_len < header_pos) {
  ------------------
  |  Branch (1649:9): [True: 0, False: 0]
  ------------------
 1650|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1651|      0|    }
 1652|      0|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (1652:9): [True: 0, False: 0]
  ------------------
 1653|      0|      return BLOSC2_ERROR_DATA;
 1654|      0|    }
 1655|      0|    idxp += 1;
 1656|      0|    int32_t offset;
 1657|      0|    header_pos += sizeof(offset);
 1658|      0|    if (header_len < header_pos) {
  ------------------
  |  Branch (1658:9): [True: 0, False: 0]
  ------------------
 1659|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1660|      0|    }
 1661|      0|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   32|      0|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1662|      0|    idxp += 4;
 1663|      0|    if (offset < 0 || offset >= header_len) {
  ------------------
  |  Branch (1663:9): [True: 0, False: 0]
  |  Branch (1663:23): [True: 0, False: 0]
  ------------------
 1664|       |      // Offset is less than zero or exceeds header length
 1665|      0|      return BLOSC2_ERROR_DATA;
 1666|      0|    }
 1667|       |    // Go to offset and see if we have the correct marker
 1668|      0|    uint8_t* content_marker = header + offset;
 1669|      0|    if ((int64_t)header_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (1669:9): [True: 0, False: 0]
  ------------------
 1670|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1671|      0|    }
 1672|      0|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (1672:9): [True: 0, False: 0]
  ------------------
 1673|      0|      return BLOSC2_ERROR_DATA;
 1674|      0|    }
 1675|       |
 1676|       |    // Read the size of the content
 1677|      0|    int32_t content_len;
 1678|      0|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   32|      0|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1679|      0|    if (content_len < 0) {
  ------------------
  |  Branch (1679:9): [True: 0, False: 0]
  ------------------
 1680|      0|      return BLOSC2_ERROR_DATA;
 1681|      0|    }
 1682|      0|    metalayer->content_len = content_len;
 1683|       |
 1684|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 1685|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 1686|       |    // bounds check, which would let memcpy below read past the header buffer.
 1687|      0|    if ((int64_t)header_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (1687:9): [True: 0, False: 0]
  ------------------
 1688|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1689|      0|    }
 1690|      0|    char* content = malloc((size_t)content_len);
 1691|       |    // malloc(0) is allowed to return NULL, and blosc2_meta_add accepts
 1692|       |    // content_len == 0, so only treat NULL as an allocation failure when
 1693|       |    // a non-zero allocation was requested.
 1694|      0|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (1694:9): [True: 0, False: 0]
  |  Branch (1694:28): [True: 0, False: 0]
  ------------------
 1695|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 1696|      0|    }
 1697|      0|    if (content_len > 0) {
  ------------------
  |  Branch (1697:9): [True: 0, False: 0]
  ------------------
 1698|      0|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 1699|      0|    }
 1700|      0|    metalayer->content = (uint8_t*)content;
 1701|      0|  }
 1702|       |
 1703|    194|  return 1;
 1704|    195|}
frame.c:get_vlmeta_from_trailer:
 1784|    192|                                   int32_t trailer_len) {
 1785|       |
 1786|    192|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|    192|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 1787|    192|  int64_t trailer_pos = FRAME_TRAILER_VLMETALAYERS + 2;
  ------------------
  |  |   59|    192|#define FRAME_TRAILER_VLMETALAYERS (2)
  ------------------
 1788|    192|  uint8_t* idxp = trailer + trailer_pos;
 1789|       |
 1790|       |  // Get the size for the index of metalayers
 1791|    192|  trailer_pos += 2;
 1792|    192|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (1792:7): [True: 0, False: 192]
  ------------------
 1793|      0|    return BLOSC2_ERROR_READ_BUFFER;
 1794|      0|  }
 1795|    192|  uint16_t idx_size;
 1796|    192|  from_big(&idx_size, idxp, sizeof(idx_size));
  ------------------
  |  |   32|    192|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1797|    192|  idxp += 2;
 1798|       |
 1799|    192|  trailer_pos += 1;
 1800|       |  // Get the actual index of metalayers
 1801|    192|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (1801:7): [True: 0, False: 192]
  ------------------
 1802|      0|    return BLOSC2_ERROR_READ_BUFFER;
 1803|      0|  }
 1804|    192|  if (idxp[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (1804:7): [True: 6, False: 186]
  ------------------
 1805|      6|    return BLOSC2_ERROR_DATA;
 1806|      6|  }
 1807|    186|  idxp += 1;
 1808|       |
 1809|       |  // The on-wire encoding is unsigned (uint16 follows the msgpack `0xde`
 1810|       |  // map16 marker), but `schunk->nvlmetalayers` is int16_t. Decoding into a
 1811|       |  // signed local would let raw bytes like 0xff 0xff slip past the
 1812|       |  // `> BLOSC2_MAX_VLMETALAYERS` ceiling as a negative count, after which
 1813|       |  // a later `blosc2_vlmeta_add` would write through `vlmetalayers[-1]`
 1814|       |  // and corrupt adjacent schunk fields. Decode unsigned, then narrow.
 1815|    186|  uint16_t nmetalayers;
 1816|    186|  trailer_pos += sizeof(nmetalayers);
 1817|    186|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (1817:7): [True: 0, False: 186]
  ------------------
 1818|      0|    return BLOSC2_ERROR_READ_BUFFER;
 1819|      0|  }
 1820|    186|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   32|    186|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1821|    186|  idxp += 2;
 1822|    186|  if (nmetalayers > BLOSC2_MAX_VLMETALAYERS) {
  ------------------
  |  | 1704|    186|#define BLOSC2_MAX_VLMETALAYERS (8 * 1024)
  ------------------
  |  Branch (1822:7): [True: 54, False: 132]
  ------------------
 1823|     54|    return BLOSC2_ERROR_DATA;
 1824|     54|  }
 1825|    132|  schunk->nvlmetalayers = (int16_t)nmetalayers;
 1826|       |
 1827|       |  // Populate the metalayers and its serialized values
 1828|    256|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (1828:28): [True: 130, False: 126]
  ------------------
 1829|    130|    trailer_pos += 1;
 1830|    130|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (1830:9): [True: 0, False: 130]
  ------------------
 1831|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1832|      0|    }
 1833|    130|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (1833:9): [True: 0, False: 130]
  ------------------
 1834|      0|      return BLOSC2_ERROR_DATA;
 1835|      0|    }
 1836|    130|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 1837|    130|    if (metalayer == NULL) {
  ------------------
  |  Branch (1837:9): [True: 0, False: 130]
  ------------------
 1838|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 1839|      0|    }
 1840|    130|    schunk->vlmetalayers[nmetalayer] = metalayer;
 1841|       |
 1842|       |    // Populate the metalayer string
 1843|    130|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 1844|    130|    idxp += 1;
 1845|    130|    trailer_pos += nslen;
 1846|    130|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (1846:9): [True: 0, False: 130]
  ------------------
 1847|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1848|      0|    }
 1849|    130|    char* ns = malloc((size_t)nslen + 1);
 1850|    130|    if (ns == NULL) {
  ------------------
  |  Branch (1850:9): [True: 0, False: 130]
  ------------------
 1851|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 1852|      0|    }
 1853|    130|    memcpy(ns, idxp, nslen);
 1854|    130|    ns[nslen] = '\0';
 1855|    130|    idxp += nslen;
 1856|    130|    metalayer->name = ns;
 1857|       |
 1858|       |    // Populate the serialized value for this metalayer
 1859|       |    // Get the offset
 1860|    130|    trailer_pos += 1;
 1861|    130|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (1861:9): [True: 0, False: 130]
  ------------------
 1862|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1863|      0|    }
 1864|    130|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (1864:9): [True: 0, False: 130]
  ------------------
 1865|      0|      return BLOSC2_ERROR_DATA;
 1866|      0|    }
 1867|    130|    idxp += 1;
 1868|    130|    int32_t offset;
 1869|    130|    trailer_pos += sizeof(offset);
 1870|    130|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (1870:9): [True: 0, False: 130]
  ------------------
 1871|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1872|      0|    }
 1873|    130|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   32|    130|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1874|    130|    idxp += 4;
 1875|    130|    if (offset < 0 || offset >= trailer_len) {
  ------------------
  |  Branch (1875:9): [True: 1, False: 129]
  |  Branch (1875:23): [True: 5, False: 124]
  ------------------
 1876|       |      // Offset is less than zero or exceeds trailer length
 1877|      6|      return BLOSC2_ERROR_DATA;
 1878|      6|    }
 1879|       |    // Go to offset and see if we have the correct marker
 1880|    124|    uint8_t* content_marker = trailer + offset;
 1881|    124|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (1881:9): [True: 0, False: 124]
  ------------------
 1882|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1883|      0|    }
 1884|    124|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (1884:9): [True: 0, False: 124]
  ------------------
 1885|      0|      return BLOSC2_ERROR_DATA;
 1886|      0|    }
 1887|       |
 1888|       |    // Read the size of the content
 1889|    124|    int32_t content_len;
 1890|    124|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   32|    124|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1891|    124|    if (content_len < 0) {
  ------------------
  |  Branch (1891:9): [True: 0, False: 124]
  ------------------
 1892|      0|      return BLOSC2_ERROR_DATA;
 1893|      0|    }
 1894|    124|    metalayer->content_len = content_len;
 1895|       |
 1896|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 1897|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 1898|       |    // bounds check, which would let memcpy below read past the trailer buffer.
 1899|    124|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (1899:9): [True: 0, False: 124]
  ------------------
 1900|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1901|      0|    }
 1902|    124|    char* content = malloc((size_t)content_len);
 1903|       |    // Same zero-length carve-out as in get_meta_from_header: malloc(0) may
 1904|       |    // return NULL on some platforms, and the public API allows
 1905|       |    // content_len == 0, so don't reject a valid empty vlmetalayer.
 1906|    124|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (1906:9): [True: 121, False: 3]
  |  Branch (1906:28): [True: 0, False: 121]
  ------------------
 1907|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 1908|      0|    }
 1909|    124|    if (content_len > 0) {
  ------------------
  |  Branch (1909:9): [True: 121, False: 3]
  ------------------
 1910|    121|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 1911|    121|    }
 1912|    124|    metalayer->content = (uint8_t*)content;
 1913|    124|  }
 1914|    126|  return 1;
 1915|    132|}
frame.c:validate_offsets_chunk:
 2073|  4.72k|                                  int64_t nchunks) {
 2074|  4.72k|  int32_t coffsets_cbytes = 0;
 2075|  4.72k|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 2076|  4.72k|  if (coffsets == NULL) {
  ------------------
  |  Branch (2076:7): [True: 177, False: 4.54k]
  ------------------
 2077|    177|    BLOSC_TRACE_ERROR("Cannot get compressed offsets from frame.");
  ------------------
  |  |   93|    177|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    177|    do {                                            \
  |  |  |  |   98|    177|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    177|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 177, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    177|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2078|    177|    return BLOSC2_ERROR_DATA;
 2079|    177|  }
 2080|       |
 2081|  4.54k|  int32_t offsets_nbytes;
 2082|  4.54k|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (2082:7): [True: 0, False: 4.54k]
  ------------------
 2083|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2084|      0|    return BLOSC2_ERROR_FAILURE;
 2085|      0|  }
 2086|       |
 2087|  4.54k|  int64_t* offsets = (int64_t*)malloc((size_t)offsets_nbytes);
 2088|  4.54k|  if (offsets == NULL) {
  ------------------
  |  Branch (2088:7): [True: 0, False: 4.54k]
  ------------------
 2089|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2090|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2091|      0|  }
 2092|       |
 2093|  4.54k|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 2094|  4.54k|  blosc2_context* dctx = blosc2_create_dctx(off_dparams);
 2095|  4.54k|  if (dctx == NULL) {
  ------------------
  |  Branch (2095:7): [True: 0, False: 4.54k]
  ------------------
 2096|      0|    free(offsets);
 2097|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|      0|    return BLOSC2_ERROR_FAILURE;
 2099|      0|  }
 2100|       |
 2101|  4.54k|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 2102|  4.54k|                                             offsets, offsets_nbytes);
 2103|  4.54k|  blosc2_free_ctx(dctx);
 2104|  4.54k|  if (off_nbytes != offsets_nbytes) {
  ------------------
  |  Branch (2104:7): [True: 3.71k, False: 829]
  ------------------
 2105|  3.71k|    free(offsets);
 2106|  3.71k|    BLOSC_TRACE_ERROR("Cannot decompress offsets chunk.");
  ------------------
  |  |   93|  3.71k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  3.71k|    do {                                            \
  |  |  |  |   98|  3.71k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  3.71k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3.71k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  3.71k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2107|  3.71k|    return BLOSC2_ERROR_DATA;
 2108|  3.71k|  }
 2109|       |
 2110|  14.4M|  for (int64_t i = 0; i < nchunks; ++i) {
  ------------------
  |  Branch (2110:23): [True: 14.4M, False: 352]
  ------------------
 2111|  14.4M|    int64_t offset = offsets[i];
 2112|  14.4M|    if (offset < 0) {
  ------------------
  |  Branch (2112:9): [True: 2.66M, False: 11.7M]
  ------------------
 2113|  2.66M|      continue;
 2114|  2.66M|    }
 2115|  11.7M|    if (offset > INT64_MAX - header_len || offset > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2115:9): [True: 2, False: 11.7M]
  |  Branch (2115:44): [True: 475, False: 11.7M]
  ------------------
 2116|    477|      free(offsets);
 2117|    477|      BLOSC_TRACE_ERROR("Offset for chunk %" PRId64 " is out of bounds.", i);
  ------------------
  |  |   93|    477|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    477|    do {                                            \
  |  |  |  |   98|    477|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    477|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 477, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    477|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2118|    477|      return BLOSC2_ERROR_INVALID_HEADER;
 2119|    477|    }
 2120|       |    /* Offsets do not need to be monotonic.  Frame mutations like insert can append
 2121|       |     * chunk payloads at the end of the cframe while updating the logical chunk order
 2122|       |     * only in the offsets table, so a valid frame may legitimately contain
 2123|       |     * non-monotonic non-negative offsets.
 2124|       |     */
 2125|  11.7M|  }
 2126|       |
 2127|    352|  free(offsets);
 2128|    352|  return 0;
 2129|    829|}

blosc2_schunk_get_cparams:
   66|  4.74k|int blosc2_schunk_get_cparams(blosc2_schunk *schunk, blosc2_cparams **cparams) {
   67|  4.74k|  *cparams = calloc(1, sizeof(blosc2_cparams));
   68|  4.74k|  (*cparams)->schunk = schunk;
   69|  33.2k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (69:19): [True: 28.4k, False: 4.74k]
  ------------------
   70|  28.4k|    (*cparams)->filters[i] = schunk->filters[i];
   71|  28.4k|    (*cparams)->filters_meta[i] = schunk->filters_meta[i];
   72|  28.4k|  }
   73|  4.74k|  (*cparams)->compcode = schunk->compcode;
   74|  4.74k|  (*cparams)->compcode_meta = schunk->compcode_meta;
   75|  4.74k|  (*cparams)->clevel = schunk->clevel;
   76|  4.74k|  (*cparams)->typesize = schunk->typesize;
   77|  4.74k|  (*cparams)->blocksize = schunk->blocksize;
   78|  4.74k|  (*cparams)->splitmode = schunk->splitmode;
   79|  4.74k|  (*cparams)->use_dict = schunk->use_dict;
   80|  4.74k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (80:7): [True: 4.74k, False: 0]
  ------------------
   81|  4.74k|    (*cparams)->nthreads = blosc2_get_nthreads();
   82|  4.74k|  }
   83|      0|  else {
   84|      0|    (*cparams)->nthreads = (int16_t)schunk->cctx->nthreads;
   85|      0|  }
   86|  4.74k|  return 0;
   87|  4.74k|}
blosc2_schunk_get_dparams:
   91|  4.73k|int blosc2_schunk_get_dparams(blosc2_schunk *schunk, blosc2_dparams **dparams) {
   92|  4.73k|  *dparams = calloc(1, sizeof(blosc2_dparams));
   93|  4.73k|  (*dparams)->schunk = schunk;
   94|  4.73k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (94:7): [True: 4.73k, False: 0]
  ------------------
   95|  4.73k|    (*dparams)->nthreads = blosc2_get_nthreads();
   96|  4.73k|  }
   97|      0|  else {
   98|      0|    (*dparams)->nthreads = schunk->dctx->nthreads;
   99|      0|  }
  100|  4.73k|  return 0;
  101|  4.73k|}
blosc2_schunk_free:
  536|  4.86k|int blosc2_schunk_free(blosc2_schunk *schunk) {
  537|  4.86k|  int err = 0;
  538|       |
  539|       |  // If it is a view, the data belongs to original array and should not be freed
  540|  4.86k|  if (schunk->data != NULL && !schunk->view) {
  ------------------
  |  Branch (540:7): [True: 0, False: 4.86k]
  |  Branch (540:31): [True: 0, False: 0]
  ------------------
  541|      0|    for (int i = 0; i < schunk->nchunks; i++) {
  ------------------
  |  Branch (541:21): [True: 0, False: 0]
  ------------------
  542|      0|      free(schunk->data[i]);
  543|      0|    }
  544|      0|    free(schunk->data);
  545|      0|  }
  546|  4.86k|  if (schunk->cctx != NULL)
  ------------------
  |  Branch (546:7): [True: 4.73k, False: 130]
  ------------------
  547|  4.73k|    blosc2_free_ctx(schunk->cctx);
  548|  4.86k|  if (schunk->dctx != NULL)
  ------------------
  |  Branch (548:7): [True: 4.73k, False: 130]
  ------------------
  549|  4.73k|    blosc2_free_ctx(schunk->dctx);
  550|  4.86k|  if (schunk->blockshape != NULL)
  ------------------
  |  Branch (550:7): [True: 0, False: 4.86k]
  ------------------
  551|      0|    free(schunk->blockshape);
  552|       |
  553|  4.86k|  if (schunk->nmetalayers > 0) {
  ------------------
  |  Branch (553:7): [True: 1, False: 4.86k]
  ------------------
  554|      2|    for (int i = 0; i < schunk->nmetalayers; i++) {
  ------------------
  |  Branch (554:21): [True: 1, False: 1]
  ------------------
  555|      1|      if (schunk->metalayers[i] != NULL) {
  ------------------
  |  Branch (555:11): [True: 0, False: 1]
  ------------------
  556|      0|        if (schunk->metalayers[i]->name != NULL)
  ------------------
  |  Branch (556:13): [True: 0, False: 0]
  ------------------
  557|      0|          free(schunk->metalayers[i]->name);
  558|      0|        if (schunk->metalayers[i]->content != NULL)
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|          free(schunk->metalayers[i]->content);
  560|      0|        free(schunk->metalayers[i]);
  561|      0|      }
  562|      1|    }
  563|      1|    schunk->nmetalayers = 0;
  564|      1|  }
  565|       |
  566|  4.86k|  if (schunk->storage != NULL) {
  ------------------
  |  Branch (566:7): [True: 4.73k, False: 130]
  ------------------
  567|  4.73k|    blosc2_io_cb *io_cb = blosc2_get_io_cb(schunk->storage->io->id);
  568|  4.73k|    if (io_cb != NULL) {
  ------------------
  |  Branch (568:9): [True: 4.73k, False: 0]
  ------------------
  569|  4.73k|      int rc = io_cb->destroy(schunk->storage->io->params);
  570|  4.73k|      if (rc < 0) {
  ------------------
  |  Branch (570:11): [True: 0, False: 4.73k]
  ------------------
  571|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|      0|        err = 1;
  573|      0|      }
  574|  4.73k|    }
  575|       |
  576|  4.73k|    if (schunk->storage->urlpath != NULL) {
  ------------------
  |  Branch (576:9): [True: 0, False: 4.73k]
  ------------------
  577|      0|      free(schunk->storage->urlpath);
  578|      0|    }
  579|  4.73k|    free(schunk->storage->cparams);
  580|  4.73k|    free(schunk->storage->dparams);
  581|  4.73k|    free(schunk->storage->io);
  582|  4.73k|    free(schunk->storage);
  583|  4.73k|  }
  584|       |
  585|       |  // If it is a view, the frame belongs to original array and should not be freed
  586|  4.86k|  if (schunk->frame != NULL && !schunk->view) {
  ------------------
  |  Branch (586:7): [True: 4.86k, False: 0]
  |  Branch (586:32): [True: 4.86k, False: 0]
  ------------------
  587|  4.86k|    frame_free((blosc2_frame_s *) schunk->frame);
  588|  4.86k|  }
  589|       |
  590|  4.86k|  if (schunk->nvlmetalayers > 0) {
  ------------------
  |  Branch (590:7): [True: 130, False: 4.73k]
  ------------------
  591|    260|    for (int i = 0; i < schunk->nvlmetalayers; ++i) {
  ------------------
  |  Branch (591:21): [True: 130, False: 130]
  ------------------
  592|    130|      if (schunk->vlmetalayers[i] != NULL) {
  ------------------
  |  Branch (592:11): [True: 130, False: 0]
  ------------------
  593|    130|        if (schunk->vlmetalayers[i]->name != NULL)
  ------------------
  |  Branch (593:13): [True: 130, False: 0]
  ------------------
  594|    130|          free(schunk->vlmetalayers[i]->name);
  595|    130|        if (schunk->vlmetalayers[i]->content != NULL)
  ------------------
  |  Branch (595:13): [True: 124, False: 6]
  ------------------
  596|    124|          free(schunk->vlmetalayers[i]->content);
  597|    130|        free(schunk->vlmetalayers[i]);
  598|    130|      }
  599|    130|    }
  600|    130|  }
  601|       |
  602|  4.86k|  free(schunk);
  603|       |
  604|  4.86k|  return err;
  605|  4.86k|}
blosc2_schunk_from_buffer:
  609|  7.77k|blosc2_schunk* blosc2_schunk_from_buffer(uint8_t *cframe, int64_t len, bool copy) {
  610|       |  // Check that the buffer actually comes from a cframe
  611|  7.77k|  if (cframe == NULL || len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   48|  7.77k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   43|  7.77k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  7.77k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  7.77k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  7.77k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  7.77k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  7.77k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  7.77k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  7.77k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   35|  7.77k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  7.77k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  7.77k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  7.77k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   28|  7.77k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (611:7): [True: 0, False: 7.77k]
  |  Branch (611:25): [True: 15, False: 7.76k]
  ------------------
  612|     15|    return NULL;
  613|     15|  }
  614|  7.76k|  char *magic_number = (char *)cframe + FRAME_HEADER_MAGIC;
  ------------------
  |  |   28|  7.76k|#define FRAME_HEADER_MAGIC 2
  ------------------
  615|  7.76k|  if (memcmp(magic_number, "b2frame", sizeof("b2frame")) != 0) {
  ------------------
  |  Branch (615:7): [True: 244, False: 7.51k]
  ------------------
  616|    244|    return NULL;
  617|    244|  }
  618|  7.51k|  blosc2_frame_s* frame = frame_from_cframe(cframe, len, false);
  619|  7.51k|  if (frame == NULL) {
  ------------------
  |  Branch (619:7): [True: 2.65k, False: 4.86k]
  ------------------
  620|  2.65k|    return NULL;
  621|  2.65k|  }
  622|  4.86k|  blosc2_schunk* schunk = frame_to_schunk(frame, copy, &BLOSC2_IO_DEFAULTS);
  623|  4.86k|  if (schunk && copy) {
  ------------------
  |  Branch (623:7): [True: 126, False: 4.73k]
  |  Branch (623:17): [True: 0, False: 126]
  ------------------
  624|       |    // Super-chunk has its own copy of frame
  625|      0|    frame_free(frame);
  626|      0|  }
  627|  4.86k|  return schunk;
  628|  7.51k|}
blosc2_schunk_decompress_chunk:
 1232|    437|                                   void *dest, int32_t nbytes) {
 1233|    437|  int rc = validate_nchunk(schunk, nchunk, false, "blosc2_schunk_decompress_chunk");
 1234|    437|  if (rc < 0) {
  ------------------
  |  Branch (1234:7): [True: 0, False: 437]
  ------------------
 1235|      0|    return rc;
 1236|      0|  }
 1237|       |
 1238|    437|  int32_t chunk_nbytes;
 1239|    437|  int32_t chunk_cbytes;
 1240|    437|  int chunksize;
 1241|    437|  blosc2_frame_s* frame = (blosc2_frame_s*)schunk->frame;
 1242|       |
 1243|    437|  schunk->current_nchunk = nchunk;
 1244|    437|  if (frame == NULL) {
  ------------------
  |  Branch (1244:7): [True: 0, False: 437]
  ------------------
 1245|      0|    uint8_t* src = schunk->data[nchunk];
 1246|      0|    if (src == 0) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 0]
  ------------------
 1247|      0|      return 0;
 1248|      0|    }
 1249|       |
 1250|      0|    rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1251|      0|    if (rc < 0) {
  ------------------
  |  Branch (1251:9): [True: 0, False: 0]
  ------------------
 1252|      0|      return rc;
 1253|      0|    }
 1254|       |
 1255|      0|    if (nbytes < chunk_nbytes) {
  ------------------
  |  Branch (1255:9): [True: 0, False: 0]
  ------------------
 1256|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1257|      0|                        "('%d' bytes, but '%d' are needed).", nbytes, chunk_nbytes);
 1258|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1259|      0|    }
 1260|       |
 1261|      0|    chunksize = blosc2_decompress_ctx(schunk->dctx, src, chunk_cbytes, dest, nbytes);
 1262|      0|    if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (1262:9): [True: 0, False: 0]
  |  Branch (1262:26): [True: 0, False: 0]
  ------------------
 1263|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1264|      0|      if (chunksize < 0)
  ------------------
  |  Branch (1264:11): [True: 0, False: 0]
  ------------------
 1265|      0|        return chunksize;
 1266|      0|      return BLOSC2_ERROR_FAILURE;
 1267|      0|    }
 1268|    437|  } else {
 1269|    437|    chunksize = frame_decompress_chunk(schunk->dctx, frame, nchunk, dest, nbytes);
 1270|    437|    if (chunksize < 0) {
  ------------------
  |  Branch (1270:9): [True: 120, False: 317]
  ------------------
 1271|    120|      return chunksize;
 1272|    120|    }
 1273|    437|  }
 1274|    317|  return chunksize;
 1275|    437|}
schunk.c:validate_nchunk:
   40|    437|static int validate_nchunk(blosc2_schunk *schunk, int64_t nchunk, bool allow_end, const char *func_name) {
   41|    437|  if (nchunk < 0) {
  ------------------
  |  Branch (41:7): [True: 0, False: 437]
  ------------------
   42|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   43|      0|    return BLOSC2_ERROR_INVALID_PARAM;
   44|      0|  }
   45|       |
   46|    437|  if (allow_end) {
  ------------------
  |  Branch (46:7): [True: 0, False: 437]
  ------------------
   47|      0|    if (nchunk > schunk->nchunks) {
  ------------------
  |  Branch (47:9): [True: 0, False: 0]
  ------------------
   48|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|      0|                        nchunk, schunk->nchunks, func_name);
   50|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   51|      0|    }
   52|      0|  }
   53|    437|  else {
   54|    437|    if (nchunk >= schunk->nchunks) {
  ------------------
  |  Branch (54:9): [True: 0, False: 437]
  ------------------
   55|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   56|      0|                        "('%" PRId64 "') in %s.", nchunk, schunk->nchunks, func_name);
   57|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   58|      0|    }
   59|    437|  }
   60|       |
   61|    437|  return BLOSC2_ERROR_SUCCESS;
   62|    437|}

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

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

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

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

ndcell.c:blosc2_meta_get:
 2310|      1|                                  int32_t *content_len) {
 2311|      1|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2311:7): [True: 0, False: 1]
  |  Branch (2311:25): [True: 0, False: 1]
  |  Branch (2311:41): [True: 0, False: 1]
  |  Branch (2311:60): [True: 0, False: 1]
  ------------------
 2312|      0|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2313|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2314|      0|  }
 2315|       |
 2316|      1|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2317|      1|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2317:7): [True: 1, False: 0]
  ------------------
 2318|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|      1|    return nmetalayer;
 2320|      1|  }
 2321|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2322|      0|  if (len < 0) {
  ------------------
  |  Branch (2322:7): [True: 0, False: 0]
  ------------------
 2323|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2324|      0|    return BLOSC2_ERROR_DATA;
 2325|      0|  }
 2326|      0|  *content_len = len;
 2327|      0|  if (len == 0) {
  ------------------
  |  Branch (2327:7): [True: 0, False: 0]
  ------------------
 2328|      0|    *content = NULL;
 2329|      0|    return nmetalayer;
 2330|      0|  }
 2331|      0|  *content = (uint8_t*)malloc((size_t)len);
 2332|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2332:7): [True: 0, False: 0]
  ------------------
 2333|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2334|      0|    *content_len = 0;
 2335|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2336|      0|  }
 2337|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2337:7): [True: 0, False: 0]
  |  Branch (2337:18): [True: 0, False: 0]
  ------------------
 2338|      0|    free(*content);
 2339|      0|    *content = NULL;
 2340|      0|    *content_len = 0;
 2341|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2342|      0|    return BLOSC2_ERROR_DATA;
 2343|      0|  }
 2344|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2345|      0|  return nmetalayer;
 2346|      0|}
ndcell.c:blosc2_meta_exists:
 2246|      1|static inline int blosc2_meta_exists(blosc2_schunk *schunk, const char *name) {
 2247|      1|  if (strlen(name) > BLOSC2_METALAYER_NAME_MAXLEN) {
  ------------------
  |  | 1699|      1|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  ------------------
  |  Branch (2247:7): [True: 0, False: 1]
  ------------------
 2248|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2248|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1699|      0|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2249|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2250|      0|  }
 2251|       |
 2252|      1|  if (schunk == NULL) {
  ------------------
  |  Branch (2252:7): [True: 0, False: 1]
  ------------------
 2253|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2254|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2255|      0|  }
 2256|       |
 2257|      1|  for (int nmetalayer = 0; nmetalayer < schunk->nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2257:28): [True: 0, False: 1]
  ------------------
 2258|      0|    if (strcmp(name, schunk->metalayers[nmetalayer]->name) == 0) {
  ------------------
  |  Branch (2258:9): [True: 0, False: 0]
  ------------------
 2259|      0|      return nmetalayer;
 2260|      0|    }
 2261|      0|  }
 2262|      1|  return BLOSC2_ERROR_NOT_FOUND;
 2263|      1|}
ndmean.c:blosc2_meta_get:
 2310|      1|                                  int32_t *content_len) {
 2311|      1|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2311:7): [True: 1, False: 0]
  |  Branch (2311:25): [True: 0, False: 0]
  |  Branch (2311:41): [True: 0, False: 0]
  |  Branch (2311:60): [True: 0, False: 0]
  ------------------
 2312|      1|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2313|      1|    return BLOSC2_ERROR_INVALID_PARAM;
 2314|      1|  }
 2315|       |
 2316|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2317|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2317:7): [True: 0, False: 0]
  ------------------
 2318|      0|    BLOSC_TRACE_WARNING("Metalayer \"%s\" not found.", name);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|      0|    return nmetalayer;
 2320|      0|  }
 2321|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2322|      0|  if (len < 0) {
  ------------------
  |  Branch (2322:7): [True: 0, False: 0]
  ------------------
 2323|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2324|      0|    return BLOSC2_ERROR_DATA;
 2325|      0|  }
 2326|      0|  *content_len = len;
 2327|      0|  if (len == 0) {
  ------------------
  |  Branch (2327:7): [True: 0, False: 0]
  ------------------
 2328|      0|    *content = NULL;
 2329|      0|    return nmetalayer;
 2330|      0|  }
 2331|      0|  *content = (uint8_t*)malloc((size_t)len);
 2332|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2332:7): [True: 0, False: 0]
  ------------------
 2333|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2334|      0|    *content_len = 0;
 2335|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2336|      0|  }
 2337|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2337:7): [True: 0, False: 0]
  |  Branch (2337:18): [True: 0, False: 0]
  ------------------
 2338|      0|    free(*content);
 2339|      0|    *content = NULL;
 2340|      0|    *content_len = 0;
 2341|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2342|      0|    return BLOSC2_ERROR_DATA;
 2343|      0|  }
 2344|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2345|      0|  return nmetalayer;
 2346|      0|}
bytedelta.c:print_error:
  524|      4|static char *print_error(int rc) {
  525|       |  // TODO: remove this function, use blosc2_error_string only
  526|      4|  return (char *) blosc2_error_string(rc);
  527|      4|}

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

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

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

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

zfp_acc_decompress:
  143|      2|                       int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  144|      2|  ZFP_ERROR_NULL(input);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  145|      2|  ZFP_ERROR_NULL(output);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  146|      2|  ZFP_ERROR_NULL(dparams);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  147|      2|  ZFP_ERROR_NULL(dparams->schunk);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 2, False: 0]
  |  |  ------------------
  |  |   24|      2|      return 0;                 \
  |  |   25|      2|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  148|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  149|       |
  150|      0|  blosc2_schunk *sc = dparams->schunk;
  151|      0|  int32_t typesize = sc->typesize;
  152|       |
  153|      0|  double tol = (int8_t) meta;
  154|      0|  int8_t ndim;
  155|      0|  int64_t *shape = malloc(8 * sizeof(int64_t));
  156|      0|  int32_t *chunkshape = malloc(8 * sizeof(int32_t));
  157|      0|  int32_t *blockshape = malloc(8 * sizeof(int32_t));
  158|      0|  uint8_t *smeta;
  159|      0|  int32_t smeta_len;
  160|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (160:7): [True: 0, False: 0]
  ------------------
  161|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  162|      0|    free(shape);
  163|      0|    free(chunkshape);
  164|      0|    free(blockshape);
  165|      0|    return BLOSC2_ERROR_FAILURE;
  166|      0|  }
  167|      0|  b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  168|      0|  free(smeta);
  169|       |
  170|      0|  zfp_type type;     /* array scalar type */
  171|      0|  zfp_field *field;  /* array meta data */
  172|      0|  zfp_stream *zfp;   /* compressed stream */
  173|      0|  bitstream *stream; /* bit stream to write to or read from */
  174|      0|  size_t zfpsize;    /* byte size of compressed stream */
  175|      0|  double tolerance = pow(10, tol);
  176|       |
  177|      0|  switch (typesize) {
  178|      0|    case sizeof(float):
  ------------------
  |  Branch (178:5): [True: 0, False: 0]
  ------------------
  179|      0|      type = zfp_type_float;
  180|      0|      break;
  181|      0|    case sizeof(double):
  ------------------
  |  Branch (181:5): [True: 0, False: 0]
  ------------------
  182|      0|      type = zfp_type_double;
  183|      0|      break;
  184|      0|    default:
  ------------------
  |  Branch (184:5): [True: 0, False: 0]
  ------------------
  185|      0|      free(shape);
  186|      0|      free(chunkshape);
  187|      0|      free(blockshape);
  188|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|      0|      return BLOSC2_ERROR_FAILURE;
  190|      0|  }
  191|       |
  192|      0|  zfp = zfp_stream_open(NULL);
  193|      0|  zfp_stream_set_accuracy(zfp, tolerance);
  194|      0|  stream = stream_open((void *) input, input_len);
  195|      0|  zfp_stream_set_bit_stream(zfp, stream);
  196|      0|  zfp_stream_rewind(zfp);
  197|       |
  198|      0|  switch (ndim) {
  199|      0|    case 1:
  ------------------
  |  Branch (199:5): [True: 0, False: 0]
  ------------------
  200|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  201|      0|      break;
  202|      0|    case 2:
  ------------------
  |  Branch (202:5): [True: 0, False: 0]
  ------------------
  203|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  204|      0|      break;
  205|      0|    case 3:
  ------------------
  |  Branch (205:5): [True: 0, False: 0]
  ------------------
  206|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  207|      0|      break;
  208|      0|    case 4:
  ------------------
  |  Branch (208:5): [True: 0, False: 0]
  ------------------
  209|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  210|      0|      break;
  211|      0|    default:
  ------------------
  |  Branch (211:5): [True: 0, False: 0]
  ------------------
  212|      0|      free(shape);
  213|      0|      free(chunkshape);
  214|      0|      free(blockshape);
  215|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|      0|      return BLOSC2_ERROR_FAILURE;
  217|      0|  }
  218|       |
  219|      0|  zfpsize = zfp_decompress(zfp, field);
  220|       |
  221|       |  /* clean up */
  222|      0|  zfp_field_free(field);
  223|      0|  zfp_stream_close(zfp);
  224|      0|  stream_close(stream);
  225|      0|  free(shape);
  226|      0|  free(chunkshape);
  227|      0|  free(blockshape);
  228|       |
  229|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (229:7): [True: 0, False: 0]
  ------------------
  230|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|      0|    return (int) zfpsize;
  232|      0|  }
  233|       |
  234|      0|  return (int) output_len;
  235|      0|}
zfp_prec_decompress:
  384|      1|                        int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  385|      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]
  |  |  ------------------
  ------------------
  386|      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]
  |  |  ------------------
  ------------------
  387|      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]
  |  |  ------------------
  ------------------
  388|      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]
  |  |  ------------------
  ------------------
  389|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  390|       |
  391|      0|  blosc2_schunk *sc = dparams->schunk;
  392|      0|  int32_t typesize = sc->typesize;
  393|      0|  int8_t ndim;
  394|      0|  int64_t *shape = malloc(8 * sizeof(int64_t));
  395|      0|  int32_t *chunkshape = malloc(8 * sizeof(int32_t));
  396|      0|  int32_t *blockshape = malloc(8 * sizeof(int32_t));
  397|      0|  uint8_t *smeta;
  398|      0|  int32_t smeta_len;
  399|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (399:7): [True: 0, False: 0]
  ------------------
  400|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|      0|    free(shape);
  402|      0|    free(chunkshape);
  403|      0|    free(blockshape);
  404|      0|    return BLOSC2_ERROR_FAILURE;
  405|      0|  }
  406|      0|  b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  407|      0|  free(smeta);
  408|       |
  409|      0|  zfp_type type;     /* array scalar type */
  410|      0|  zfp_field *field;  /* array meta data */
  411|      0|  zfp_stream *zfp;   /* compressed stream */
  412|      0|  bitstream *stream; /* bit stream to write to or read from */
  413|      0|  size_t zfpsize;    /* byte size of compressed stream */
  414|       |
  415|      0|  uint prec;
  416|      0|  switch (ndim) {
  417|      0|    case 1:
  ------------------
  |  Branch (417:5): [True: 0, False: 0]
  ------------------
  418|      0|      prec = meta + 5;
  419|      0|      break;
  420|      0|    case 2:
  ------------------
  |  Branch (420:5): [True: 0, False: 0]
  ------------------
  421|      0|      prec = meta + 7;
  422|      0|      break;
  423|      0|    case 3:
  ------------------
  |  Branch (423:5): [True: 0, False: 0]
  ------------------
  424|      0|      prec = meta + 9;
  425|      0|      break;
  426|      0|    case 4:
  ------------------
  |  Branch (426:5): [True: 0, False: 0]
  ------------------
  427|      0|      prec = meta + 11;
  428|      0|      break;
  429|      0|    default:
  ------------------
  |  Branch (429:5): [True: 0, False: 0]
  ------------------
  430|      0|      free(shape);
  431|      0|      free(chunkshape);
  432|      0|      free(blockshape);
  433|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|      0|      return BLOSC2_ERROR_FAILURE;
  435|      0|  }
  436|       |
  437|      0|  if (prec > ZFP_MAX_PREC) {
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  |  Branch (437:7): [True: 0, False: 0]
  ------------------
  438|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  438|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  439|      0|    prec = ZFP_MAX_PREC;
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  440|      0|  }
  441|       |
  442|      0|  switch (typesize) {
  443|      0|    case sizeof(float):
  ------------------
  |  Branch (443:5): [True: 0, False: 0]
  ------------------
  444|      0|      type = zfp_type_float;
  445|      0|      break;
  446|      0|    case sizeof(double):
  ------------------
  |  Branch (446:5): [True: 0, False: 0]
  ------------------
  447|      0|      type = zfp_type_double;
  448|      0|      break;
  449|      0|    default:
  ------------------
  |  Branch (449:5): [True: 0, False: 0]
  ------------------
  450|      0|      free(shape);
  451|      0|      free(chunkshape);
  452|      0|      free(blockshape);
  453|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  454|      0|      return BLOSC2_ERROR_FAILURE;
  455|      0|  }
  456|       |
  457|      0|  zfp = zfp_stream_open(NULL);
  458|      0|  zfp_stream_set_precision(zfp, prec);
  459|      0|  stream = stream_open((void *) input, input_len);
  460|      0|  zfp_stream_set_bit_stream(zfp, stream);
  461|      0|  zfp_stream_rewind(zfp);
  462|       |
  463|      0|  switch (ndim) {
  464|      0|    case 1:
  ------------------
  |  Branch (464:5): [True: 0, False: 0]
  ------------------
  465|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  466|      0|      break;
  467|      0|    case 2:
  ------------------
  |  Branch (467:5): [True: 0, False: 0]
  ------------------
  468|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  469|      0|      break;
  470|      0|    case 3:
  ------------------
  |  Branch (470:5): [True: 0, False: 0]
  ------------------
  471|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  472|      0|      break;
  473|      0|    case 4:
  ------------------
  |  Branch (473:5): [True: 0, False: 0]
  ------------------
  474|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  475|      0|      break;
  476|      0|    default:
  ------------------
  |  Branch (476:5): [True: 0, False: 0]
  ------------------
  477|      0|      free(shape);
  478|      0|      free(chunkshape);
  479|      0|      free(blockshape);
  480|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|      0|      return BLOSC2_ERROR_FAILURE;
  482|      0|  }
  483|       |
  484|      0|  zfpsize = zfp_decompress(zfp, field);
  485|       |
  486|       |  /* clean up */
  487|      0|  zfp_field_free(field);
  488|      0|  zfp_stream_close(zfp);
  489|      0|  stream_close(stream);
  490|      0|  free(shape);
  491|      0|  free(chunkshape);
  492|      0|  free(blockshape);
  493|       |
  494|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (494:7): [True: 0, False: 0]
  ------------------
  495|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  496|      0|    return (int) zfpsize;
  497|      0|  }
  498|       |
  499|      0|  return (int) output_len;
  500|      0|}

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

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

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

ndcell_backward:
  153|      1|                   uint8_t id) {
  154|      1|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      1|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  155|      1|  blosc2_schunk *schunk = dparams->schunk;
  156|      1|  int8_t ndim;
  157|      1|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  158|      1|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  159|      1|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      1|#define B2ND_MAX_DIM 16
  ------------------
  160|      1|  uint8_t *smeta;
  161|      1|  int32_t smeta_len;
  162|      1|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (162:7): [True: 1, False: 0]
  ------------------
  163|      1|    free(shape);
  164|      1|    free(chunkshape);
  165|      1|    free(blockshape);
  166|      1|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|      1|    return BLOSC2_ERROR_FAILURE;
  168|      1|  }
  169|      0|  if (b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL) < 0) {
  ------------------
  |  Branch (169:7): [True: 0, False: 0]
  ------------------
  170|      0|    free(smeta);
  171|      0|    free(shape);
  172|      0|    free(chunkshape);
  173|      0|    free(blockshape);
  174|      0|    return BLOSC2_ERROR_FAILURE;
  175|      0|  }
  176|      0|  free(smeta);
  177|      0|  if (ndim <= 0 || ndim > NDCELL_MAX_DIM) {
  ------------------
  |  |   16|      0|#define NDCELL_MAX_DIM 8
  ------------------
  |  Branch (177:7): [True: 0, False: 0]
  |  Branch (177:20): [True: 0, False: 0]
  ------------------
  178|      0|    free(shape);
  179|      0|    free(chunkshape);
  180|      0|    free(blockshape);
  181|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|      0|    return BLOSC2_ERROR_FAILURE;
  183|      0|  }
  184|       |
  185|      0|  int8_t cell_shape = (int8_t) meta;
  186|      0|  int cell_size = (int) pow(cell_shape, ndim);
  187|      0|  int32_t typesize = schunk->typesize;
  188|      0|  uint8_t *ip = (uint8_t *) input;
  189|      0|  uint8_t *ip_limit = ip + length;
  190|      0|  uint8_t *op = (uint8_t *) output;
  191|      0|  int32_t blocksize = (int32_t) typesize;
  192|      0|  for (int i = 0; i < ndim; i++) {
  ------------------
  |  Branch (192:19): [True: 0, False: 0]
  ------------------
  193|      0|    blocksize *= blockshape[i];
  194|      0|  }
  195|       |
  196|      0|  if (length != blocksize) {
  ------------------
  |  Branch (196:7): [True: 0, False: 0]
  ------------------
  197|      0|    free(shape);
  198|      0|    free(chunkshape);
  199|      0|    free(blockshape);
  200|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|      0|    return BLOSC2_ERROR_FAILURE;
  202|      0|  }
  203|       |
  204|      0|  if (length < cell_size * typesize) {
  ------------------
  |  Branch (204:7): [True: 0, False: 0]
  ------------------
  205|      0|    free(shape);
  206|      0|    free(chunkshape);
  207|      0|    free(blockshape);
  208|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|      0|    return BLOSC2_ERROR_FAILURE;
  210|      0|  }
  211|       |
  212|      0|  int64_t i_shape[NDCELL_MAX_DIM];
  213|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (213:19): [True: 0, False: 0]
  ------------------
  214|      0|    i_shape[i] = (blockshape[i] + cell_shape - 1) / cell_shape;
  215|      0|  }
  216|       |
  217|      0|  int64_t ncells = 1;
  218|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (218:19): [True: 0, False: 0]
  ------------------
  219|      0|    ncells *= i_shape[i];
  220|      0|  }
  221|       |
  222|       |  /* main loop */
  223|      0|  int64_t pad_shape[NDCELL_MAX_DIM] = {0};
  224|      0|  int64_t ii[NDCELL_MAX_DIM];
  225|      0|  int32_t ind = 0;
  226|      0|  for (int cell_ind = 0; cell_ind < ncells; cell_ind++) {      // for each cell
  ------------------
  |  Branch (226:26): [True: 0, False: 0]
  ------------------
  227|       |
  228|      0|    if (ip > ip_limit) {
  ------------------
  |  Branch (228:9): [True: 0, False: 0]
  ------------------
  229|      0|      free(shape);
  230|      0|      free(chunkshape);
  231|      0|      free(blockshape);
  232|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|      0|      return BLOSC2_ERROR_FAILURE;
  234|      0|    }
  235|      0|    blosc2_unidim_to_multidim(ndim, i_shape, cell_ind, ii);
  236|      0|    uint32_t orig = 0;
  237|      0|    int64_t nd_aux = (int64_t) cell_shape;
  238|      0|    for (int i = ndim - 1; i >= 0; i--) {
  ------------------
  |  Branch (238:28): [True: 0, False: 0]
  ------------------
  239|      0|      orig += ii[i] * nd_aux;
  240|      0|      nd_aux *= blockshape[i];
  241|      0|    }
  242|       |
  243|      0|    for (int dim_ind = 0; dim_ind < ndim; dim_ind++) {
  ------------------
  |  Branch (243:27): [True: 0, False: 0]
  ------------------
  244|      0|      if ((blockshape[dim_ind] % cell_shape != 0) && (ii[dim_ind] == i_shape[dim_ind] - 1)) {
  ------------------
  |  Branch (244:11): [True: 0, False: 0]
  |  Branch (244:54): [True: 0, False: 0]
  ------------------
  245|      0|        pad_shape[dim_ind] = blockshape[dim_ind] % cell_shape;
  246|      0|      } else {
  247|      0|        pad_shape[dim_ind] = (int64_t) cell_shape;
  248|      0|      }
  249|      0|    }
  250|       |
  251|      0|    int64_t ncopies = 1;
  252|      0|    for (int i = 0; i < ndim - 1; ++i) {
  ------------------
  |  Branch (252:21): [True: 0, False: 0]
  ------------------
  253|      0|      ncopies *= pad_shape[i];
  254|      0|    }
  255|      0|    int64_t kk[NDCELL_MAX_DIM];
  256|      0|    for (int copy_ind = 0; copy_ind < ncopies; ++copy_ind) {
  ------------------
  |  Branch (256:28): [True: 0, False: 0]
  ------------------
  257|      0|      blosc2_unidim_to_multidim(ndim - 1, pad_shape, copy_ind, kk);
  258|      0|      nd_aux = blockshape[ndim - 1];
  259|      0|      ind = (int32_t) orig;
  260|      0|      for (int i = ndim - 2; i >= 0; i--) {
  ------------------
  |  Branch (260:30): [True: 0, False: 0]
  ------------------
  261|      0|        ind += (int32_t) (kk[i] * nd_aux);
  262|      0|        nd_aux *= blockshape[i];
  263|      0|      }
  264|      0|      memcpy(&op[ind * typesize], ip, pad_shape[ndim - 1] * typesize);
  265|      0|      ip += pad_shape[ndim - 1] * typesize;
  266|      0|    }
  267|      0|  }
  268|      0|  ind += (int32_t) pad_shape[ndim - 1];
  269|       |
  270|       |
  271|      0|  if (ind != (int32_t) (blocksize / typesize)) {
  ------------------
  |  Branch (271:7): [True: 0, False: 0]
  ------------------
  272|      0|    free(shape);
  273|      0|    free(chunkshape);
  274|      0|    free(blockshape);
  275|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape ind %d %d \n",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|      0|                      ind, (blocksize / typesize));
  277|      0|    return BLOSC2_ERROR_FAILURE;
  278|      0|  }
  279|       |
  280|      0|  free(shape);
  281|      0|  free(chunkshape);
  282|      0|  free(blockshape);
  283|       |
  284|      0|  return BLOSC2_ERROR_SUCCESS;
  285|      0|}

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

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

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

