LZ4_compressBound:
  792|  8.84k|int LZ4_compressBound(int isize)  { return LZ4_COMPRESSBOUND(isize); }
  ------------------
  |  |  261|  8.84k|#define LZ4_COMPRESSBOUND(isize)  ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
  |  |  ------------------
  |  |  |  |  260|  8.84k|#define LZ4_MAX_INPUT_SIZE        0x7E000000   /* 2 113 929 216 bytes */
  |  |  ------------------
  |  |  |  Branch (261:36): [True: 0, False: 8.84k]
  |  |  ------------------
  ------------------
LZ4_decompress_safe:
 2647|  13.5k|{
 2648|  13.5k|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2649|  13.5k|                                  decode_full_block, noDict,
 2650|  13.5k|                                  (BYTE*)dest, NULL, 0,
 2651|       |                                  complete_input, NULL);
 2652|  13.5k|}
lz4.c:LZ4_isLittleEndian:
  363|  3.73M|{
  364|  3.73M|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  365|  3.73M|    return one.c[0];
  366|  3.73M|}
lz4.c:LZ4_wildCopy8:
  465|  48.2k|{
  466|  48.2k|    BYTE* d = (BYTE*)dstPtr;
  467|  48.2k|    const BYTE* s = (const BYTE*)srcPtr;
  468|  48.2k|    BYTE* const e = (BYTE*)dstEnd;
  469|       |
  470|  4.08M|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  348|  4.08M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (470:50): [True: 4.03M, False: 48.2k]
  ------------------
  471|  48.2k|}
lz4.c:LZ4_read16:
  392|  3.73M|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  397|  56.5k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2277|  13.5k|{
 2278|  13.5k|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2278:9): [True: 0, False: 13.5k]
  |  Branch (2278:26): [True: 0, False: 13.5k]
  ------------------
 2279|       |
 2280|  13.5k|    {   const BYTE* ip = (const BYTE*) src;
 2281|  13.5k|        const BYTE* const iend = ip + srcSize;
 2282|       |
 2283|  13.5k|        BYTE* op = (BYTE*) dst;
 2284|  13.5k|        BYTE* const oend = op + outputSize;
 2285|       |
 2286|  13.5k|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2286:37): [True: 13.5k, False: 0]
  ------------------
 2287|       |
 2288|       |        /* withPrefix64k : offset <= 65535 can't reach beyond the 64 KB prefix */
 2289|  13.5k|        const int checkOffset = (dict != withPrefix64k) && (dictSize < (int)(64 KB));
  ------------------
  |  |  250|  13.5k|#define KB *(1 <<10)
  ------------------
  |  Branch (2289:33): [True: 13.5k, False: 0]
  |  Branch (2289:60): [True: 13.5k, False: 0]
  ------------------
 2290|       |
 2291|       |
 2292|       |        /* Set up the "end" pointers for the shortcut. */
 2293|  13.5k|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2294|  13.5k|        const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/;
 2295|       |
 2296|       |        /* shared by both loops : the fast loop can hand over a decoded match (safe_match_copy) */
 2297|  13.5k|        const BYTE* match;
 2298|  13.5k|        size_t offset;
 2299|  13.5k|        size_t ml;   /* match length */
 2300|       |
 2301|       |        /* incompleteInput : start of the current sequence, where decoding stops if it can't be completed */
 2302|  13.5k|        const BYTE* seqIp = NULL;
 2303|  13.5k|        BYTE* seqOp = NULL;
 2304|       |
 2305|  13.5k|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  288|  13.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2306|       |
 2307|       |        /* Special cases */
 2308|  13.5k|        assert(lowPrefix <= op);
  ------------------
  |  Branch (2308:9): [True: 0, False: 13.5k]
  |  Branch (2308:9): [True: 13.5k, False: 0]
  ------------------
 2309|  13.5k|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|  13.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  13.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 13.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2310|       |            /* Empty output buffer */
 2311|      0|            if (partialDecoding) return 0;
  ------------------
  |  Branch (2311:17): [True: 0, False: 0]
  ------------------
 2312|      0|            if ((srcSize==1) && (*ip==0)) return 0;   /* empty block */
  ------------------
  |  Branch (2312:17): [True: 0, False: 0]
  |  Branch (2312:33): [True: 0, False: 0]
  ------------------
 2313|      0|            return (srcSize > 1) ? -2 : -1;   /* -2 : output buffer too small */
  ------------------
  |  Branch (2313:20): [True: 0, False: 0]
  ------------------
 2314|      0|        }
 2315|  13.5k|        if (unlikely(srcSize<=0)) { return -1; }
  ------------------
  |  |  180|  13.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  13.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 13.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2316|       |
 2317|       |    /* LZ4_FAST_DEC_LOOP:
 2318|       |     * designed for modern OoO performance cpus,
 2319|       |     * where copying reliably 32-bytes is preferable to an unpredictable branch.
 2320|       |     * note : fast loop may show a regression for some client arm chips. */
 2321|  13.5k|#if LZ4_FAST_DEC_LOOP
 2322|  13.5k|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  247|  13.5k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2322:13): [True: 6.64k, False: 6.90k]
  ------------------
 2323|  6.64k|            DEBUGLOG(6, "move to safe decode loop");
  ------------------
  |  |  288|  6.64k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2324|  6.64k|            goto safe_decode;
 2325|  6.64k|        }
 2326|       |        /* Ring buffer restarting at its beginning : the oldest referenced history (max distance behind op)
 2327|       |         * lies in the external dictionary, ahead of op, always at the same distance.
 2328|       |         * Rings sized with the former LZ4_DECODER_RING_BUFFER_SIZE() (margin 14, up to v1.10.0)
 2329|       |         * still work, but leave as little as 16 bytes :
 2330|       |         * the fast loop's wide copies could overwrite it, the safe loop's can't. */
 2331|  6.90k|        if ( (dict==usingExtDict)
  ------------------
  |  Branch (2331:14): [True: 0, False: 6.90k]
  ------------------
 2332|      0|          && ((uptrval)dictEnd - (uptrval)lowPrefix - LZ4_DISTANCE_ABSOLUTE_MAX < FASTLOOP_SAFE_DISTANCE) ) {
  ------------------
  |  |  254|      0|#define LZ4_DISTANCE_ABSOLUTE_MAX 65535
  ------------------
                        && ((uptrval)dictEnd - (uptrval)lowPrefix - LZ4_DISTANCE_ABSOLUTE_MAX < FASTLOOP_SAFE_DISTANCE) ) {
  ------------------
  |  |  247|      0|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2332:14): [True: 0, False: 0]
  ------------------
 2333|      0|            DEBUGLOG(6, "history just ahead : move to safe decode loop");
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2334|      0|            goto safe_decode;
 2335|      0|        }
 2336|       |
 2337|       |        /* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE,
 2338|       |         * and input is not too close to iend.
 2339|       |         * It hands over to the safe loop either at a sequence start (break),
 2340|       |         * or once a match is fully decoded (goto safe_match_copy). */
 2341|  6.90k|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  288|  6.90k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2342|  3.71M|        while (1) {
  ------------------
  |  Branch (2342:16): [True: 3.71M, Folded]
  ------------------
 2343|  3.71M|            unsigned token;
 2344|  3.71M|            size_t ll;   /* literal length */
 2345|  3.71M|            BYTE* cpy;
 2346|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2347|  3.71M|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  Branch (2347:13): [True: 0, False: 3.71M]
  |  Branch (2347:13): [True: 3.71M, False: 0]
  ------------------
 2348|  3.71M|            assert(ip < iend);
  ------------------
  |  Branch (2348:13): [True: 0, False: 3.71M]
  |  Branch (2348:13): [True: 3.71M, False: 0]
  ------------------
 2349|  3.71M|            seqIp = ip; seqOp = op;
 2350|  3.71M|            token = *ip++;
 2351|  3.71M|            ll = token >> ML_BITS;
  ------------------
  |  |  259|  3.71M|#define ML_BITS  4
  ------------------
 2352|  3.71M|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ll);
  ------------------
  |  |  288|  3.71M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2353|       |
 2354|       |            /* too close to input end : the safe loop restarts this sequence */
 2355|  3.71M|            if (ip > iend-(16 + 1/*max lit + offset + nextToken*/)) { ip--; break; }
  ------------------
  |  Branch (2355:17): [True: 1.38k, False: 3.71M]
  ------------------
 2356|       |
 2357|       |            /* decode literal length */
 2358|  3.71M|            if (ll == RUN_MASK) {
  ------------------
  |  |  262|  3.71M|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  3.71M|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  3.71M|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2358:17): [True: 263k, False: 3.45M]
  ------------------
 2359|       |                /* literal length >= RUN_MASK means >= RUN_MASK literal bytes follow the extension bytes,
 2360|       |                 * so extension bytes cannot reach the last RUN_MASK bytes of input */
 2361|   263k|                const BYTE* const tokenPos = ip-1;
 2362|   263k|                size_t const addl = read_variable_length(&ip, iend - RUN_MASK);
  ------------------
  |  |  262|   263k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|   263k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|   263k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2363|   263k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2363:21): [True: 0, False: 263k]
  ------------------
 2364|      0|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2365|      0|                    goto _output_error;
 2366|      0|                }
 2367|   263k|                ll += addl;
 2368|   263k|                if (unlikely((uptrval)(op)+ll<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|   263k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   263k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2369|   263k|                if (unlikely((uptrval)(ip)+ll<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|   263k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   263k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2370|       |
 2371|       |                /* copy literals, unless too close to the end for a wild copy :
 2372|       |                 * nothing is written yet, so the safe loop can restart this sequence */
 2373|   263k|                cpy = op+ll;
 2374|   263k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  276|   263k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2375|   263k|              #if LZ4_WILDCOPY64
 2376|   263k|                if ((cpy>oend-64) || (ip+ll>iend-64)) { ip = tokenPos; break; }
  ------------------
  |  Branch (2376:21): [True: 619, False: 262k]
  |  Branch (2376:38): [True: 840, False: 261k]
  ------------------
 2377|   261k|                LZ4_wildCopy64(op, ip, cpy);
 2378|       |              #else
 2379|       |                if ((cpy>oend-32) || (ip+ll>iend-32)) { ip = tokenPos; break; }
 2380|       |                LZ4_wildCopy32(op, ip, cpy);
 2381|       |              #endif
 2382|   261k|                ip += ll; op = cpy;
 2383|  3.45M|            } else {
 2384|  3.45M|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)ll);
  ------------------
  |  |  288|  3.45M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2385|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2386|  3.45M|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  348|  3.45M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2387|  3.45M|                ip += ll; op += ll;
 2388|  3.45M|            }
 2389|       |
 2390|       |            /* get offset */
 2391|  3.71M|            offset = LZ4_readLE16(ip); ip+=2;
 2392|  3.71M|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  288|  3.71M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2393|  3.71M|            match = op - offset;
 2394|  3.71M|            assert(match <= op);  /* overflow check */
  ------------------
  |  Branch (2394:13): [True: 0, False: 3.71M]
  |  Branch (2394:13): [True: 3.71M, False: 0]
  ------------------
 2395|       |
 2396|       |            /* get matchlength */
 2397|  3.71M|            ml = token & ML_MASK;
  ------------------
  |  |  260|  3.71M|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  3.71M|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2398|  3.71M|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)ml, (unsigned)ml+MINMATCH);
  ------------------
  |  |  288|  3.71M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2399|       |
 2400|  3.71M|            if (ml == ML_MASK) {
  ------------------
  |  |  260|  3.71M|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  3.71M|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2400:17): [True: 798k, False: 2.91M]
  ------------------
 2401|       |                /* after match length extension bytes, at least 1 token + LASTLITERALS literals must remain */
 2402|   798k|                size_t const addl = read_variable_length(&ip, iend - (1 + LASTLITERALS));
  ------------------
  |  |  244|   798k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2403|   798k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2403:21): [True: 0, False: 798k]
  ------------------
 2404|      0|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2405|      0|                    goto _output_error;
 2406|      0|                }
 2407|   798k|                ml += addl;
 2408|   798k|                DEBUGLOG(7, "  long match length == %u", (unsigned)ml + MINMATCH);
  ------------------
  |  |  288|   798k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2409|   798k|                if (unlikely((uptrval)(op)+ml+MINMATCH<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|   798k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   798k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 798k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2410|   798k|            }
 2411|  3.71M|            ml += MINMATCH;
  ------------------
  |  |  241|  3.71M|#define MINMATCH 4
  ------------------
 2412|       |
 2413|  3.71M|            if (op + ml >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  247|  3.71M|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2413:17): [True: 4.05k, False: 3.70M]
  ------------------
 2414|  4.05k|                DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)ml);
  ------------------
  |  |  288|  4.05k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2415|  4.05k|                goto safe_match_copy;
 2416|  4.05k|            }
 2417|       |
 2418|       |            /* match length from token only (<= 18), no overlap, within prefix : copy 18 bytes */
 2419|  3.70M|            if ( ((token & ML_MASK) != ML_MASK) && (offset >= 8)
  ------------------
  |  |  260|  3.70M|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  3.70M|#define ML_BITS  4
  |  |  ------------------
  ------------------
                          if ( ((token & ML_MASK) != ML_MASK) && (offset >= 8)
  ------------------
  |  |  260|  3.70M|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  3.70M|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2419:18): [True: 2.91M, False: 795k]
  |  Branch (2419:52): [True: 2.76M, False: 148k]
  ------------------
 2420|  2.76M|              && ((dict == withPrefix64k) || (match >= lowPrefix)) ) {
  ------------------
  |  Branch (2420:19): [True: 0, False: 2.76M]
  |  Branch (2420:46): [True: 2.76M, False: 0]
  ------------------
 2421|  2.76M|                assert(match >= lowPrefix);
  ------------------
  |  Branch (2421:17): [True: 0, False: 2.76M]
  |  Branch (2421:17): [True: 2.76M, False: 0]
  ------------------
 2422|  2.76M|                assert(match <= op);
  ------------------
  |  Branch (2422:17): [True: 0, False: 2.76M]
  |  Branch (2422:17): [True: 2.76M, False: 0]
  ------------------
 2423|  2.76M|                assert(op + 18 <= oend);
  ------------------
  |  Branch (2423:17): [True: 0, False: 2.76M]
  |  Branch (2423:17): [True: 2.76M, False: 0]
  ------------------
 2424|  2.76M|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  348|  2.76M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2425|  2.76M|                LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  348|  2.76M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2426|  2.76M|                LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  348|  2.76M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2427|  2.76M|                op += ml;
 2428|  2.76M|                continue;
 2429|  2.76M|            }
 2430|       |
 2431|       |            /* match ends far from oend : no end-of-block condition to check */
 2432|  3.70M|            assert(op + ml < oend - FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  Branch (2432:13): [True: 0, False: 944k]
  |  Branch (2432:13): [True: 944k, False: 0]
  ------------------
 2433|       |
 2434|   944k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|   944k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   944k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2434:18): [True: 944k, False: 0]
  |  Branch (2434:33): [True: 0, False: 944k]
  ------------------
 2435|      0|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2436|      0|                goto _offset_error;
 2437|      0|            }
 2438|       |            /* match starting within external dictionary */
 2439|   944k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2439:17): [True: 0, False: 944k]
  |  Branch (2439:41): [True: 0, False: 0]
  ------------------
 2440|      0|                size_t const inDict = (size_t)(lowPrefix - match);
 2441|      0|                assert(dictEnd != NULL);
  ------------------
  |  Branch (2441:17): [True: 0, False: 0]
  |  Branch (2441:17): [True: 0, False: 0]
  ------------------
 2442|      0|                if (ml + 16 <= inDict) {
  ------------------
  |  Branch (2442:21): [True: 0, False: 0]
  ------------------
 2443|       |                    /* match within dictionary, followed by 16 more bytes of dictionary : wild copy */
 2444|      0|                    LZ4_wildCopy16(op, dictEnd - inDict, op + ml);
 2445|      0|                    op += ml;
 2446|      0|                    continue;
 2447|      0|                }
 2448|      0|                op = LZ4_copyExtDictMatch(op, match, ml, lowPrefix, dictEnd);
 2449|      0|                continue;
 2450|      0|            }
 2451|       |
 2452|       |            /* copy match within block */
 2453|   944k|            cpy = op + ml;
 2454|       |
 2455|   944k|            assert((op <= oend) && (oend-op >= 64));
  ------------------
  |  Branch (2455:13): [True: 0, False: 944k]
  |  Branch (2455:13): [True: 0, False: 0]
  |  Branch (2455:13): [True: 944k, False: 0]
  |  Branch (2455:13): [True: 944k, False: 0]
  ------------------
 2456|   944k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|   944k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   944k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 230k, False: 713k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2457|   230k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2458|   230k|    #if LZ4_WILDCOPY64
 2459|   713k|            } else if (offset >= 64) {
  ------------------
  |  Branch (2459:24): [True: 627k, False: 86.1k]
  ------------------
 2460|   627k|                LZ4_wildCopy64(op, match, cpy);
 2461|   627k|    #endif
 2462|   627k|            } else {
 2463|  86.1k|                LZ4_wildCopy32(op, match, cpy);
 2464|  86.1k|            }
 2465|       |
 2466|   944k|            op = cpy;   /* wildcopy correction */
 2467|   944k|        }
 2468|  9.48k|    safe_decode:
 2469|  9.48k|#endif
 2470|       |
 2471|       |        /* Safe loop : decode remaining sequences, without writing beyond oend nor reading beyond iend.
 2472|       |         * With LZ4_FAST_DEC_LOOP, that's the end of the block (or a block too small for the fast loop),
 2473|       |         * entered at a sequence start, or at safe_match_copy with a decoded match.
 2474|       |         * Without it, that's the whole block. */
 2475|  9.48k|        DEBUGLOG(6, "using safe decode loop");
  ------------------
  |  |  288|  9.48k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2476|  39.5k|        while (1) {
  ------------------
  |  Branch (2476:16): [True: 39.5k, Folded]
  ------------------
 2477|  39.5k|            unsigned token;
 2478|  39.5k|            size_t ll;   /* literal length */
 2479|  39.5k|            BYTE* cpy;
 2480|  39.5k|            assert(ip < iend);
  ------------------
  |  Branch (2480:13): [True: 0, False: 39.5k]
  |  Branch (2480:13): [True: 39.5k, False: 0]
  ------------------
 2481|  39.5k|            seqIp = ip; seqOp = op;
 2482|  39.5k|            token = *ip++;
 2483|  39.5k|            ll = token >> ML_BITS;
  ------------------
  |  |  259|  39.5k|#define ML_BITS  4
  ------------------
 2484|  39.5k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ll);
  ------------------
  |  |  288|  39.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2485|       |
 2486|       |            /* A two-stage shortcut for the most common case:
 2487|       |             * 1) If the literal length is 0..14, and there is enough space,
 2488|       |             * enter the shortcut and copy 16 bytes on behalf of the literals.
 2489|       |             * 2) Further if the match length is 4..18, copy 18 bytes in a similar
 2490|       |             * manner; but we ensure that there's enough space in the output for
 2491|       |             * those 18 bytes earlier, upon entering the shortcut (in other words,
 2492|       |             * there is a combined check for both stages).
 2493|       |             */
 2494|  39.5k|            if ( (ll != RUN_MASK)
  ------------------
  |  |  262|  39.5k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  39.5k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  39.5k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2494:18): [True: 37.2k, False: 2.37k]
  ------------------
 2495|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2496|  37.2k|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|  37.2k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  37.2k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 9.10k, False: 28.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|       |                /* Copy the literals */
 2498|  9.10k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  348|  9.10k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2499|  9.10k|                op += ll; ip += ll;
 2500|       |
 2501|       |                /* The second stage: prepare for match copying, decode full info.
 2502|       |                 * If it doesn't work out, the info won't be wasted. */
 2503|  9.10k|                offset = LZ4_readLE16(ip); ip += 2;
 2504|  9.10k|                match = op - offset;
 2505|  9.10k|                assert(match <= op); /* check overflow */
  ------------------
  |  Branch (2505:17): [True: 0, False: 9.10k]
  |  Branch (2505:17): [True: 9.10k, False: 0]
  ------------------
 2506|  9.10k|                ml = token & ML_MASK;
  ------------------
  |  |  260|  9.10k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  9.10k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2507|  9.10k|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)ml, (unsigned)ml + 4);
  ------------------
  |  |  288|  9.10k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2508|       |
 2509|       |                /* Do not deal with overlapping matches. */
 2510|  9.10k|                if ( (ml != ML_MASK)
  ------------------
  |  |  260|  9.10k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  9.10k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2510:22): [True: 7.96k, False: 1.14k]
  ------------------
 2511|  7.96k|                  && (offset >= 8)
  ------------------
  |  Branch (2511:22): [True: 4.91k, False: 3.05k]
  ------------------
 2512|  4.91k|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2512:23): [True: 0, False: 4.91k]
  |  Branch (2512:46): [True: 4.91k, False: 0]
  ------------------
 2513|       |                    /* Copy the match. */
 2514|  4.91k|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  348|  4.91k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2515|  4.91k|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  348|  4.91k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2516|  4.91k|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  348|  4.91k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2517|  4.91k|                    op += ml + MINMATCH;
  ------------------
  |  |  241|  4.91k|#define MINMATCH 4
  ------------------
 2518|       |                    /* Both stages worked, load the next token. */
 2519|  4.91k|                    continue;
 2520|  4.91k|                }
 2521|       |                /* The second stage didn't work out, but the info is ready for the match copy below. */
 2522|  30.4k|            } else {
 2523|       |                /* decode literal length */
 2524|  30.4k|                if (ll == RUN_MASK) {
  ------------------
  |  |  262|  30.4k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  30.4k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  30.4k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2524:21): [True: 2.37k, False: 28.1k]
  ------------------
 2525|       |                    /* literal length >= RUN_MASK means >= RUN_MASK literal bytes follow the extension bytes,
 2526|       |                     * so extension bytes cannot reach the last RUN_MASK bytes of input */
 2527|  2.37k|                    size_t const addl = read_variable_length(&ip, iend-RUN_MASK);
  ------------------
  |  |  262|  2.37k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  2.37k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  2.37k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2528|  2.37k|                    if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2528:25): [True: 0, False: 2.37k]
  ------------------
 2529|  2.37k|                    ll += addl;
 2530|  2.37k|                    if (unlikely((uptrval)(op)+ll<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  2.37k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.37k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 2.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2531|  2.37k|                    if (unlikely((uptrval)(ip)+ll<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  2.37k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.37k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 2.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2532|  2.37k|                }
 2533|       |
 2534|       |                /* copy literals */
 2535|  30.4k|                cpy = op+ll;
 2536|  30.4k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  276|  30.4k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2537|  30.4k|                if ((cpy>oend-MFLIMIT) || (ip+ll>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|  30.4k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                              if ((cpy>oend-MFLIMIT) || (ip+ll>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  244|  19.0k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2537:21): [True: 11.3k, False: 19.0k]
  |  Branch (2537:43): [True: 2.15k, False: 16.9k]
  ------------------
 2538|       |                    /* close to input or output end : these must be the last literals of the block,
 2539|       |                     * except with partialDecoding, which can also stop within them,
 2540|       |                     * and incompleteInput, which stops before them : the block goes on */
 2541|  13.5k|                    if (incompleteInput) goto _incomplete;
  ------------------
  |  Branch (2541:25): [True: 0, False: 13.5k]
  ------------------
 2542|  13.5k|                    if (partialDecoding) {
  ------------------
  |  Branch (2542:25): [True: 0, False: 13.5k]
  ------------------
 2543|       |                        /* stop at input end, or when output is full */
 2544|      0|                        ll = MIN(ll, (size_t)(iend-ip));
  ------------------
  |  | 2047|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (2047:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2545|      0|                        ll = MIN(ll, (size_t)(oend-op));
  ------------------
  |  | 2047|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (2047:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2546|  13.5k|                    } else if ((ip+ll != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2546:32): [True: 0, False: 13.5k]
  |  Branch (2546:51): [True: 0, False: 13.5k]
  ------------------
 2547|       |                        /* last literals must end exactly at input end, within output */
 2548|      0|                        DEBUGLOG(5, "invalid last literals : they end at iend%+zi and oend%+zi", (ip+ll)-iend, cpy-oend);
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2549|      0|                        if ((ip+ll <= iend) && (cpy > oend-MFLIMIT)) goto _dst_too_small;   /* output full, input left */
  ------------------
  |  |  245|      0|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2549:29): [True: 0, False: 0]
  |  Branch (2549:48): [True: 0, False: 0]
  ------------------
 2550|      0|                        goto _output_error;
 2551|      0|                    }
 2552|  13.5k|                    LZ4_memmove(op, ip, ll);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  356|  13.5k|#    define LZ4_memmove __builtin_memmove
  ------------------
 2553|  13.5k|                    ip += ll;
 2554|  13.5k|                    op += ll;
 2555|       |                    /* end of block, unless partialDecoding can go on : output not full, input left for a match */
 2556|  13.5k|                    if (!partialDecoding || (op == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2556:25): [True: 13.5k, False: 0]
  |  Branch (2556:45): [True: 0, False: 0]
  |  Branch (2556:61): [True: 0, False: 0]
  ------------------
 2557|  13.5k|                        break;
 2558|  13.5k|                    }
 2559|  16.9k|                } else {
 2560|  16.9k|                    LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2561|  16.9k|                    ip += ll; op = cpy;
 2562|  16.9k|                }
 2563|       |
 2564|       |                /* get offset */
 2565|  16.9k|                offset = LZ4_readLE16(ip); ip+=2;
 2566|  16.9k|                match = op - offset;
 2567|       |
 2568|       |                /* get matchlength */
 2569|  16.9k|                ml = token & ML_MASK;
  ------------------
  |  |  260|  16.9k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  16.9k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2570|  16.9k|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ml);
  ------------------
  |  |  288|  16.9k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2571|  16.9k|            }
 2572|       |
 2573|       |            /* literals copied, offset decoded, ml == match length token */
 2574|  21.1k|            if (ml == ML_MASK) {
  ------------------
  |  |  260|  21.1k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  21.1k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2574:17): [True: 4.03k, False: 17.0k]
  ------------------
 2575|       |                /* after match length extension bytes, at least 1 token + LASTLITERALS literals must remain */
 2576|  4.03k|                size_t const addl = read_variable_length(&ip, iend - (1 + LASTLITERALS));
  ------------------
  |  |  244|  4.03k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2577|  4.03k|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2577:21): [True: 0, False: 4.03k]
  ------------------
 2578|  4.03k|                ml += addl;
 2579|  4.03k|                if (unlikely((uptrval)(op)+ml+MINMATCH<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|  4.03k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  4.03k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 4.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2580|  4.03k|            }
 2581|  21.1k|            ml += MINMATCH;
  ------------------
  |  |  241|  21.1k|#define MINMATCH 4
  ------------------
 2582|       |
 2583|  21.1k|#if LZ4_FAST_DEC_LOOP
 2584|  25.1k|        safe_match_copy:
 2585|  25.1k|#endif
 2586|       |            /* literals copied, match fully decoded (ml includes MINMATCH), offset not validated yet */
 2587|  25.1k|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _offset_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|  25.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  25.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2587:17): [True: 25.1k, False: 0]
  |  Branch (2587:34): [True: 0, False: 25.1k]
  ------------------
 2588|       |
 2589|       |            /* end of block : the last LASTLITERALS bytes must be literals */
 2590|  25.1k|            assert(op <= oend);
  ------------------
  |  Branch (2590:13): [True: 0, False: 25.1k]
  |  Branch (2590:13): [True: 25.1k, False: 0]
  ------------------
 2591|  25.1k|            if (unlikely(op+ml > oend-LASTLITERALS)) {
  ------------------
  |  |  180|  25.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  25.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 25.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2592|      0|                if (partialDecoding) ml = MIN(ml, (size_t)(oend-op));   /* partialDecoding : may end anywhere */
  ------------------
  |  | 2047|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (2047:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2592:21): [True: 0, False: 0]
  ------------------
 2593|      0|                else goto _dst_too_small;
 2594|      0|            }
 2595|       |
 2596|       |            /* match starting within external dictionary */
 2597|  25.1k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2597:17): [True: 0, False: 25.1k]
  |  Branch (2597:41): [True: 0, False: 0]
  ------------------
 2598|      0|                assert(dictEnd != NULL);
  ------------------
  |  Branch (2598:17): [True: 0, False: 0]
  |  Branch (2598:17): [True: 0, False: 0]
  ------------------
 2599|      0|                op = LZ4_copyExtDictMatch(op, match, ml, lowPrefix, dictEnd);
 2600|      0|                continue;
 2601|      0|            }
 2602|  25.1k|            assert(match >= lowPrefix);
  ------------------
  |  Branch (2602:13): [True: 0, False: 25.1k]
  |  Branch (2602:13): [True: 25.1k, False: 0]
  ------------------
 2603|       |
 2604|       |            /* close to block end : no wild copy */
 2605|  25.1k|            if (unlikely(op+ml > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|  25.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  25.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 8.18k, False: 17.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2606|  8.18k|                op = LZ4_copyMatchExact(op, match, ml);
 2607|  8.18k|                if (op == oend) { break; }   /* partialDecoding : output buffer full */
  ------------------
  |  Branch (2607:21): [True: 0, False: 8.18k]
  ------------------
 2608|  8.18k|                continue;
 2609|  8.18k|            }
 2610|       |
 2611|       |            /* copy match within block */
 2612|  17.0k|            cpy = op + ml;
 2613|  17.0k|            LZ4_memcpy_using_offset_base(op, match, cpy, offset);
 2614|  17.0k|            op = cpy;   /* wildcopy correction */
 2615|  17.0k|        }
 2616|       |
 2617|       |        /* end of decoding */
 2618|  13.5k|        assert(!incompleteInput);   /* never ends the block : stops before its last literals */
  ------------------
  |  Branch (2618:9): [True: 0, False: 13.5k]
  |  Branch (2618:9): [True: 13.5k, False: 0]
  ------------------
 2619|  13.5k|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  288|  13.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2620|  13.5k|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2621|       |
 2622|      0|    _incomplete:   /* incompleteInput : stop before the current sequence, which can't be decoded yet */
 2623|      0|        DEBUGLOG(5, "incomplete input : decoded %i bytes", (int)(seqOp - (BYTE*)dst));
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2624|      0|        *srcEndPtr = (const char*)seqIp;
 2625|      0|        return (int)(seqOp - (BYTE*)dst);
 2626|       |
 2627|       |        /* errors : see LZ4_decompress_safe() in lz4.h
 2628|       |         * incompleteInput : input ends within the current sequence, or output is full,
 2629|       |         * or the sequence is invalid (reported once the block is complete) : stop before it */
 2630|      0|    _output_error:
 2631|      0|        if (incompleteInput) goto _incomplete;
  ------------------
  |  Branch (2631:13): [True: 0, False: 0]
  ------------------
 2632|      0|        return -1;
 2633|      0|    _dst_too_small:
 2634|      0|        if (incompleteInput) goto _incomplete;
  ------------------
  |  Branch (2634:13): [True: 0, False: 0]
  ------------------
 2635|      0|        return -2;
 2636|      0|    _offset_error:
 2637|      0|        if (incompleteInput) goto _incomplete;
  ------------------
  |  Branch (2637:13): [True: 0, False: 0]
  ------------------
 2638|      0|        return -3;
 2639|      0|    }
 2640|      0|}
lz4.c:read_variable_length:
 2182|  1.06M|{
 2183|  1.06M|    Rvl_t s, length = 0;
 2184|  1.06M|    assert(ipPtr != NULL);
  ------------------
  |  Branch (2184:5): [True: 0, False: 1.06M]
  |  Branch (2184:5): [True: 1.06M, False: 0]
  ------------------
 2185|  1.06M|    assert(*ipPtr !=  NULL);
  ------------------
  |  Branch (2185:5): [True: 0, False: 1.06M]
  |  Branch (2185:5): [True: 1.06M, False: 0]
  ------------------
 2186|  1.06M|    assert(ilimit != NULL);
  ------------------
  |  Branch (2186:5): [True: 0, False: 1.06M]
  |  Branch (2186:5): [True: 1.06M, False: 0]
  ------------------
 2187|  1.06M|    if (unlikely((*ipPtr) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  1.06M|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.06M|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2188|      0|        return rvl_error;
 2189|      0|    }
 2190|  1.06M|    s = **ipPtr;
 2191|  1.06M|    (*ipPtr)++;
 2192|  1.06M|    length += s;
 2193|  1.06M|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  1.06M|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  1.06M|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 981k, False: 86.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2194|  1.52M|    do {
 2195|  1.52M|        if (unlikely((*ipPtr) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  1.52M|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.52M|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2196|      0|            return rvl_error;
 2197|      0|        }
 2198|  1.52M|        s = **ipPtr;
 2199|  1.52M|        (*ipPtr)++;
 2200|  1.52M|        length += s;
 2201|       |        /* accumulator overflow detection (32-bit mode only) */
 2202|  1.52M|        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 (2202:13): [Folded, False: 1.52M]
  ------------------
 2203|      0|            return rvl_error;
 2204|      0|        }
 2205|  1.52M|    } while (s == 255);
  ------------------
  |  Branch (2205:14): [True: 1.44M, False: 86.5k]
  ------------------
 2206|       |
 2207|  86.5k|    return length;
 2208|  86.5k|}
lz4.c:LZ4_wildCopy64:
  536|   888k|{
  537|   888k|    BYTE* d = (BYTE*)dstPtr;
  538|   888k|    const BYTE* s = (const BYTE*)srcPtr;
  539|   888k|    BYTE* const e = (BYTE*)dstEnd;
  540|       |
  541|  3.70M|    do { LZ4_memcpy(d,s,64); d+=64; s+=64; } while (d<e);
  ------------------
  |  |  348|  3.70M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (541:53): [True: 2.81M, False: 888k]
  ------------------
  542|   888k|}
lz4.c:LZ4_readLE16:
  430|  3.73M|{
  431|  3.73M|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (431:9): [True: 3.73M, False: 0]
  ------------------
  432|  3.73M|        return LZ4_read16(memPtr);
  433|  3.73M|    } else {
  434|      0|        const BYTE* p = (const BYTE*)memPtr;
  435|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  436|      0|    }
  437|  3.73M|}
lz4.c:LZ4_memcpy_using_offset:
  575|   230k|{
  576|   230k|    BYTE v[8];
  577|       |
  578|   230k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  Branch (578:5): [True: 0, False: 230k]
  |  Branch (578:5): [True: 230k, False: 0]
  ------------------
  579|       |
  580|   230k|    switch(offset) {
  581|   108k|    case 1:
  ------------------
  |  Branch (581:5): [True: 108k, False: 122k]
  ------------------
  582|   108k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  235|   108k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  233|   108k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  583|   108k|        break;
  584|  52.6k|    case 2:
  ------------------
  |  Branch (584:5): [True: 52.6k, False: 178k]
  ------------------
  585|  52.6k|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  348|  52.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  586|  52.6k|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  348|  52.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  587|       |#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */
  588|       |#  pragma warning(push)
  589|       |#  pragma warning(disable : 6385) /* warning C6385: Reading invalid data from 'v'. */
  590|       |#endif
  591|  52.6k|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  348|  52.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  592|       |#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */
  593|       |#  pragma warning(pop)
  594|       |#endif
  595|  52.6k|        break;
  596|  16.2k|    case 4:
  ------------------
  |  Branch (596:5): [True: 16.2k, False: 214k]
  ------------------
  597|  16.2k|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  348|  16.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  598|  16.2k|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  348|  16.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  599|  16.2k|        break;
  600|  53.7k|    default:
  ------------------
  |  Branch (600:5): [True: 53.7k, False: 177k]
  ------------------
  601|  53.7k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  602|  53.7k|        return;
  603|   230k|    }
  604|       |
  605|   177k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  348|   177k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  606|   177k|    dstPtr += 8;
  607|  13.0M|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (607:12): [True: 12.8M, False: 177k]
  ------------------
  608|  12.8M|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  348|  12.8M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  609|  12.8M|        dstPtr += 8;
  610|  12.8M|    }
  611|   177k|}
lz4.c:LZ4_wildCopy32:
  550|  86.1k|{
  551|  86.1k|    BYTE* d = (BYTE*)dstPtr;
  552|  86.1k|    const BYTE* s = (const BYTE*)srcPtr;
  553|  86.1k|    BYTE* const e = (BYTE*)dstEnd;
  554|       |
  555|   141k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  348|   141k|#    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);
  ------------------
  |  |  348|   141k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (555:79): [True: 55.5k, False: 86.1k]
  ------------------
  556|  86.1k|}
lz4.c:LZ4_copyMatchExact:
 2217|  8.18k|{
 2218|  8.18k|    if (unlikely(match == op)) {   /* invalid offset 0 : clear the match segment, see doc/lz4_Block_format.md */
  ------------------
  |  |  180|  8.18k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  8.18k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 8.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2219|      0|        MEM_INIT(op, 0, length);
  ------------------
  |  |  235|      0|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  233|      0|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
 2220|      0|        return op + length;
 2221|      0|    }
 2222|       |    /* bytes from match to op repeat with period (op-match) :
 2223|       |     * copy all of them, so the distance doubles at each round.
 2224|       |     * Beyond 2 KB, keep the distance : larger copies of just written data are slower */
 2225|  54.4k|    while (length > (size_t)(op - match)) {
  ------------------
  |  Branch (2225:12): [True: 46.3k, False: 8.18k]
  ------------------
 2226|  46.3k|        size_t const available = (size_t)(op - match);
 2227|  46.3k|        LZ4_memcpy(op, match, available);
  ------------------
  |  |  348|  46.3k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2228|  46.3k|        op += available;
 2229|  46.3k|        length -= available;
 2230|  46.3k|        if (available >= 2048) match += available;
  ------------------
  |  Branch (2230:13): [True: 28.6k, False: 17.6k]
  ------------------
 2231|  46.3k|    }
 2232|  8.18k|    LZ4_memcpy(op, match, length);
  ------------------
  |  |  348|  8.18k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2233|  8.18k|    return op + length;
 2234|  8.18k|}
lz4.c:LZ4_memcpy_using_offset_base:
  496|  70.7k|{
  497|  70.7k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  Branch (497:5): [True: 0, False: 70.7k]
  |  Branch (497:5): [True: 70.7k, False: 0]
  ------------------
  498|  70.7k|    if (unlikely(offset < 8)) {
  ------------------
  |  |  180|  70.7k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  70.7k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 56.5k, False: 14.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|  56.5k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  500|  56.5k|        dstPtr[0] = srcPtr[0];
  501|  56.5k|        dstPtr[1] = srcPtr[1];
  502|  56.5k|        dstPtr[2] = srcPtr[2];
  503|  56.5k|        dstPtr[3] = srcPtr[3];
  504|  56.5k|        srcPtr += inc32table[offset];
  505|  56.5k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  348|  56.5k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  506|  56.5k|        srcPtr -= dec64table[offset];
  507|  56.5k|    } else {
  508|  14.2k|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  348|  14.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  509|  14.2k|        srcPtr += 8;
  510|  14.2k|    }
  511|  70.7k|    dstPtr += 8;
  512|       |
  513|       |    /* srcPtr is now at least 8 bytes behind dstPtr */
  514|  70.7k|    LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  348|  70.7k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  515|  70.7k|    if (dstEnd > dstPtr + 8) { LZ4_wildCopy8(dstPtr + 8, srcPtr + 8, dstEnd); }
  ------------------
  |  Branch (515:9): [True: 31.3k, False: 39.4k]
  ------------------
  516|  70.7k|}
lz4hc.c:LZ4_isAligned:
  292|  26.4k|{
  293|  26.4k|    return ((size_t)ptr & (alignment -1)) == 0;
  294|  26.4k|}
lz4hc.c:LZ4_count:
  720|   105M|{
  721|   105M|    const BYTE* const pStart = pIn;
  722|       |
  723|   105M|    if (likely(pIn < pInLimit-(STEPSIZE-1))) {
  ------------------
  |  |  177|   105M|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|   105M|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 105M, False: 44.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  724|   105M|        reg_t const diff = LZ4_read_ARCH(pMatch) ^ LZ4_read_ARCH(pIn);
  725|   105M|        if (!diff) {
  ------------------
  |  Branch (725:13): [True: 27.2M, False: 78.2M]
  ------------------
  726|  27.2M|            pIn+=STEPSIZE; pMatch+=STEPSIZE;
  ------------------
  |  |  717|  27.2M|#define STEPSIZE sizeof(reg_t)
  ------------------
                          pIn+=STEPSIZE; pMatch+=STEPSIZE;
  ------------------
  |  |  717|  27.2M|#define STEPSIZE sizeof(reg_t)
  ------------------
  727|  78.2M|        } else {
  728|  78.2M|            return LZ4_NbCommonBytes(diff);
  729|  78.2M|    }   }
  730|       |
  731|   823M|    while (likely(pIn < pInLimit-(STEPSIZE-1))) {
  732|   823M|        reg_t const diff = LZ4_read_ARCH(pMatch) ^ LZ4_read_ARCH(pIn);
  733|   823M|        if (!diff) { pIn+=STEPSIZE; pMatch+=STEPSIZE; continue; }
  ------------------
  |  |  717|   795M|#define STEPSIZE sizeof(reg_t)
  ------------------
                      if (!diff) { pIn+=STEPSIZE; pMatch+=STEPSIZE; continue; }
  ------------------
  |  |  717|   795M|#define STEPSIZE sizeof(reg_t)
  ------------------
  |  Branch (733:13): [True: 795M, False: 27.2M]
  ------------------
  734|  27.2M|        pIn += LZ4_NbCommonBytes(diff);
  735|  27.2M|        return (unsigned)(pIn - pStart);
  736|   823M|    }
  737|       |
  738|  63.5k|    if ((STEPSIZE==8) && (pIn<(pInLimit-3)) && (LZ4_read32(pMatch) == LZ4_read32(pIn))) { pIn+=4; pMatch+=4; }
  ------------------
  |  |  717|  63.5k|#define STEPSIZE sizeof(reg_t)
  ------------------
  |  Branch (738:9): [True: 63.5k, Folded]
  |  Branch (738:26): [True: 51.1k, False: 12.4k]
  |  Branch (738:48): [True: 16.3k, False: 34.8k]
  ------------------
  739|  63.5k|    if ((pIn<(pInLimit-1)) && (LZ4_read16(pMatch) == LZ4_read16(pIn))) { pIn+=2; pMatch+=2; }
  ------------------
  |  Branch (739:9): [True: 53.6k, False: 9.95k]
  |  Branch (739:31): [True: 21.4k, False: 32.1k]
  ------------------
  740|  63.5k|    if ((pIn<pInLimit) && (*pMatch == *pIn)) pIn++;
  ------------------
  |  Branch (740:9): [True: 55.3k, False: 8.24k]
  |  Branch (740:27): [True: 24.3k, False: 31.0k]
  ------------------
  741|  63.5k|    return (unsigned)(pIn - pStart);
  742|  27.2M|}
lz4hc.c:LZ4_read_ARCH:
  394|  2.09G|static reg_t LZ4_read_ARCH(const void* ptr) { return ((const LZ4_unalignST*)ptr)->uArch; }
lz4hc.c:LZ4_NbCommonBytes:
  619|   259M|{
  620|   259M|    assert(val != 0);
  ------------------
  |  Branch (620:5): [True: 0, False: 259M]
  |  Branch (620:5): [True: 259M, False: 0]
  ------------------
  621|   259M|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (621:9): [True: 259M, False: 0]
  ------------------
  622|   259M|        if (sizeof(val) == 8) {
  ------------------
  |  Branch (622:13): [True: 259M, Folded]
  ------------------
  623|       |#       if defined(_MSC_VER) && (_MSC_VER >= 1800) && (defined(_M_AMD64) && !defined(_M_ARM64EC)) && !defined(LZ4_FORCE_SW_BITCOUNT)
  624|       |/*-*************************************************************************************************
  625|       |* ARM64EC is a Microsoft-designed ARM64 ABI compatible with AMD64 applications on ARM64 Windows 11.
  626|       |* The ARM64EC ABI does not support AVX/AVX2/AVX512 instructions, nor their relevant intrinsics
  627|       |* including _tzcnt_u64. Therefore, we need to neuter the _tzcnt_u64 code path for ARM64EC.
  628|       |****************************************************************************************************/
  629|       |#         if defined(__clang__) && (__clang_major__ < 10)
  630|       |            /* Avoid undefined clang-cl intrinsics issue.
  631|       |             * See https://github.com/lz4/lz4/pull/1017 for details. */
  632|       |            return (unsigned)__builtin_ia32_tzcnt_u64(val) >> 3;
  633|       |#         else
  634|       |            /* x64 CPUS without BMI support interpret `TZCNT` as `REP BSF` */
  635|       |            return (unsigned)_tzcnt_u64(val) >> 3;
  636|       |#         endif
  637|       |#       elif defined(_MSC_VER) && defined(_WIN64) && !defined(LZ4_FORCE_SW_BITCOUNT)
  638|       |            unsigned long r = 0;
  639|       |            _BitScanForward64(&r, (U64)val);
  640|       |            return (unsigned)r >> 3;
  641|       |#       elif (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \
  642|       |                            ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \
  643|       |                                        !defined(LZ4_FORCE_SW_BITCOUNT)
  644|       |            return (unsigned)__builtin_ctzll((U64)val) >> 3;
  645|       |#       else
  646|       |            const U64 m = 0x0101010101010101ULL;
  647|       |            val ^= val - 1;
  648|       |            return (unsigned)(((U64)((val & (m - 1)) * m)) >> 56);
  649|       |#       endif
  650|   259M|        } else /* 32 bits */ {
  651|       |#       if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(LZ4_FORCE_SW_BITCOUNT)
  652|       |            unsigned long r;
  653|       |            _BitScanForward(&r, (U32)val);
  654|       |            return (unsigned)r >> 3;
  655|       |#       elif (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \
  656|       |                            ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \
  657|       |                        !defined(__TINYC__) && !defined(LZ4_FORCE_SW_BITCOUNT)
  658|       |            return (unsigned)__builtin_ctz((U32)val) >> 3;
  659|       |#       else
  660|       |            const U32 m = 0x01010101;
  661|       |            return (unsigned)((((val - 1) ^ val) & (m - 1)) * m) >> 24;
  662|       |#       endif
  663|      0|        }
  664|   259M|    } else   /* Big Endian CPU */ {
  665|      0|        if (sizeof(val)==8) {
  ------------------
  |  Branch (665:13): [True: 0, Folded]
  ------------------
  666|      0|#       if (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \
  667|      0|                            ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \
  668|      0|                        !defined(__TINYC__) && !defined(LZ4_FORCE_SW_BITCOUNT)
  669|      0|            return (unsigned)__builtin_clzll((U64)val) >> 3;
  670|       |#       else
  671|       |#if 1
  672|       |            /* this method is probably faster,
  673|       |             * but adds a 128 bytes lookup table */
  674|       |            static const unsigned char ctz7_tab[128] = {
  675|       |                7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  676|       |                4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  677|       |                5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  678|       |                4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  679|       |                6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  680|       |                4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  681|       |                5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  682|       |                4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
  683|       |            };
  684|       |            U64 const mask = 0x0101010101010101ULL;
  685|       |            U64 const t = (((val >> 8) - mask) | val) & mask;
  686|       |            return ctz7_tab[(t * 0x0080402010080402ULL) >> 57];
  687|       |#else
  688|       |            /* this method doesn't consume memory space like the previous one,
  689|       |             * but it contains several branches,
  690|       |             * that may end up slowing execution */
  691|       |            static const U32 by32 = sizeof(val)*4;  /* 32 on 64 bits (goal), 16 on 32 bits.
  692|       |            Just to avoid some static analyzer complaining about shift by 32 on 32-bits target.
  693|       |            Note that this code path is never triggered in 32-bits mode. */
  694|       |            unsigned r;
  695|       |            if (!(val>>by32)) { r=4; } else { r=0; val>>=by32; }
  696|       |            if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; }
  697|       |            r += (!val);
  698|       |            return r;
  699|       |#endif
  700|       |#       endif
  701|      0|        } else /* 32 bits */ {
  702|      0|#       if (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \
  703|      0|                            ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \
  704|      0|                                        !defined(LZ4_FORCE_SW_BITCOUNT)
  705|      0|            return (unsigned)__builtin_clz((U32)val) >> 3;
  706|       |#       else
  707|       |            val >>= 8;
  708|       |            val = ((((val + 0x00FFFF00) | 0x00FFFFFF) + val) |
  709|       |              (val + 0x00FF0000)) >> 24;
  710|       |            return (unsigned)val ^ 3;
  711|       |#       endif
  712|      0|        }
  713|      0|    }
  714|   259M|}
lz4hc.c:LZ4_isLittleEndian:
  363|   326M|{
  364|   326M|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  365|   326M|    return one.c[0];
  366|   326M|}
lz4hc.c:LZ4_read32:
  393|  3.67G|static U32 LZ4_read32(const void* ptr) { return ((const LZ4_unalign32*)ptr)->u32; }
lz4hc.c:LZ4_read16:
  392|  1.69G|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4hc.c:LZ4_wildCopy8:
  465|  3.96M|{
  466|  3.96M|    BYTE* d = (BYTE*)dstPtr;
  467|  3.96M|    const BYTE* s = (const BYTE*)srcPtr;
  468|  3.96M|    BYTE* const e = (BYTE*)dstEnd;
  469|       |
  470|  12.6M|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  348|  12.6M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (470:50): [True: 8.70M, False: 3.96M]
  ------------------
  471|  3.96M|}
lz4hc.c:LZ4_writeLE16:
  452|  3.96M|{
  453|  3.96M|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (453:9): [True: 3.96M, False: 0]
  ------------------
  454|  3.96M|        LZ4_write16(memPtr, value);
  455|  3.96M|    } else {
  456|      0|        BYTE* p = (BYTE*)memPtr;
  457|      0|        p[0] = (BYTE) value;
  458|      0|        p[1] = (BYTE)(value>>8);
  459|      0|    }
  460|  3.96M|}
lz4hc.c:LZ4_write16:
  396|  3.96M|static void LZ4_write16(void* memPtr, U16 value) { ((LZ4_unalign16*)memPtr)->u16 = value; }

LZ4_sizeofStateHC:
 1591|  8.79k|int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); }
LZ4_compress_HC_extStateHC_fastReset:
 1606|  8.84k|{
 1607|  8.84k|    LZ4HC_CCtx_internal* const ctx = &((LZ4_streamHC_t*)state)->internal_donotuse;
 1608|  8.84k|    if (!LZ4_isAligned(state, LZ4_streamHC_t_alignment())) return 0;
  ------------------
  |  Branch (1608:9): [True: 0, False: 8.84k]
  ------------------
 1609|  8.84k|    LZ4_resetStreamHC_fast((LZ4_streamHC_t*)state, compressionLevel);
 1610|  8.84k|    LZ4HC_init_internal (ctx, (const BYTE*)src);
 1611|  8.84k|    if (dstCapacity < LZ4_compressBound(srcSize))
  ------------------
  |  Branch (1611:9): [True: 8.84k, False: 0]
  ------------------
 1612|  8.84k|        return LZ4HC_compress_generic (ctx, src, dst, &srcSize, dstCapacity, compressionLevel, limitedOutput);
 1613|      0|    else
 1614|      0|        return LZ4HC_compress_generic (ctx, src, dst, &srcSize, dstCapacity, compressionLevel, notLimited);
 1615|  8.84k|}
LZ4_compress_HC:
 1625|  8.84k|{
 1626|  8.84k|    int cSize;
 1627|  8.84k|    DEBUGLOG(5, "LZ4_compress_HC")
  ------------------
  |  |  288|  8.84k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1628|  8.84k|#if defined(LZ4HC_HEAPMODE) && LZ4HC_HEAPMODE==1
 1629|  8.84k|    {   /* extended state : a single allocation, including the temporary buffer of levels >= 10 */
 1630|  8.84k|        LZ4_streamHC_t* const statePtr = LZ4_initStreamHC(ALLOC(LZ4_STREAMHC_EXTSIZE), LZ4_STREAMHC_EXTSIZE);
  ------------------
  |  |  224|  8.84k|# define ALLOC(s)          malloc(s)
  ------------------
                      LZ4_streamHC_t* const statePtr = LZ4_initStreamHC(ALLOC(LZ4_STREAMHC_EXTSIZE), LZ4_STREAMHC_EXTSIZE);
  ------------------
  |  |  380|  8.84k|#define LZ4_STREAMHC_EXTSIZE (sizeof(LZ4_streamHC_t) + 65584)   /* LZ4_streamHC_t exceeds LZ4_STREAMHC_MINSIZE with 16-byte pointers */
  ------------------
 1631|  8.84k|        if (statePtr==NULL) return 0;
  ------------------
  |  Branch (1631:13): [True: 0, False: 8.84k]
  ------------------
 1632|  8.84k|        cSize = LZ4_compress_HC_extStateHC_fastReset(statePtr, src, dst, srcSize, dstCapacity, compressionLevel);
 1633|  8.84k|        FREEMEM(statePtr);
  ------------------
  |  |  226|  8.84k|# define FREEMEM(p)        free(p)
  ------------------
 1634|  8.84k|    }
 1635|       |#else
 1636|       |    {   LZ4_streamHC_t state;
 1637|       |        cSize = LZ4_compress_HC_extStateHC(&state, src, dst, srcSize, dstCapacity, compressionLevel);
 1638|       |    }
 1639|       |#endif
 1640|      0|    return cSize;
 1641|  8.84k|}
LZ4_compress_HC_destSize:
 1645|  8.79k|{
 1646|  8.79k|    LZ4_streamHC_t* const ctx = LZ4_initStreamHC(state, sizeof(*ctx));
 1647|  8.79k|    if (ctx==NULL) return 0;   /* init failure */
  ------------------
  |  Branch (1647:9): [True: 0, False: 8.79k]
  ------------------
 1648|  8.79k|    LZ4HC_init_internal(&ctx->internal_donotuse, (const BYTE*) source);
 1649|  8.79k|    LZ4_setCompressionLevel(ctx, cLevel);
 1650|  8.79k|    return LZ4HC_compress_generic(&ctx->internal_donotuse, source, dest, sourceSizePtr, targetDestSize, cLevel, fillOutput);
 1651|  8.79k|}
LZ4_initStreamHC:
 1679|  17.6k|{
 1680|  17.6k|    LZ4_streamHC_t* const LZ4_streamHCPtr = (LZ4_streamHC_t*)buffer;
 1681|  17.6k|    DEBUGLOG(4, "LZ4_initStreamHC(%p, %u)", buffer, (unsigned)size);
  ------------------
  |  |  288|  17.6k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1682|       |    /* check conditions */
 1683|  17.6k|    if (buffer == NULL) return NULL;
  ------------------
  |  Branch (1683:9): [True: 0, False: 17.6k]
  ------------------
 1684|  17.6k|    if (size < sizeof(LZ4_streamHC_t)) return NULL;
  ------------------
  |  Branch (1684:9): [True: 0, False: 17.6k]
  ------------------
 1685|  17.6k|    if (!LZ4_isAligned(buffer, LZ4_streamHC_t_alignment())) return NULL;
  ------------------
  |  Branch (1685:9): [True: 0, False: 17.6k]
  ------------------
 1686|       |    /* init */
 1687|  17.6k|    { LZ4HC_CCtx_internal* const hcstate = &(LZ4_streamHCPtr->internal_donotuse);
 1688|  17.6k|      MEM_INIT(hcstate, 0, sizeof(*hcstate));
  ------------------
  |  |  235|  17.6k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  233|  17.6k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
 1689|  17.6k|      hcstate->hasWorkspace = (size >= LZ4_STREAMHC_EXTSIZE); }
  ------------------
  |  |  380|  17.6k|#define LZ4_STREAMHC_EXTSIZE (sizeof(LZ4_streamHC_t) + 65584)   /* LZ4_streamHC_t exceeds LZ4_STREAMHC_MINSIZE with 16-byte pointers */
  ------------------
 1690|  17.6k|    LZ4_setCompressionLevel(LZ4_streamHCPtr, LZ4HC_CLEVEL_DEFAULT);
  ------------------
  |  |   47|  17.6k|#define LZ4HC_CLEVEL_DEFAULT     9
  ------------------
 1691|  17.6k|    return LZ4_streamHCPtr;
 1692|  17.6k|}
LZ4_resetStreamHC_fast:
 1708|  8.84k|{
 1709|  8.84k|    LZ4HC_CCtx_internal* const s = &LZ4_streamHCPtr->internal_donotuse;
 1710|  8.84k|    DEBUGLOG(5, "LZ4_resetStreamHC_fast(%p, %d)", LZ4_streamHCPtr, compressionLevel);
  ------------------
  |  |  288|  8.84k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1711|       |    /* also after a failed compression : its positions are below @end, hence out of reach of the next stream */
 1712|  8.84k|    assert(s->end >= s->prefixStart);
  ------------------
  |  Branch (1712:5): [True: 0, False: 8.84k]
  |  Branch (1712:5): [True: 8.84k, False: 0]
  ------------------
 1713|  8.84k|    s->dictLimit += (U32)(s->end - s->prefixStart);
 1714|  8.84k|    s->prefixStart = NULL;
 1715|  8.84k|    s->end = NULL;
 1716|       |    s->dictCtx = NULL;
 1717|  8.84k|    LZ4_setCompressionLevel(LZ4_streamHCPtr, compressionLevel);
 1718|  8.84k|}
LZ4_setCompressionLevel:
 1721|  35.2k|{
 1722|  35.2k|    DEBUGLOG(5, "LZ4_setCompressionLevel(%p, %d)", LZ4_streamHCPtr, compressionLevel);
  ------------------
  |  |  288|  35.2k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1723|  35.2k|    if (compressionLevel < 1) compressionLevel = LZ4HC_CLEVEL_DEFAULT;
  ------------------
  |  |   47|      0|#define LZ4HC_CLEVEL_DEFAULT     9
  ------------------
  |  Branch (1723:9): [True: 0, False: 35.2k]
  ------------------
 1724|  35.2k|    if (compressionLevel > LZ4HC_CLEVEL_MAX) compressionLevel = LZ4HC_CLEVEL_MAX;
  ------------------
  |  |   49|  35.2k|#define LZ4HC_CLEVEL_MAX        12
  ------------------
                  if (compressionLevel > LZ4HC_CLEVEL_MAX) compressionLevel = LZ4HC_CLEVEL_MAX;
  ------------------
  |  |   49|      0|#define LZ4HC_CLEVEL_MAX        12
  ------------------
  |  Branch (1724:9): [True: 0, False: 35.2k]
  ------------------
 1725|  35.2k|    LZ4_streamHCPtr->internal_donotuse.compressionLevel = (short)compressionLevel;
 1726|  35.2k|}
lz4hc.c:LZ4_streamHC_t_alignment:
 1594|  26.4k|{
 1595|  26.4k|#if LZ4_ALIGN_TEST
 1596|  26.4k|    typedef struct { char c; LZ4_streamHC_t t; } t_a;
 1597|  26.4k|    return sizeof(t_a) - sizeof(LZ4_streamHC_t);
 1598|       |#else
 1599|       |    return 1;  /* effectively disabled */
 1600|       |#endif
 1601|  26.4k|}
lz4hc.c:LZ4HC_init_internal:
  257|  17.6k|{
  258|  17.6k|    size_t const bufferSize = (size_t)(hc4->end - hc4->prefixStart);
  259|  17.6k|    size_t newStartingOffset = bufferSize + hc4->dictLimit;
  260|  17.6k|    DEBUGLOG(5, "LZ4HC_init_internal");
  ------------------
  |  |  288|  17.6k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  261|  17.6k|    assert(newStartingOffset >= bufferSize);  /* check overflow */
  ------------------
  |  Branch (261:5): [True: 0, False: 17.6k]
  |  Branch (261:5): [True: 17.6k, False: 0]
  ------------------
  262|  17.6k|    if (newStartingOffset > 1 GB) {
  ------------------
  |  |  252|  17.6k|#define GB *(1U<<30)
  ------------------
  |  Branch (262:9): [True: 0, False: 17.6k]
  ------------------
  263|      0|        LZ4HC_clearTables(hc4);
  264|      0|        newStartingOffset = 0;
  265|      0|    }
  266|  17.6k|    newStartingOffset += 64 KB;
  ------------------
  |  |  250|  17.6k|#define KB *(1 <<10)
  ------------------
  267|  17.6k|    hc4->nextToUpdate = (U32)newStartingOffset;
  268|  17.6k|    hc4->prefixStart = start;
  269|  17.6k|    hc4->end = start;
  270|  17.6k|    hc4->dictStart = start;
  271|  17.6k|    hc4->dictLimit = (U32)newStartingOffset;
  272|  17.6k|    hc4->lowLimit = (U32)newStartingOffset;
  273|  17.6k|}
lz4hc.c:LZ4HC_compress_generic:
 1582|  17.6k|{
 1583|  17.6k|    if (ctx->dictCtx == NULL) {
  ------------------
  |  Branch (1583:9): [True: 17.6k, False: 0]
  ------------------
 1584|  17.6k|        return LZ4HC_compress_generic_noDictCtx(ctx, src, dst, srcSizePtr, dstCapacity, cLevel, limit);
 1585|  17.6k|    } else {
 1586|      0|        return LZ4HC_compress_generic_dictCtx(ctx, src, dst, srcSizePtr, dstCapacity, cLevel, limit);
 1587|      0|    }
 1588|  17.6k|}
lz4hc.c:LZ4HC_compress_generic_noDictCtx:
 1529|  17.6k|{
 1530|  17.6k|    assert(ctx->dictCtx == NULL);
  ------------------
  |  Branch (1530:5): [True: 0, False: 17.6k]
  |  Branch (1530:5): [True: 17.6k, False: 0]
  ------------------
 1531|  17.6k|    return LZ4HC_compress_generic_internal(ctx, src, dst, srcSizePtr, dstCapacity, cLevel, limit, noDictCtx);
 1532|  17.6k|}
lz4hc.c:LZ4HC_compress_generic_internal:
 1467|  17.6k|{
 1468|  17.6k|    DEBUGLOG(5, "LZ4HC_compress_generic_internal(src=%p, srcSize=%d, dstCapacity=%d)",
  ------------------
  |  |  288|  17.6k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1469|  17.6k|                src, *srcSizePtr, dstCapacity);
 1470|       |
 1471|       |    /* input sanitization */
 1472|  17.6k|    if ((U32)*srcSizePtr > (U32)LZ4_MAX_INPUT_SIZE) return 0;  /* Unsupported input size (too large or negative) */
  ------------------
  |  |  260|  17.6k|#define LZ4_MAX_INPUT_SIZE        0x7E000000   /* 2 113 929 216 bytes */
  ------------------
  |  Branch (1472:9): [True: 0, False: 17.6k]
  ------------------
 1473|  17.6k|    if (dstCapacity < 1) return 0;   /* Invalid: impossible to store anything */
  ------------------
  |  Branch (1473:9): [True: 48, False: 17.5k]
  ------------------
 1474|  17.6k|    assert(dst); /* since dstCapacity >= 1, dst must be valid */
  ------------------
  |  Branch (1474:5): [True: 0, False: 17.5k]
  |  Branch (1474:5): [True: 17.5k, False: 0]
  ------------------
 1475|  17.5k|    if (*srcSizePtr == 0) { *dst = 0; return 1; }
  ------------------
  |  Branch (1475:9): [True: 0, False: 17.5k]
  ------------------
 1476|  17.5k|    assert(src != NULL); /* since *srcSizePtr >= 1, src must be valid */
  ------------------
  |  Branch (1476:5): [True: 0, False: 17.5k]
  |  Branch (1476:5): [True: 17.5k, False: 0]
  ------------------
 1477|       |
 1478|  17.5k|    ctx->end += *srcSizePtr;
 1479|  17.5k|    {   cParams_t const cParam = LZ4HC_getCLevelParams(cLevel);
 1480|  17.5k|        HCfavor_e const favor = ctx->favorDecSpeed ? favorDecompressionSpeed : favorCompressionRatio;
  ------------------
  |  Branch (1480:33): [True: 0, False: 17.5k]
  ------------------
 1481|  17.5k|        int const srcSize = *srcSizePtr;
 1482|  17.5k|        int result;
 1483|       |
 1484|  17.5k|        if (cParam.strat == lz4mid) {
  ------------------
  |  Branch (1484:13): [True: 3.18k, False: 14.4k]
  ------------------
 1485|  3.18k|            result = LZ4MID_compress(ctx,
 1486|  3.18k|                                src, dst, srcSizePtr, dstCapacity,
 1487|  3.18k|                                limit, dict);
 1488|  14.4k|        } else if (cParam.strat == lz4hc) {
  ------------------
  |  Branch (1488:20): [True: 7.69k, False: 6.70k]
  ------------------
 1489|  7.69k|            result = LZ4HC_compress_hashChain(ctx,
 1490|  7.69k|                                src, dst, srcSizePtr, dstCapacity,
 1491|  7.69k|                                cParam.nbSearches, limit, dict);
 1492|  7.69k|        } else {
 1493|  6.70k|            assert(cParam.strat == lz4opt);
  ------------------
  |  Branch (1493:13): [True: 0, False: 6.70k]
  |  Branch (1493:13): [True: 6.70k, False: 0]
  ------------------
 1494|  6.70k|            result = LZ4HC_compress_optimal(ctx,
 1495|  6.70k|                                src, dst, srcSizePtr, dstCapacity,
 1496|  6.70k|                                cParam.nbSearches, cParam.nbSearchesSeq, (int)cParam.targetLength, limit,
 1497|  6.70k|                                dict, favor);
 1498|  6.70k|        }
 1499|  17.5k|        if ((limit == fillOutput) && (result > 0) && (*srcSizePtr < srcSize)) {
  ------------------
  |  Branch (1499:13): [True: 8.79k, False: 8.79k]
  |  Branch (1499:38): [True: 8.79k, False: 0]
  |  Branch (1499:54): [True: 4.08k, False: 4.71k]
  ------------------
 1500|       |            /* fillOutput : compression stopped before the end of input.
 1501|       |             * The rest of input is left to the next block : it isn't history yet,
 1502|       |             * and the positions already inserted into it are dropped (lz4mid drops its own).
 1503|       |             * Note : a failed compression is different : lz4frame stores its block uncompressed,
 1504|       |             * and the next block still references it. */
 1505|  4.08k|            const BYTE* const consumedEnd = (const BYTE*)src + *srcSizePtr;
 1506|  4.08k|            U32 const consumedIdx = ctx->dictLimit + (U32)(consumedEnd - ctx->prefixStart);
 1507|  4.08k|            if ((cParam.strat != lz4mid) && (ctx->nextToUpdate > consumedIdx)) {
  ------------------
  |  Branch (1507:17): [True: 3.13k, False: 947]
  |  Branch (1507:45): [True: 1.00k, False: 2.12k]
  ------------------
 1508|  1.00k|                LZ4HC_dropPositions(ctx, consumedEnd, consumedEnd + (ctx->nextToUpdate - consumedIdx), cParam.strat);
 1509|  1.00k|                ctx->nextToUpdate = consumedIdx;
 1510|  1.00k|            }
 1511|  4.08k|            ctx->end = consumedEnd;
 1512|  4.08k|        }
 1513|  17.5k|        return result;
 1514|  17.5k|    }
 1515|  17.5k|}
lz4hc.c:LZ4MID_compress:
  725|  3.18k|{
  726|  3.18k|    U32* const hash4Table = ctx->hashTable;
  727|  3.18k|    U32* const hash8Table = hash4Table + LZ4MID_HASHTABLESIZE;
  ------------------
  |  |  157|  3.18k|#define LZ4MID_HASHTABLESIZE (1 << LZ4MID_HASHLOG)
  |  |  ------------------
  |  |  |  |  156|  3.18k|#define LZ4MID_HASHLOG (LZ4HC_HASH_LOG-1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|  3.18k|#define LZ4HC_HASH_LOG 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|  3.18k|    const BYTE* ip = (const BYTE*)src;
  729|  3.18k|    const BYTE* anchor = ip;
  730|  3.18k|    const BYTE* const iend = ip + *srcSizePtr;
  731|  3.18k|    const BYTE* mflimit;      /* set after the size check : would precede a small input */
  732|  3.18k|    const BYTE* matchlimit;
  733|  3.18k|    const BYTE* ilimit;
  734|  3.18k|    BYTE* op = (BYTE*)dst;
  735|       |    /* fillOutput : keep room for the final run of literals (LZ4 format restriction) */
  736|  3.18k|    BYTE* const oend = op + maxOutputSize - ((limit == fillOutput) ? LASTLITERALS : 0);
  ------------------
  |  |  244|  1.59k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (736:46): [True: 1.59k, False: 1.59k]
  ------------------
  737|       |
  738|  3.18k|    const BYTE* const prefixPtr = ctx->prefixStart;
  739|  3.18k|    const U32 prefixIdx = ctx->dictLimit;
  740|  3.18k|    U32 ilimitIdx;
  741|  3.18k|    const BYTE* const dictStart = ctx->dictStart;
  742|  3.18k|    const U32 dictIdx = ctx->lowLimit;
  743|  3.18k|    const U32 gDictEndIndex = ctx->lowLimit;
  744|  3.18k|    const LZ4MID_searchIntoDict_f searchIntoDict = (dict == usingDictCtxHc) ? select_searchDict_function(ctx->dictCtx) : NULL;
  ------------------
  |  Branch (744:52): [True: 0, False: 3.18k]
  ------------------
  745|  3.18k|    const BYTE* refEnd = ip;   /* fillOutput : the hash tables reference positions before MAX(refEnd, ip) */
  746|       |
  747|  3.18k|    DEBUGLOG(5, "LZ4MID_compress (%i bytes)", *srcSizePtr);
  ------------------
  |  |  288|  3.18k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  748|       |
  749|       |    /* preconditions verifications */
  750|  3.18k|    if (dict == usingDictCtxHc) DEBUGLOG(5, "usingDictCtxHc");
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  |  Branch (750:9): [True: 0, False: 3.18k]
  ------------------
  751|  3.18k|    assert(*srcSizePtr > 0);
  ------------------
  |  Branch (751:5): [True: 0, False: 3.18k]
  |  Branch (751:5): [True: 3.18k, False: 0]
  ------------------
  752|  3.18k|    assert(*srcSizePtr <= LZ4_MAX_INPUT_SIZE);
  ------------------
  |  Branch (752:5): [True: 0, False: 3.18k]
  |  Branch (752:5): [True: 3.18k, False: 0]
  ------------------
  753|  3.18k|    assert(src != NULL);
  ------------------
  |  Branch (753:5): [True: 0, False: 3.18k]
  |  Branch (753:5): [True: 3.18k, False: 0]
  ------------------
  754|  3.18k|    assert(maxOutputSize >= 1);
  ------------------
  |  Branch (754:5): [True: 0, False: 3.18k]
  |  Branch (754:5): [True: 3.18k, False: 0]
  ------------------
  755|  3.18k|    assert(dst != NULL);
  ------------------
  |  Branch (755:5): [True: 0, False: 3.18k]
  |  Branch (755:5): [True: 3.18k, False: 0]
  ------------------
  756|       |
  757|  3.18k|    if (*srcSizePtr < LZ4_minLength)
  ------------------
  |  Branch (757:9): [True: 20, False: 3.16k]
  ------------------
  758|     20|        goto _lz4mid_last_literals;  /* Input too small, no compression (all literals) */
  759|  3.16k|    mflimit = iend - MFLIMIT;
  ------------------
  |  |  245|  3.16k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  760|  3.16k|    matchlimit = (iend - LASTLITERALS);
  ------------------
  |  |  244|  3.16k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  761|  3.16k|    ilimit = (iend - LZ4MID_HASHSIZE);
  ------------------
  |  |  155|  3.16k|#define LZ4MID_HASHSIZE 8
  ------------------
  762|  3.16k|    ilimitIdx = (U32)(ilimit - prefixPtr) + prefixIdx;
  763|       |
  764|       |    /* main loop */
  765|  7.21M|    while (ip <= mflimit) {
  ------------------
  |  Branch (765:12): [True: 7.21M, False: 1.83k]
  ------------------
  766|  7.21M|        const U32 ipIndex = (U32)(ip - prefixPtr) + prefixIdx;
  767|  7.21M|        unsigned matchLength;
  768|  7.21M|        unsigned matchDistance;
  769|       |        /* search long match */
  770|  7.21M|        {   U32 const h8 = LZ4MID_hash8Ptr(ip);
  771|  7.21M|            U32 const pos8 = hash8Table[h8];
  772|  7.21M|            assert(h8 < LZ4MID_HASHTABLESIZE);
  ------------------
  |  Branch (772:13): [True: 0, False: 7.21M]
  |  Branch (772:13): [True: 7.21M, False: 0]
  ------------------
  773|  7.21M|            assert(pos8 < ipIndex);
  ------------------
  |  Branch (773:13): [True: 0, False: 7.21M]
  |  Branch (773:13): [True: 7.21M, False: 0]
  ------------------
  774|  7.21M|            LZ4MID_addPosition(hash8Table, h8, ipIndex);
  775|  7.21M|            matchLength = LZ4MID_countMatch(ip, ipIndex, pos8, matchlimit, prefixPtr, prefixIdx, dictStart, dictIdx);
  776|  7.21M|            matchDistance = ipIndex - pos8;
  777|  7.21M|        }
  778|       |        /* search short match */
  779|  7.21M|        if (matchLength < MINMATCH) {
  ------------------
  |  |  241|  7.21M|#define MINMATCH 4
  ------------------
  |  Branch (779:13): [True: 6.66M, False: 548k]
  ------------------
  780|  6.66M|            U32 const h4 = LZ4MID_hash4Ptr(ip);
  781|  6.66M|            U32 const pos4 = hash4Table[h4];
  782|  6.66M|            assert(h4 < LZ4MID_HASHTABLESIZE);
  ------------------
  |  Branch (782:13): [True: 0, False: 6.66M]
  |  Branch (782:13): [True: 6.66M, False: 0]
  ------------------
  783|  6.66M|            assert(pos4 < ipIndex);
  ------------------
  |  Branch (783:13): [True: 0, False: 6.66M]
  |  Branch (783:13): [True: 6.66M, False: 0]
  ------------------
  784|  6.66M|            LZ4MID_addPosition(hash4Table, h4, ipIndex);
  785|  6.66M|            matchLength = LZ4MID_countMatch(ip, ipIndex, pos4, matchlimit, prefixPtr, prefixIdx, dictStart, dictIdx);
  786|  6.66M|            matchDistance = ipIndex - pos4;
  787|  6.66M|        }
  788|  7.21M|        if (matchLength >= MINMATCH) {
  ------------------
  |  |  241|  7.21M|#define MINMATCH 4
  ------------------
  |  Branch (788:13): [True: 1.08M, False: 6.13M]
  ------------------
  789|  1.08M|            if ((matchLength < 8) && likely(ip < mflimit)) {
  ------------------
  |  |  177|   617k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|   617k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 617k, False: 421]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (789:17): [True: 617k, False: 465k]
  ------------------
  790|       |                /* short match : check ip+1 for longer, except ip itself */
  791|   617k|                U32 const h8 = LZ4MID_hash8Ptr(ip+1);
  792|   617k|                U32 const pos8 = hash8Table[h8];
  793|   617k|                unsigned const ml2 = LZ4MID_countMatch(ip+1, ipIndex+1, pos8, matchlimit, prefixPtr, prefixIdx, dictStart, dictIdx);
  794|   617k|                if ((ml2 > matchLength) && (pos8 != ipIndex)) {
  ------------------
  |  Branch (794:21): [True: 102k, False: 514k]
  |  Branch (794:44): [True: 91.9k, False: 10.6k]
  ------------------
  795|  91.9k|                    LZ4MID_addPosition(hash8Table, h8, ipIndex+1);
  796|  91.9k|                    ip++;
  797|  91.9k|                    matchLength = ml2;
  798|  91.9k|                    matchDistance = ipIndex + 1 - pos8;
  799|  91.9k|            }   }
  800|  1.08M|            goto _lz4mid_encode_sequence;
  801|  1.08M|        }
  802|       |        /* no match found in prefix nor extDict : search into the attached dictionary */
  803|  6.13M|        if ( (dict == usingDictCtxHc)
  ------------------
  |  Branch (803:14): [True: 0, False: 6.13M]
  ------------------
  804|      0|          && (ipIndex - gDictEndIndex < LZ4_DISTANCE_MAX - 8) ) {
  ------------------
  |  |  745|      0|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
  |  Branch (804:14): [True: 0, False: 0]
  ------------------
  805|      0|            LZ4HC_match_t const dMatch = searchIntoDict(ip, ipIndex,
  806|      0|                    matchlimit,
  807|      0|                    ctx->dictCtx, gDictEndIndex);
  808|      0|            assert(dMatch.back == 0);
  ------------------
  |  Branch (808:13): [True: 0, False: 0]
  |  Branch (808:13): [True: 0, False: 0]
  ------------------
  809|      0|            matchLength = (unsigned)dMatch.len;
  810|      0|            matchDistance = (unsigned)dMatch.off;
  811|      0|            if (matchLength >= MINMATCH) goto _lz4mid_encode_sequence;
  ------------------
  |  |  241|      0|#define MINMATCH 4
  ------------------
  |  Branch (811:17): [True: 0, False: 0]
  ------------------
  812|      0|        }
  813|       |        /* no match found */
  814|  6.13M|        ip += 1 + ((ip-anchor) >> 9);  /* skip faster over incompressible data */
  815|  6.13M|        continue;
  816|       |
  817|  1.08M|_lz4mid_encode_sequence:
  818|       |        /* match found at ip : matchLength, matchDistance */
  819|  1.08M|        DEBUGLOG(7, "found match at pos %u (len=%u, distance=%u)",
  ------------------
  |  |  288|  1.08M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  820|  1.08M|                    (U32)(ip - prefixPtr) + prefixIdx, matchLength, matchDistance);
  821|       |
  822|       |        /* catch back */
  823|  1.26M|        while (((ip > anchor) & ((U32)(ip-prefixPtr) > matchDistance)) && (unlikely(ip[-1] == ip[-(int)matchDistance-1]))) {
  ------------------
  |  |  180|   733k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   733k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (823:16): [True: 733k, False: 535k]
  |  Branch (823:75): [True: 184k, False: 548k]
  ------------------
  824|   184k|            ip--;  matchLength++;
  825|   184k|        };
  826|       |
  827|       |        /* fill table with beginning of match
  828|       |         * note : ip may have moved since ipIndex (longer match at ip+1, catch back) */
  829|  1.08M|        {   U32 const startMatchIdx = (U32)(ip-prefixPtr) + prefixIdx;
  830|  1.08M|            ADDPOS8(ip+1, startMatchIdx+1);
  ------------------
  |  |  648|  1.08M|#define ADDPOS8(_p, _idx) LZ4MID_addPosition(hash8Table, LZ4MID_hash8Ptr(_p), _idx)
  ------------------
  831|  1.08M|            ADDPOS8(ip+2, startMatchIdx+2);
  ------------------
  |  |  648|  1.08M|#define ADDPOS8(_p, _idx) LZ4MID_addPosition(hash8Table, LZ4MID_hash8Ptr(_p), _idx)
  ------------------
  832|  1.08M|            ADDPOS4(ip+1, startMatchIdx+1);
  ------------------
  |  |  649|  1.08M|#define ADDPOS4(_p, _idx) LZ4MID_addPosition(hash4Table, LZ4MID_hash4Ptr(_p), _idx)
  ------------------
  833|  1.08M|        }
  834|       |
  835|       |        /* encode */
  836|  1.08M|        if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor),
  ------------------
  |  |  244|  1.08M|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (836:13): [True: 1.32k, False: 1.08M]
  ------------------
  837|  1.08M|                (int)matchLength, (int)matchDistance,
  838|  1.08M|                limit, oend) ) {
  839|  1.32k|            if (limit != fillOutput) return 0;  /* compression failed */
  ------------------
  |  Branch (839:17): [True: 526, False: 802]
  ------------------
  840|    802|            refEnd = ip + matchLength;
  841|    802|            LZ4HC_encodeLastSequence_fillOutput(UPDATABLE(ip, op, anchor),
  ------------------
  |  |  244|    802|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  842|    802|                                (int)matchLength, (int)matchDistance, oend);
  843|    802|            break;
  844|  1.32k|        }
  845|       |
  846|       |        /* fill table with end of match */
  847|  1.08M|        {   U32 endMatchIdx = (U32)(ip-prefixPtr) + prefixIdx;
  848|  1.08M|            U32 pos_m2 = endMatchIdx - 2;
  849|  1.08M|            if (pos_m2 < ilimitIdx) {
  ------------------
  |  Branch (849:17): [True: 1.08M, False: 503]
  ------------------
  850|  1.08M|                if (likely(ip - prefixPtr > 5)) {
  ------------------
  |  |  177|  1.08M|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  1.08M|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 1.08M, False: 184]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  851|  1.08M|                    ADDPOS8(ip-5, endMatchIdx - 5);
  ------------------
  |  |  648|  1.08M|#define ADDPOS8(_p, _idx) LZ4MID_addPosition(hash8Table, LZ4MID_hash8Ptr(_p), _idx)
  ------------------
  852|  1.08M|                }
  853|  1.08M|                ADDPOS8(ip-3, endMatchIdx - 3);
  ------------------
  |  |  648|  1.08M|#define ADDPOS8(_p, _idx) LZ4MID_addPosition(hash8Table, LZ4MID_hash8Ptr(_p), _idx)
  ------------------
  854|  1.08M|                ADDPOS8(ip-2, endMatchIdx - 2);
  ------------------
  |  |  648|  1.08M|#define ADDPOS8(_p, _idx) LZ4MID_addPosition(hash8Table, LZ4MID_hash8Ptr(_p), _idx)
  ------------------
  855|  1.08M|                ADDPOS4(ip-2, endMatchIdx - 2);
  ------------------
  |  |  649|  1.08M|#define ADDPOS4(_p, _idx) LZ4MID_addPosition(hash4Table, LZ4MID_hash4Ptr(_p), _idx)
  ------------------
  856|  1.08M|                ADDPOS4(ip-1, endMatchIdx - 1);
  ------------------
  |  |  649|  1.08M|#define ADDPOS4(_p, _idx) LZ4MID_addPosition(hash4Table, LZ4MID_hash4Ptr(_p), _idx)
  ------------------
  857|  1.08M|            }
  858|  1.08M|        }
  859|  1.08M|    }
  860|       |
  861|  2.66k|_lz4mid_last_literals:
  862|  2.66k|    if (refEnd < ip) refEnd = ip;
  ------------------
  |  Branch (862:9): [True: 1.83k, False: 822]
  ------------------
  863|  2.66k|    if (LZ4HC_encodeLastLiterals(UPDATABLE(ip, op, anchor), iend, limit, oend))
  ------------------
  |  |  244|  2.66k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (863:9): [True: 412, False: 2.24k]
  ------------------
  864|    412|        return 0;  /* not enough space in @dst */
  865|  2.24k|    if (ip < refEnd)   /* fillOutput : the rest of input is left to the next block (input >= LZ4_minLength) */
  ------------------
  |  Branch (865:9): [True: 439, False: 1.80k]
  ------------------
  866|    439|        LZ4HC_dropPositions(ctx, ip, MIN(refEnd, iend - LZ4MID_HASHSIZE), lz4mid);
  ------------------
  |  |   91|    439|#define MIN(a,b)   ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 281, False: 158]
  |  |  ------------------
  ------------------
  867|       |
  868|       |    /* End */
  869|  2.24k|    DEBUGLOG(5, "compressed %i bytes into %i bytes", *srcSizePtr, (int)((char*)op - dst));
  ------------------
  |  |  288|  2.24k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  870|  2.24k|    assert(ip >= (const BYTE*)src);
  ------------------
  |  Branch (870:5): [True: 0, False: 2.24k]
  |  Branch (870:5): [True: 2.24k, False: 0]
  ------------------
  871|  2.24k|    assert(ip <= iend);
  ------------------
  |  Branch (871:5): [True: 0, False: 2.24k]
  |  Branch (871:5): [True: 2.24k, False: 0]
  ------------------
  872|  2.24k|    *srcSizePtr = (int)(ip - (const BYTE*)src);
  873|  2.24k|    assert((char*)op >= dst);
  ------------------
  |  Branch (873:5): [True: 0, False: 2.24k]
  |  Branch (873:5): [True: 2.24k, False: 0]
  ------------------
  874|  2.24k|    assert((char*)op - dst <= maxOutputSize);
  ------------------
  |  Branch (874:5): [True: 0, False: 2.24k]
  |  Branch (874:5): [True: 2.24k, False: 0]
  ------------------
  875|  2.24k|    assert((char*)op - dst < INT_MAX);
  ------------------
  |  Branch (875:5): [True: 0, False: 2.24k]
  |  Branch (875:5): [True: 2.24k, False: 0]
  ------------------
  876|  2.24k|    return (int)((char*)op - dst);
  877|  2.24k|}
lz4hc.c:LZ4HC_hashPtr:
  136|   490M|static U32 LZ4HC_hashPtr(const void* ptr) { return HASH_FUNCTION(LZ4_read32(ptr)); }
  ------------------
  |  |  135|   490M|#define HASH_FUNCTION(i)      (((i) * 2654435761U) >> ((MINMATCH*8)-LZ4HC_HASH_LOG))
  |  |  ------------------
  |  |  |  |  241|   490M|#define MINMATCH 4
  |  |  ------------------
  |  |               #define HASH_FUNCTION(i)      (((i) * 2654435761U) >> ((MINMATCH*8)-LZ4HC_HASH_LOG))
  |  |  ------------------
  |  |  |  |  238|   490M|#define LZ4HC_HASH_LOG 15
  |  |  ------------------
  ------------------
lz4hc.c:LZ4HC_countBack:
  221|  58.9M|{
  222|  58.9M|    int back = 0;
  223|  58.9M|    int const min = (int)MAX(iMin - ip, mMin - match);
  ------------------
  |  |   93|  58.9M|#define MAX(a,b)   ( (a) > (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (93:22): [True: 58.8M, False: 75.8k]
  |  |  ------------------
  ------------------
  224|  58.9M|    assert(min <= 0);
  ------------------
  |  Branch (224:5): [True: 0, False: 58.9M]
  |  Branch (224:5): [True: 58.9M, False: 0]
  ------------------
  225|  58.9M|    assert(ip >= iMin); assert((size_t)(ip-iMin) < (1U<<31));
  ------------------
  |  Branch (225:5): [True: 0, False: 58.9M]
  |  Branch (225:5): [True: 58.9M, False: 0]
  |  Branch (225:25): [True: 0, False: 58.9M]
  |  Branch (225:25): [True: 58.9M, False: 0]
  ------------------
  226|  58.9M|    assert(match >= mMin); assert((size_t)(match - mMin) < (1U<<31));
  ------------------
  |  Branch (226:5): [True: 0, False: 58.9M]
  |  Branch (226:5): [True: 58.9M, False: 0]
  |  Branch (226:28): [True: 0, False: 58.9M]
  |  Branch (226:28): [True: 58.9M, False: 0]
  ------------------
  227|       |
  228|   167M|    while ((back - min) > 3) {
  ------------------
  |  Branch (228:12): [True: 157M, False: 9.72M]
  ------------------
  229|   157M|        U32 const v = LZ4_read32(ip + back - 4) ^ LZ4_read32(match + back - 4);
  230|   157M|        if (v) {
  ------------------
  |  Branch (230:13): [True: 49.1M, False: 108M]
  ------------------
  231|  49.1M|            return (back - (int)LZ4HC_NbCommonBytes32(v));
  232|   108M|        } else back -= 4; /* 4-byte step */
  233|   157M|    }
  234|       |    /* check remainder if any */
  235|  15.0M|    while ( (back > min)
  ------------------
  |  Branch (235:13): [True: 14.8M, False: 208k]
  ------------------
  236|  14.8M|         && (ip[back-1] == match[back-1]) )
  ------------------
  |  Branch (236:13): [True: 5.31M, False: 9.52M]
  ------------------
  237|  5.31M|            back--;
  238|  9.72M|    return back;
  239|  58.9M|}
lz4hc.c:LZ4HC_NbCommonBytes32:
  183|  49.1M|{
  184|  49.1M|    assert(val != 0);
  ------------------
  |  Branch (184:5): [True: 0, False: 49.1M]
  |  Branch (184:5): [True: 49.1M, False: 0]
  ------------------
  185|  49.1M|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (185:9): [True: 49.1M, False: 0]
  ------------------
  186|       |#     if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(LZ4_FORCE_SW_BITCOUNT)
  187|       |        unsigned long r;
  188|       |        _BitScanReverse(&r, val);
  189|       |        return (unsigned)((31 - r) >> 3);
  190|       |#     elif (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \
  191|       |                            ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \
  192|       |                                        !defined(LZ4_FORCE_SW_BITCOUNT)
  193|       |        return (unsigned)__builtin_clz(val) >> 3;
  194|       |#     else
  195|       |        val >>= 8;
  196|       |        val = ((((val + 0x00FFFF00) | 0x00FFFFFF) + val) |
  197|       |              (val + 0x00FF0000)) >> 24;
  198|       |        return (unsigned)val ^ 3;
  199|       |#     endif
  200|  49.1M|    } else {
  201|       |#     if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(LZ4_FORCE_SW_BITCOUNT)
  202|       |        unsigned long r;
  203|       |        _BitScanForward(&r, val);
  204|       |        return (unsigned)(r >> 3);
  205|       |#     elif (defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 3) || \
  206|       |                            ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))))) && \
  207|       |                                        !defined(LZ4_FORCE_SW_BITCOUNT)
  208|       |        return (unsigned)__builtin_ctz(val) >> 3;
  209|       |#     else
  210|       |        const U32 m = 0x01010101;
  211|       |        return (unsigned)((((val - 1) ^ val) & (m - 1)) * m) >> 24;
  212|       |#     endif
  213|      0|    }
  214|  49.1M|}
lz4hc.c:LZ4MID_hash8Ptr:
  165|  13.6M|static U32 LZ4MID_hash8Ptr(const void* ptr) { return LZ4MID_hash7(LZ4_readLE64(ptr)); }
lz4hc.c:LZ4MID_hash7:
  163|  13.6M|static U32 LZ4MID_hash7(U64 v) { return (U32)(((v  << (64-56)) * 58295818150454627ULL) >> (64-LZ4MID_HASHLOG)) ; }
  ------------------
  |  |  156|  13.6M|#define LZ4MID_HASHLOG (LZ4HC_HASH_LOG-1)
  |  |  ------------------
  |  |  |  |  238|  13.6M|#define LZ4HC_HASH_LOG 15
  |  |  ------------------
  ------------------
lz4hc.c:LZ4_readLE64:
  168|  13.6M|{
  169|  13.6M|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (169:9): [True: 13.6M, False: 0]
  ------------------
  170|  13.6M|        return LZ4_read64(memPtr);
  171|  13.6M|    } else {
  172|      0|        const BYTE* p = (const BYTE*)memPtr;
  173|       |        /* note: relies on the compiler to simplify this expression */
  174|      0|        return (U64)p[0] | ((U64)p[1]<<8) | ((U64)p[2]<<16) | ((U64)p[3]<<24)
  175|      0|            | ((U64)p[4]<<32) | ((U64)p[5]<<40) | ((U64)p[6]<<48) | ((U64)p[7]<<56);
  176|      0|    }
  177|  13.6M|}
lz4hc.c:LZ4_read64:
  145|  13.6M|static U64 LZ4_read64(const void* ptr) { return ((const LZ4_unalign64*)ptr)->u64; }
lz4hc.c:LZ4MID_addPosition:
  644|  22.6M|{
  645|  22.6M|    hTable[hValue] = index;
  646|  22.6M|}
lz4hc.c:LZ4MID_countMatch:
  694|  14.4M|{
  695|  14.4M|    if (ipIndex - pos > LZ4_DISTANCE_MAX) return 0;
  ------------------
  |  |  745|  14.4M|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
  |  Branch (695:9): [True: 6.16M, False: 8.33M]
  ------------------
  696|  8.33M|    if (pos >= prefixIdx) {
  ------------------
  |  Branch (696:9): [True: 8.33M, False: 0]
  ------------------
  697|  8.33M|        const BYTE* const matchPtr = prefixPtr + (pos - prefixIdx);
  698|  8.33M|        assert(matchPtr < ip);
  ------------------
  |  Branch (698:9): [True: 0, False: 8.33M]
  |  Branch (698:9): [True: 8.33M, False: 0]
  ------------------
  699|  8.33M|        return LZ4_count(ip, matchPtr, matchlimit);
  700|  8.33M|    }
  701|      0|    if (pos >= dictIdx) {
  ------------------
  |  Branch (701:9): [True: 0, False: 0]
  ------------------
  702|       |        /* extDict : the match stops at the end of the dictionary */
  703|      0|        const BYTE* const matchPtr = dictStart + (pos - dictIdx);
  704|      0|        size_t const safeLen = MIN(prefixIdx - pos, (size_t)(matchlimit - ip));
  ------------------
  |  |   91|      0|#define MIN(a,b)   ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  705|      0|        return LZ4_count(ip, matchPtr, ip + safeLen);
  706|      0|    }
  707|      0|    return 0;
  708|      0|}
lz4hc.c:LZ4MID_hash4Ptr:
  160|  10.3M|static U32 LZ4MID_hash4Ptr(const void* ptr) { return LZ4MID_hash4(LZ4_read32(ptr)); }
lz4hc.c:LZ4MID_hash4:
  159|  10.3M|static U32 LZ4MID_hash4(U32 v) { return (v * 2654435761U) >> (32-LZ4MID_HASHLOG); }
  ------------------
  |  |  156|  10.3M|#define LZ4MID_HASHLOG (LZ4HC_HASH_LOG-1)
  |  |  ------------------
  |  |  |  |  238|  10.3M|#define LZ4HC_HASH_LOG 15
  |  |  ------------------
  ------------------
lz4hc.c:LZ4HC_encodeSequence:
  314|  3.97M|{
  315|  3.97M|#define ip      (*_ip)
  316|  3.97M|#define op      (*_op)
  317|  3.97M|#define anchor  (*_anchor)
  318|       |
  319|  3.97M|    BYTE* const token = op++;
  ------------------
  |  |  316|  3.97M|#define op      (*_op)
  ------------------
  320|       |
  321|       |#if defined(LZ4_DEBUG) && (LZ4_DEBUG >= 6)
  322|       |    static const BYTE* start = NULL;
  323|       |    static U32 totalCost = 0;
  324|       |    U32 const pos = (start==NULL) ? 0 : (U32)(anchor - start); /* only works for single segment */
  325|       |    U32 const ll = (U32)(ip - anchor);
  326|       |    U32 const llAdd = (ll>=15) ? ((ll-15) / 255) + 1 : 0;
  327|       |    U32 const mlAdd = (matchLength>=19) ? ((matchLength-19) / 255) + 1 : 0;
  328|       |    U32 const cost = 1 + llAdd + ll + 2 + mlAdd;
  329|       |    if (start==NULL) start = anchor;  /* only works for single segment */
  330|       |    DEBUGLOG(6, "pos:%7u -- literals:%4u, match:%4i, offset:%5i, cost:%4u + %5u",
  331|       |                pos,
  332|       |                (U32)(ip - anchor), matchLength, offset,
  333|       |                cost, totalCost);
  334|       |# if 1 /* only works on single segment data */
  335|       |    HEX_CMP(7, ip, ip-offset, matchLength);
  336|       |# endif
  337|       |    totalCost += cost;
  338|       |#endif
  339|       |
  340|       |    /* Encode Literal length */
  341|  3.97M|    {   size_t litLen = (size_t)(ip - anchor);
  ------------------
  |  |  315|  3.97M|#define ip      (*_ip)
  ------------------
                  {   size_t litLen = (size_t)(ip - anchor);
  ------------------
  |  |  317|  3.97M|#define anchor  (*_anchor)
  ------------------
  342|  3.97M|        LZ4_STATIC_ASSERT(notLimited == 0);
  ------------------
  |  |  276|  3.97M|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
  343|       |        /* Check output limit : compares sizes, as op + size could exceed the address space (32-bit).
  344|       |         * Signed : in fillOutput mode, oend precedes op when dst is too small for any sequence */
  345|  3.97M|        if (limit && (oend - op < (ptrdiff_t)((litLen / 255) + litLen + (2 + 1 + LASTLITERALS)))) {
  ------------------
  |  |  316|  3.97M|#define op      (*_op)
  ------------------
                      if (limit && (oend - op < (ptrdiff_t)((litLen / 255) + litLen + (2 + 1 + LASTLITERALS)))) {
  ------------------
  |  |  244|  3.97M|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (345:13): [True: 3.97M, False: 1.64k]
  |  Branch (345:22): [True: 6.33k, False: 3.96M]
  ------------------
  346|  6.33k|            DEBUGLOG(6, "Not enough room to write %i literals (%i bytes remaining)",
  ------------------
  |  |  288|  6.33k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  347|  6.33k|                    (int)litLen, (int)(oend - op));
  348|  6.33k|            op = token;
  ------------------
  |  |  316|  6.33k|#define op      (*_op)
  ------------------
  349|  6.33k|            return 1;
  350|  6.33k|        }
  351|  3.96M|        if (litLen >= RUN_MASK) {
  ------------------
  |  |  262|  3.96M|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  3.96M|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  3.96M|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (351:13): [True: 297k, False: 3.66M]
  ------------------
  352|   297k|            size_t len = litLen - RUN_MASK;
  ------------------
  |  |  262|   297k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|   297k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|   297k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|   297k|            *token = (RUN_MASK << ML_BITS);
  ------------------
  |  |  262|   297k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|   297k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|   297k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          *token = (RUN_MASK << ML_BITS);
  ------------------
  |  |  259|   297k|#define ML_BITS  4
  ------------------
  354|   526k|            for(; len >= 255 ; len -= 255) *op++ = 255;
  ------------------
  |  |  316|   228k|#define op      (*_op)
  ------------------
  |  Branch (354:19): [True: 228k, False: 297k]
  ------------------
  355|   297k|            *op++ = (BYTE)len;
  ------------------
  |  |  316|   297k|#define op      (*_op)
  ------------------
  356|  3.66M|        } else {
  357|  3.66M|            *token = (BYTE)(litLen << ML_BITS);
  ------------------
  |  |  259|  3.66M|#define ML_BITS  4
  ------------------
  358|  3.66M|        }
  359|       |
  360|       |        /* Copy Literals */
  361|  3.96M|        LZ4_wildCopy8(op, anchor, op + litLen);
  ------------------
  |  |  316|  3.96M|#define op      (*_op)
  ------------------
                      LZ4_wildCopy8(op, anchor, op + litLen);
  ------------------
  |  |  317|  3.96M|#define anchor  (*_anchor)
  ------------------
                      LZ4_wildCopy8(op, anchor, op + litLen);
  ------------------
  |  |  316|  3.96M|#define op      (*_op)
  ------------------
  362|  3.96M|        op += litLen;
  ------------------
  |  |  316|  3.96M|#define op      (*_op)
  ------------------
  363|  3.96M|    }
  364|       |
  365|       |    /* Encode Offset */
  366|  3.96M|    assert(offset <= LZ4_DISTANCE_MAX );
  ------------------
  |  Branch (366:5): [True: 0, False: 3.96M]
  |  Branch (366:5): [True: 3.96M, False: 0]
  ------------------
  367|  3.96M|    assert(offset > 0);
  ------------------
  |  Branch (367:5): [True: 0, False: 3.96M]
  |  Branch (367:5): [True: 3.96M, False: 0]
  ------------------
  368|  3.96M|    LZ4_writeLE16(op, (U16)(offset)); op += 2;
  ------------------
  |  |  316|  3.96M|#define op      (*_op)
  ------------------
                  LZ4_writeLE16(op, (U16)(offset)); op += 2;
  ------------------
  |  |  316|  3.96M|#define op      (*_op)
  ------------------
  369|       |
  370|       |    /* Encode MatchLength */
  371|  3.96M|    assert(matchLength >= MINMATCH);
  ------------------
  |  Branch (371:5): [True: 0, False: 3.96M]
  |  Branch (371:5): [True: 3.96M, False: 0]
  ------------------
  372|  3.96M|    {   size_t mlCode = (size_t)matchLength - MINMATCH;
  ------------------
  |  |  241|  3.96M|#define MINMATCH 4
  ------------------
  373|  3.96M|        if (limit && (oend - op < (ptrdiff_t)((mlCode / 255) + (1 + LASTLITERALS)))) {
  ------------------
  |  |  316|  3.96M|#define op      (*_op)
  ------------------
                      if (limit && (oend - op < (ptrdiff_t)((mlCode / 255) + (1 + LASTLITERALS)))) {
  ------------------
  |  |  244|  3.96M|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (373:13): [True: 3.96M, False: 1.64k]
  |  Branch (373:22): [True: 161, False: 3.96M]
  ------------------
  374|    161|            DEBUGLOG(6, "Not enough room to write match length");
  ------------------
  |  |  288|    161|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  375|    161|            op = token;
  ------------------
  |  |  316|    161|#define op      (*_op)
  ------------------
  376|    161|            return 1;
  377|    161|        }
  378|  3.96M|        if (mlCode >= ML_MASK) {
  ------------------
  |  |  260|  3.96M|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  3.96M|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (378:13): [True: 846k, False: 3.12M]
  ------------------
  379|   846k|            *token += ML_MASK;
  ------------------
  |  |  260|   846k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|   846k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  380|   846k|            mlCode -= ML_MASK;
  ------------------
  |  |  260|   846k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|   846k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  381|  1.45M|            for(; mlCode >= 510 ; mlCode -= 510) { *op++ = 255; *op++ = 255; }
  ------------------
  |  |  316|   607k|#define op      (*_op)
  ------------------
                          for(; mlCode >= 510 ; mlCode -= 510) { *op++ = 255; *op++ = 255; }
  ------------------
  |  |  316|   607k|#define op      (*_op)
  ------------------
  |  Branch (381:19): [True: 607k, False: 846k]
  ------------------
  382|   846k|            if (mlCode >= 255) { mlCode -= 255; *op++ = 255; }
  ------------------
  |  |  316|  46.4k|#define op      (*_op)
  ------------------
  |  Branch (382:17): [True: 46.4k, False: 799k]
  ------------------
  383|   846k|            *op++ = (BYTE)mlCode;
  ------------------
  |  |  316|   846k|#define op      (*_op)
  ------------------
  384|  3.12M|        } else {
  385|  3.12M|            *token += (BYTE)(mlCode);
  386|  3.12M|    }   }
  387|       |
  388|       |    /* Prepare next loop */
  389|  3.96M|    ip += matchLength;
  ------------------
  |  |  315|  3.96M|#define ip      (*_ip)
  ------------------
  390|  3.96M|    anchor = ip;
  ------------------
  |  |  317|  3.96M|#define anchor  (*_anchor)
  ------------------
                  anchor = ip;
  ------------------
  |  |  315|  3.96M|#define ip      (*_ip)
  ------------------
  391|       |
  392|  3.96M|    return 0;
  393|       |
  394|  3.96M|#undef ip
  395|  3.96M|#undef op
  396|  3.96M|#undef anchor
  397|  3.96M|}
lz4hc.c:LZ4HC_encodeLastSequence_fillOutput:
  463|  3.95k|{
  464|  3.95k|#define ip      (*_ip)
  465|  3.95k|#define op      (*_op)
  466|  3.95k|#define anchor  (*_anchor)
  467|       |
  468|  3.95k|    BYTE* const dstEnd = oend + LASTLITERALS;
  ------------------
  |  |  244|  3.95k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  469|  3.95k|    size_t const ll = (size_t)(ip - anchor);
  ------------------
  |  |  464|  3.95k|#define ip      (*_ip)
  ------------------
                  size_t const ll = (size_t)(ip - anchor);
  ------------------
  |  |  466|  3.95k|#define anchor  (*_anchor)
  ------------------
  470|  3.95k|    size_t const ll_addbytes = (ll + 240) / 255;
  471|  3.95k|    size_t const ll_totalCost = 1 + ll_addbytes + ll;
  472|  3.95k|    BYTE* const maxLitPos = oend - 3; /* 2 for offset, 1 for token */
  473|  3.95k|    DEBUGLOG(6, "Last sequence is overflowing : %u literals, %u remaining space",
  ------------------
  |  |  288|  3.95k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  474|  3.95k|                (unsigned)ll, (unsigned)(oend - op));
  475|  3.95k|    if ((op <= maxLitPos) && (ll_totalCost <= (size_t)(maxLitPos - op))) {   /* compares sizes, as op + ll_totalCost could exceed the address space */
  ------------------
  |  |  465|  3.95k|#define op      (*_op)
  ------------------
                  if ((op <= maxLitPos) && (ll_totalCost <= (size_t)(maxLitPos - op))) {   /* compares sizes, as op + ll_totalCost could exceed the address space */
  ------------------
  |  |  465|  3.10k|#define op      (*_op)
  ------------------
  |  Branch (475:9): [True: 3.10k, False: 853]
  |  Branch (475:30): [True: 2.20k, False: 901]
  ------------------
  476|       |        /* ll validated; now adjust match length */
  477|  2.20k|        size_t const bytesLeftForMl = (size_t)(maxLitPos - (op+ll_totalCost));
  ------------------
  |  |  465|  2.20k|#define op      (*_op)
  ------------------
  478|  2.20k|        size_t const maxMlSize = MINMATCH + (ML_MASK-1) + (bytesLeftForMl * 255);
  ------------------
  |  |  241|  2.20k|#define MINMATCH 4
  ------------------
                      size_t const maxMlSize = MINMATCH + (ML_MASK-1) + (bytesLeftForMl * 255);
  ------------------
  |  |  260|  2.20k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|  2.20k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  479|  2.20k|        assert(maxMlSize < INT_MAX); assert(matchLength >= 0);
  ------------------
  |  Branch (479:9): [True: 0, False: 2.20k]
  |  Branch (479:9): [True: 2.20k, False: 0]
  |  Branch (479:38): [True: 0, False: 2.20k]
  |  Branch (479:38): [True: 2.20k, False: 0]
  ------------------
  480|  2.20k|        if ((size_t)matchLength > maxMlSize) matchLength = (int)maxMlSize;
  ------------------
  |  Branch (480:13): [True: 43, False: 2.15k]
  ------------------
  481|  2.20k|        if (dstEnd - (op + ll_totalCost + 2) - 1 + matchLength >= MFLIMIT) {
  ------------------
  |  |  465|  2.20k|#define op      (*_op)
  ------------------
                      if (dstEnd - (op + ll_totalCost + 2) - 1 + matchLength >= MFLIMIT) {
  ------------------
  |  |  245|  2.20k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (481:13): [True: 1.64k, False: 558]
  ------------------
  482|  1.64k|            DEBUGLOG(6, "Let's encode a last sequence (ll=%u, ml=%i)", (unsigned)ll, matchLength);
  ------------------
  |  |  288|  1.64k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  483|  1.64k|            LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), matchLength, offset, notLimited, oend);
  ------------------
  |  |  244|  1.64k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  484|  1.64k|    }   }
  485|       |
  486|  3.95k|#undef ip
  487|  3.95k|#undef op
  488|  3.95k|#undef anchor
  489|  3.95k|}
lz4hc.c:LZ4HC_encodeLastLiterals:
  412|  15.0k|{
  413|  15.0k|#define ip      (*_ip)
  414|  15.0k|#define op      (*_op)
  415|  15.0k|#define anchor  (*_anchor)
  416|       |
  417|  15.0k|    BYTE* const dstEnd = (limit == fillOutput) ? oend + LASTLITERALS : oend;
  ------------------
  |  |  244|  8.79k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (417:26): [True: 8.79k, False: 6.25k]
  ------------------
  418|  15.0k|    size_t lastRunSize = (size_t)(iend - anchor);  /* literals */
  ------------------
  |  |  415|  15.0k|#define anchor  (*_anchor)
  ------------------
  419|  15.0k|    size_t llAdd = (lastRunSize + 255 - RUN_MASK) / 255;
  ------------------
  |  |  262|  15.0k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  15.0k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  15.0k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  420|  15.0k|    size_t const totalSize = 1 + llAdd + lastRunSize;
  421|  15.0k|    assert(!limit || op <= dstEnd);
  ------------------
  |  Branch (421:5): [True: 15.0k, False: 0]
  |  Branch (421:5): [True: 0, False: 0]
  |  Branch (421:5): [True: 0, False: 15.0k]
  |  Branch (421:5): [True: 15.0k, False: 0]
  ------------------
  422|  15.0k|    if (limit && ((size_t)(dstEnd - op) < totalSize)) {   /* compares sizes, as op + totalSize could exceed the address space */
  ------------------
  |  |  414|  15.0k|#define op      (*_op)
  ------------------
  |  Branch (422:9): [True: 15.0k, False: 0]
  |  Branch (422:18): [True: 5.58k, False: 9.46k]
  ------------------
  423|  5.58k|        if (limit == limitedOutput) return 1;  /* not enough space in dst */
  ------------------
  |  Branch (423:13): [True: 1.49k, False: 4.08k]
  ------------------
  424|       |        /* adapt lastRunSize to fill dst */
  425|  4.08k|        lastRunSize  = (size_t)(dstEnd - op) - 1 /*token*/;
  ------------------
  |  |  414|  4.08k|#define op      (*_op)
  ------------------
  426|  4.08k|        llAdd = (lastRunSize + 256 - RUN_MASK) / 256;
  ------------------
  |  |  262|  4.08k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  4.08k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  4.08k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|  4.08k|        lastRunSize -= llAdd;
  428|  4.08k|    }
  429|  13.5k|    DEBUGLOG(6, "Final literal run : %i literals", (int)lastRunSize);
  ------------------
  |  |  288|  13.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  430|  13.5k|    ip = anchor + lastRunSize;  /* can be != iend if limit==fillOutput */
  ------------------
  |  |  413|  13.5k|#define ip      (*_ip)
  ------------------
                  ip = anchor + lastRunSize;  /* can be != iend if limit==fillOutput */
  ------------------
  |  |  415|  13.5k|#define anchor  (*_anchor)
  ------------------
  431|       |
  432|  13.5k|    if (lastRunSize >= RUN_MASK) {
  ------------------
  |  |  262|  13.5k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  13.5k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  13.5k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (432:9): [True: 1.03k, False: 12.5k]
  ------------------
  433|  1.03k|        size_t accumulator = lastRunSize - RUN_MASK;
  ------------------
  |  |  262|  1.03k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  1.03k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  1.03k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|  1.03k|        *op++ = (RUN_MASK << ML_BITS);
  ------------------
  |  |  414|  1.03k|#define op      (*_op)
  ------------------
                      *op++ = (RUN_MASK << ML_BITS);
  ------------------
  |  |  262|  1.03k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  1.03k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  1.03k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      *op++ = (RUN_MASK << ML_BITS);
  ------------------
  |  |  259|  1.03k|#define ML_BITS  4
  ------------------
  435|  60.8k|        for(; accumulator >= 255 ; accumulator -= 255) *op++ = 255;
  ------------------
  |  |  414|  59.7k|#define op      (*_op)
  ------------------
  |  Branch (435:15): [True: 59.7k, False: 1.03k]
  ------------------
  436|  1.03k|        *op++ = (BYTE) accumulator;
  ------------------
  |  |  414|  1.03k|#define op      (*_op)
  ------------------
  437|  12.5k|    } else {
  438|  12.5k|        *op++ = (BYTE)(lastRunSize << ML_BITS);
  ------------------
  |  |  414|  12.5k|#define op      (*_op)
  ------------------
                      *op++ = (BYTE)(lastRunSize << ML_BITS);
  ------------------
  |  |  259|  12.5k|#define ML_BITS  4
  ------------------
  439|  12.5k|    }
  440|  13.5k|    assert(lastRunSize <= (size_t)(dstEnd - op));
  ------------------
  |  Branch (440:5): [True: 0, False: 13.5k]
  |  Branch (440:5): [True: 13.5k, False: 0]
  ------------------
  441|  13.5k|    LZ4_memcpy(op, anchor, lastRunSize);
  ------------------
  |  |  348|  13.5k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  442|  13.5k|    op += lastRunSize;
  ------------------
  |  |  414|  13.5k|#define op      (*_op)
  ------------------
  443|  13.5k|    return 0;
  444|       |
  445|  13.5k|#undef ip
  446|  13.5k|#undef op
  447|  13.5k|#undef anchor
  448|  13.5k|}
lz4hc.c:LZ4HC_compress_hashChain:
 1277|  7.69k|{
 1278|  7.69k|    const int inputSize = *srcSizePtr;
 1279|  7.69k|    const int patternAnalysis = (maxNbAttempts > 128);   /* levels 9+ */
 1280|       |
 1281|  7.69k|    const BYTE* ip = (const BYTE*)src;
 1282|  7.69k|    const BYTE* anchor = ip;
 1283|  7.69k|    const BYTE* const iend = ip + inputSize;
 1284|  7.69k|    const BYTE* mflimit;      /* set after the size check : would precede a small input */
 1285|  7.69k|    const BYTE* matchlimit;
 1286|       |
 1287|  7.69k|    BYTE* op = (BYTE*) dst;
 1288|       |    /* fillOutput : keep room for the final run of literals (LZ4 format restriction) */
 1289|  7.69k|    BYTE* const oend = op + maxOutputSize - ((limit == fillOutput) ? LASTLITERALS : 0);
  ------------------
  |  |  244|  3.84k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (1289:46): [True: 3.84k, False: 3.84k]
  ------------------
 1290|       |
 1291|  7.69k|    const BYTE* start0;
 1292|  7.69k|    const BYTE* start2 = NULL;
 1293|  7.69k|    const BYTE* start3 = NULL;
 1294|  7.69k|    LZ4HC_match_t m0, m1, m2, m3;
 1295|  7.69k|    const LZ4HC_match_t nomatch = {0, 0, 0};
 1296|       |
 1297|       |    /* init */
 1298|  7.69k|    DEBUGLOG(5, "LZ4HC_compress_hashChain (dict?=>%i)", dict);
  ------------------
  |  |  288|  7.69k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1299|       |
 1300|       |    /* preconditions verifications */
 1301|  7.69k|    assert(*srcSizePtr >= 1);
  ------------------
  |  Branch (1301:5): [True: 0, False: 7.69k]
  |  Branch (1301:5): [True: 7.69k, False: 0]
  ------------------
 1302|  7.69k|    assert(src != NULL);
  ------------------
  |  Branch (1302:5): [True: 0, False: 7.69k]
  |  Branch (1302:5): [True: 7.69k, False: 0]
  ------------------
 1303|  7.69k|    assert(maxOutputSize >= 1);
  ------------------
  |  Branch (1303:5): [True: 0, False: 7.69k]
  |  Branch (1303:5): [True: 7.69k, False: 0]
  ------------------
 1304|  7.69k|    assert(dst != NULL);
  ------------------
  |  Branch (1304:5): [True: 0, False: 7.69k]
  |  Branch (1304:5): [True: 7.69k, False: 0]
  ------------------
 1305|       |
 1306|  7.69k|    *srcSizePtr = 0;
 1307|  7.69k|    if (inputSize < LZ4_minLength) goto _last_literals;             /* Input too small, no compression (all literals) */
  ------------------
  |  Branch (1307:9): [True: 32, False: 7.66k]
  ------------------
 1308|  7.66k|    mflimit = iend - MFLIMIT;
  ------------------
  |  |  245|  7.66k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 1309|  7.66k|    matchlimit = (iend - LASTLITERALS);
  ------------------
  |  |  244|  7.66k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 1310|       |
 1311|       |    /* Main Loop */
 1312|  49.2M|    while (ip <= mflimit) {
  ------------------
  |  Branch (1312:12): [True: 49.2M, False: 4.66k]
  ------------------
 1313|  49.2M|        m1 = LZ4HC_InsertAndFindBestMatch(ctx, ip, matchlimit, maxNbAttempts, patternAnalysis, dict);
 1314|  49.2M|        if (m1.len<MINMATCH) { ip++; continue; }
  ------------------
  |  |  241|  49.2M|#define MINMATCH 4
  ------------------
  |  Branch (1314:13): [True: 47.4M, False: 1.81M]
  ------------------
 1315|       |
 1316|       |        /* saved, in case we would skip too much */
 1317|  1.81M|        start0 = ip; m0 = m1;
 1318|       |
 1319|  2.34M|_Search2:
 1320|       |        /* m1 (at ip) is the next match to encode, m0 (at start0 <= ip) its fallback.
 1321|       |         * Search a longer match m2, starting before the end of m1. */
 1322|  2.34M|        DEBUGLOG(7, "_Search2 (currently found match of size %i)", m1.len);
  ------------------
  |  |  288|  2.34M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1323|  2.34M|        if (ip+m1.len <= mflimit) {
  ------------------
  |  Branch (1323:13): [True: 2.34M, False: 3.79k]
  ------------------
 1324|  2.34M|            start2 = ip + m1.len - 2;
 1325|  2.34M|            m2 = LZ4HC_InsertAndGetWiderMatch(ctx,
 1326|  2.34M|                            start2, ip + 0, matchlimit, m1.len,
 1327|  2.34M|                            maxNbAttempts, patternAnalysis, 0, dict, favorCompressionRatio);
 1328|  2.34M|            start2 += m2.back;
 1329|  2.34M|        } else {
 1330|  3.79k|            m2 = nomatch;  /* do not search further */
 1331|  3.79k|        }
 1332|       |
 1333|  2.34M|        if (m2.len <= m1.len) { /* No better match => encode m1 immediately */
  ------------------
  |  Branch (1333:13): [True: 1.67M, False: 673k]
  ------------------
 1334|  1.67M|            if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor),
  ------------------
  |  |  244|  1.67M|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (1334:17): [True: 2.07k, False: 1.67M]
  ------------------
 1335|  1.67M|                    m1.len, m1.off,
 1336|  1.67M|                    limit, oend) )
 1337|  2.07k|                goto _dest_overflow;
 1338|  1.67M|            continue;
 1339|  1.67M|        }
 1340|       |
 1341|   673k|        if ((start0 < ip) && (start2 < ip + m0.len)) {
  ------------------
  |  Branch (1341:13): [True: 80.3k, False: 593k]
  |  Branch (1341:30): [True: 52.6k, False: 27.7k]
  ------------------
 1342|       |            /* m1 was skipped at least once, and m2 starts early enough : restore m0 */
 1343|  52.6k|            ip = start0; m1 = m0;
 1344|  52.6k|        }
 1345|       |
 1346|   673k|        if ((start2 - ip) < 3) {  /* m1 too short before m2 : removed */
  ------------------
  |  Branch (1346:13): [True: 444k, False: 228k]
  ------------------
 1347|   444k|            ip = start2;
 1348|   444k|            m1 = m2;
 1349|   444k|            goto _Search2;
 1350|   444k|        }
 1351|       |
 1352|       |        /* m2 (at start2) is the candidate after m1.
 1353|       |         * Search a longer match m3, starting before the end of m2. */
 1354|   347k|        while (1) {
  ------------------
  |  Branch (1354:16): [True: 347k, Folded]
  ------------------
 1355|       |            /* m1 will be cut where m2 starts, but keeps up to OPTIMAL_ML bytes (no extra length byte) :
 1356|       |             * m2 is shifted after them, as long as it keeps at least MINMATCH bytes. */
 1357|   347k|            if ((start2 - ip) < OPTIMAL_ML) {
  ------------------
  |  |   85|   347k|#define OPTIMAL_ML (int)((ML_MASK-1)+MINMATCH)
  |  |  ------------------
  |  |  |  |  260|   347k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|   347k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define OPTIMAL_ML (int)((ML_MASK-1)+MINMATCH)
  |  |  ------------------
  |  |  |  |  241|   347k|#define MINMATCH 4
  |  |  ------------------
  ------------------
  |  Branch (1357:17): [True: 292k, False: 55.0k]
  ------------------
 1358|   292k|                int const gap = (int)(start2 - ip);
 1359|   292k|                int newML = MIN(m1.len, OPTIMAL_ML);
  ------------------
  |  |   91|   292k|#define MIN(a,b)   ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 218k, False: 73.4k]
  |  |  ------------------
  ------------------
 1360|   292k|                if (newML > gap + m2.len - MINMATCH)
  ------------------
  |  |  241|   292k|#define MINMATCH 4
  ------------------
  |  Branch (1360:21): [True: 374, False: 292k]
  ------------------
 1361|    374|                    newML = gap + m2.len - MINMATCH;
  ------------------
  |  |  241|    374|#define MINMATCH 4
  ------------------
 1362|   292k|                if (newML > gap) {   /* shift m2 */
  ------------------
  |  Branch (1362:21): [True: 274k, False: 17.5k]
  ------------------
 1363|   274k|                    start2 += newML - gap;
 1364|   274k|                    m2.len -= newML - gap;
 1365|   274k|                }
 1366|   292k|            }
 1367|       |
 1368|   347k|            if (start2 + m2.len <= mflimit) {
  ------------------
  |  Branch (1368:17): [True: 346k, False: 699]
  ------------------
 1369|   346k|                start3 = start2 + m2.len - 3;
 1370|   346k|                m3 = LZ4HC_InsertAndGetWiderMatch(ctx,
 1371|   346k|                                start3, start2, matchlimit, m2.len,
 1372|   346k|                                maxNbAttempts, patternAnalysis, 0, dict, favorCompressionRatio);
 1373|   346k|                start3 += m3.back;
 1374|   346k|            } else {
 1375|    699|                m3 = nomatch;  /* do not search further */
 1376|    699|            }
 1377|       |
 1378|   347k|            if ((m3.len > m2.len) && (start3 < ip+m1.len+3)) {  /* not enough room for m2 between m1 and m3 */
  ------------------
  |  Branch (1378:17): [True: 211k, False: 135k]
  |  Branch (1378:38): [True: 101k, False: 109k]
  ------------------
 1379|   101k|                if (start3 >= (ip+m1.len)) {
  ------------------
  |  Branch (1379:21): [True: 92.7k, False: 8.83k]
  ------------------
 1380|       |                    /* m3 starts after m1 : encode m1, then m3 becomes m1,
 1381|       |                     * and m2, moved after m1 if needed (replaced by m3 if too short), becomes the fallback m0 */
 1382|  92.7k|                    if (start2 < ip+m1.len) {
  ------------------
  |  Branch (1382:25): [True: 6.19k, False: 86.5k]
  ------------------
 1383|  6.19k|                        int correction = (int)(ip+m1.len - start2);
 1384|  6.19k|                        start2 += correction;
 1385|  6.19k|                        m2.len -= correction;
 1386|  6.19k|                        if (m2.len < MINMATCH) {
  ------------------
  |  |  241|  6.19k|#define MINMATCH 4
  ------------------
  |  Branch (1386:29): [True: 256, False: 5.94k]
  ------------------
 1387|    256|                            start2 = start3;
 1388|    256|                            m2 = m3;
 1389|    256|                        }
 1390|  6.19k|                    }
 1391|       |
 1392|  92.7k|                    if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor),
  ------------------
  |  |  244|  92.7k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (1392:25): [True: 354, False: 92.3k]
  ------------------
 1393|  92.7k|                            m1.len, m1.off,
 1394|  92.7k|                            limit, oend) )
 1395|    354|                        goto _dest_overflow;
 1396|  92.3k|                    ip  = start3;
 1397|  92.3k|                    m1 = m3;
 1398|       |
 1399|  92.3k|                    start0 = start2;
 1400|  92.3k|                    m0 = m2;
 1401|  92.3k|                    goto _Search2;
 1402|  92.7k|                }
 1403|       |
 1404|       |                /* m3 starts within m1 : m3 replaces m2 */
 1405|  8.83k|                start2 = start3;
 1406|  8.83k|                m2 = m3;
 1407|  8.83k|                continue;
 1408|   101k|            }
 1409|       |
 1410|       |            /* encode m1, cut where m2 starts */
 1411|   245k|            if (start2 < ip+m1.len) m1.len = (int)(start2 - ip);
  ------------------
  |  Branch (1411:17): [True: 103k, False: 142k]
  ------------------
 1412|   245k|            if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor),
  ------------------
  |  |  244|   245k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (1412:17): [True: 439, False: 245k]
  ------------------
 1413|   245k|                    m1.len, m1.off,
 1414|   245k|                    limit, oend) )
 1415|    439|                goto _dest_overflow;
 1416|       |
 1417|       |            /* m2 becomes m1 */
 1418|   245k|            ip = start2; m1 = m2;
 1419|       |
 1420|   245k|            if (m3.len <= m1.len) {  /* No better match => encode m1 (former m2) */
  ------------------
  |  Branch (1420:17): [True: 135k, False: 109k]
  ------------------
 1421|   135k|                if (LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor),
  ------------------
  |  |  244|   135k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (1421:21): [True: 128, False: 135k]
  ------------------
 1422|   135k|                        m1.len, m1.off,
 1423|   135k|                        limit, oend) )
 1424|    128|                    goto _dest_overflow;
 1425|   135k|                break;
 1426|   135k|            }
 1427|       |
 1428|       |            /* m3 becomes m2 */
 1429|   109k|            start2 = start3; m2 = m3;
 1430|   109k|        }
 1431|   228k|    }
 1432|       |
 1433|  6.47k|_last_literals:
 1434|  6.47k|    if (LZ4HC_encodeLastLiterals(UPDATABLE(ip, op, anchor), iend, limit, oend))
  ------------------
  |  |  244|  6.47k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (1434:9): [True: 569, False: 5.90k]
  ------------------
 1435|    569|        return 0;  /* not enough space in @dst */
 1436|       |
 1437|       |    /* End */
 1438|  5.90k|    *srcSizePtr = (int) (((const char*)ip) - src);
 1439|  5.90k|    return (int) (((char*)op)-dst);
 1440|       |
 1441|  2.99k|_dest_overflow:
 1442|  2.99k|    if (limit != fillOutput) return 0;  /* compression failed */
  ------------------
  |  Branch (1442:9): [True: 1.21k, False: 1.77k]
  ------------------
 1443|  1.77k|    LZ4HC_encodeLastSequence_fillOutput(UPDATABLE(ip, op, anchor), m1.len, m1.off, oend);
  ------------------
  |  |  244|  1.77k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
 1444|  1.77k|    goto _last_literals;
 1445|  2.99k|}
lz4hc.c:LZ4HC_InsertAndFindBestMatch:
 1252|  49.2M|{
 1253|  49.2M|    DEBUGLOG(7, "LZ4HC_InsertAndFindBestMatch");
  ------------------
  |  |  288|  49.2M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1254|       |    /* note : LZ4HC_InsertAndGetWiderMatch() is able to modify the starting position of a match (*startpos),
 1255|       |     * but this won't be the case here, as we define iLowLimit==ip,
 1256|       |     * so LZ4HC_InsertAndGetWiderMatch() won't be allowed to search past ip */
 1257|  49.2M|    return LZ4HC_InsertAndGetWiderMatch(hc4, ip, ip, iLimit, MINMATCH-1, maxNbAttempts, patternAnalysis, 0 /*chainSwap*/, dict, favorCompressionRatio);
  ------------------
  |  |  241|  49.2M|#define MINMATCH 4
  ------------------
 1258|  49.2M|}
lz4hc.c:LZ4HC_InsertAndGetWiderMatch:
 1064|   109M|{
 1065|   109M|    U16* const chainTable = hc4->chainTable;
 1066|   109M|    U32* const hashTable = hc4->hashTable;
 1067|   109M|    const LZ4HC_CCtx_internal* const dictCtx = hc4->dictCtx;
 1068|   109M|    const BYTE* const prefixPtr = hc4->prefixStart;
 1069|   109M|    const U32 prefixIdx = hc4->dictLimit;
 1070|   109M|    const U32 ipIndex = (U32)(ip - prefixPtr) + prefixIdx;
 1071|   109M|    const int withinStartDistance = (hc4->lowLimit + (LZ4_DISTANCE_MAX + 1) > ipIndex);
  ------------------
  |  |  745|   109M|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
 1072|   109M|    const U32 lowestMatchIndex = (withinStartDistance) ? hc4->lowLimit : ipIndex - LZ4_DISTANCE_MAX;
  ------------------
  |  |  745|  79.3M|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
  |  Branch (1072:34): [True: 29.9M, False: 79.3M]
  ------------------
 1073|   109M|    const BYTE* const dictStart = hc4->dictStart;
 1074|   109M|    const U32 dictIdx = hc4->lowLimit;
 1075|   109M|    int const lookBackLength = (int)(ip-iLowLimit);
 1076|   109M|    int const maxLength = (int)(iHighLimit-iLowLimit);   /* no match can be longer */
 1077|   109M|    int nbAttempts = maxNbAttempts;
 1078|   109M|    U32 matchChainPos = 0;
 1079|   109M|    U32 const pattern = LZ4_read32(ip);
 1080|   109M|    U32 matchIndex;
 1081|   109M|    repeat_state_e repeat = rep_untested;
 1082|   109M|    size_t srcPatternLength = 0;
 1083|   109M|    int offset = 0, sBack = 0;
 1084|       |
 1085|   109M|    DEBUGLOG(7, "LZ4HC_InsertAndGetWiderMatch");
  ------------------
  |  |  288|   109M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1086|       |    /* First Match */
 1087|   109M|    LZ4HC_Insert(hc4, ip);  /* insert all prior positions up to ip (excluded) */
 1088|   109M|    matchIndex = hashTable[LZ4HC_hashPtr(ip)];
 1089|   109M|    DEBUGLOG(7, "First candidate match for pos %u found at index %u / %u (lowestMatchIndex)",
  ------------------
  |  |  288|   109M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1090|   109M|                ipIndex, matchIndex, lowestMatchIndex);
 1091|       |
 1092|       |    /* Candidates only replace the current match if strictly longer,
 1093|       |     * so stopping once @longest reaches @maxLength doesn't change the result. */
 1094|   956M|    while ((matchIndex>=lowestMatchIndex) && (nbAttempts>0) && (longest<maxLength)) {
  ------------------
  |  Branch (1094:12): [True: 849M, False: 107M]
  |  Branch (1094:46): [True: 847M, False: 2.21M]
  |  Branch (1094:64): [True: 847M, False: 3.28k]
  ------------------
 1095|   847M|        int matchLength=0;
 1096|   847M|        nbAttempts--;
 1097|   847M|        assert(matchIndex < ipIndex);
  ------------------
  |  Branch (1097:9): [True: 0, False: 847M]
  |  Branch (1097:9): [True: 847M, False: 0]
  ------------------
 1098|   847M|        if (favorDecSpeed && (ipIndex - matchIndex < 8)) {
  ------------------
  |  Branch (1098:13): [True: 0, False: 847M]
  |  Branch (1098:30): [True: 0, False: 0]
  ------------------
 1099|       |            /* do nothing:
 1100|       |             * favorDecSpeed intentionally skips matches with offset < 8 */
 1101|   847M|        } else if (matchIndex >= prefixIdx) {   /* within current Prefix */
  ------------------
  |  Branch (1101:20): [True: 847M, False: 0]
  ------------------
 1102|   847M|            const BYTE* const matchPtr = prefixPtr + (matchIndex - prefixIdx);
 1103|   847M|            assert(matchPtr < ip);
  ------------------
  |  Branch (1103:13): [True: 0, False: 847M]
  |  Branch (1103:13): [True: 847M, False: 0]
  ------------------
 1104|   847M|            assert(longest >= 1);
  ------------------
  |  Branch (1104:13): [True: 0, False: 847M]
  |  Branch (1104:13): [True: 847M, False: 0]
  ------------------
 1105|   847M|            if (LZ4_read16(iLowLimit + longest - 1) == LZ4_read16(matchPtr - lookBackLength + longest - 1)) {
  ------------------
  |  Branch (1105:17): [True: 119M, False: 727M]
  ------------------
 1106|   119M|                if (LZ4_read32(matchPtr) == pattern) {
  ------------------
  |  Branch (1106:21): [True: 97.2M, False: 22.7M]
  ------------------
 1107|  97.2M|                    int const back = lookBackLength ? LZ4HC_countBack(ip, matchPtr, iLowLimit, prefixPtr) : 0;
  ------------------
  |  Branch (1107:38): [True: 58.9M, False: 38.3M]
  ------------------
 1108|  97.2M|                    matchLength = MINMATCH + (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, iHighLimit);
  ------------------
  |  |  241|  97.2M|#define MINMATCH 4
  ------------------
                                  matchLength = MINMATCH + (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, iHighLimit);
  ------------------
  |  |  241|  97.2M|#define MINMATCH 4
  ------------------
                                  matchLength = MINMATCH + (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, iHighLimit);
  ------------------
  |  |  241|  97.2M|#define MINMATCH 4
  ------------------
 1109|  97.2M|                    matchLength -= back;
 1110|  97.2M|                    if (matchLength > longest) {
  ------------------
  |  Branch (1110:25): [True: 8.95M, False: 88.2M]
  ------------------
 1111|  8.95M|                        longest = matchLength;
 1112|  8.95M|                        offset = (int)(ipIndex - matchIndex);
 1113|  8.95M|                        sBack = back;
 1114|  8.95M|                        DEBUGLOG(7, "Found match of len=%i within prefix, offset=%i, back=%i", longest, offset, -back);
  ------------------
  |  |  288|  8.95M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1115|  8.95M|                        HEX_CMP(7, ip + back, ip + back - offset, (size_t)matchLength);
 1116|  8.95M|            }   }   }
 1117|   847M|        } else {   /* lowestMatchIndex <= matchIndex < dictLimit : within Ext Dict */
 1118|      0|            const BYTE* const matchPtr = dictStart + (matchIndex - dictIdx);
 1119|      0|            assert(matchIndex >= dictIdx);
  ------------------
  |  Branch (1119:13): [True: 0, False: 0]
  |  Branch (1119:13): [True: 0, False: 0]
  ------------------
 1120|      0|            if ( likely(matchIndex <= prefixIdx - 4)
  ------------------
  |  |  177|      0|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|      0|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1121|      0|              && (LZ4_read32(matchPtr) == pattern) ) {
  ------------------
  |  Branch (1121:18): [True: 0, False: 0]
  ------------------
 1122|      0|                int back = 0;
 1123|      0|                const BYTE* vLimit = ip + (prefixIdx - matchIndex);
 1124|      0|                if (vLimit > iHighLimit) vLimit = iHighLimit;
  ------------------
  |  Branch (1124:21): [True: 0, False: 0]
  ------------------
 1125|      0|                matchLength = (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, vLimit) + MINMATCH;
  ------------------
  |  |  241|      0|#define MINMATCH 4
  ------------------
                              matchLength = (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, vLimit) + MINMATCH;
  ------------------
  |  |  241|      0|#define MINMATCH 4
  ------------------
                              matchLength = (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, vLimit) + MINMATCH;
  ------------------
  |  |  241|      0|#define MINMATCH 4
  ------------------
 1126|      0|                if ((ip+matchLength == vLimit) && (vLimit < iHighLimit))
  ------------------
  |  Branch (1126:21): [True: 0, False: 0]
  |  Branch (1126:51): [True: 0, False: 0]
  ------------------
 1127|      0|                    matchLength += LZ4_count(ip+matchLength, prefixPtr, iHighLimit);
 1128|      0|                back = lookBackLength ? LZ4HC_countBack(ip, matchPtr, iLowLimit, dictStart) : 0;
  ------------------
  |  Branch (1128:24): [True: 0, False: 0]
  ------------------
 1129|      0|                matchLength -= back;
 1130|      0|                if (matchLength > longest) {
  ------------------
  |  Branch (1130:21): [True: 0, False: 0]
  ------------------
 1131|      0|                    longest = matchLength;
 1132|      0|                    offset = (int)(ipIndex - matchIndex);
 1133|      0|                    sBack = back;
 1134|      0|                    DEBUGLOG(7, "Found match of len=%i within dict, offset=%i, back=%i", longest, offset, -back);
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1135|      0|                    HEX_CMP(7, ip + back, matchPtr + back, (size_t)matchLength);
 1136|      0|        }   }   }
 1137|       |
 1138|   847M|        if (chainSwap && matchLength==longest && matchIndex + (U32)longest <= ipIndex) {   /* better match => select a better chain */
  ------------------
  |  Branch (1138:13): [True: 643M, False: 203M]
  |  Branch (1138:26): [True: 4.57M, False: 639M]
  |  Branch (1138:50): [True: 4.02M, False: 555k]
  ------------------
 1139|  4.02M|            U32 const distanceToNextMatch = LZ4HC_sparsestChain(chainTable, matchIndex, longest, &matchChainPos);
 1140|  4.02M|            assert(lookBackLength==0);   /* search forward only */
  ------------------
  |  Branch (1140:13): [True: 0, False: 4.02M]
  |  Branch (1140:13): [True: 4.02M, False: 0]
  ------------------
 1141|  4.02M|            if (distanceToNextMatch > 1) {
  ------------------
  |  Branch (1141:17): [True: 3.72M, False: 295k]
  ------------------
 1142|  3.72M|                if (distanceToNextMatch > matchIndex) break;   /* avoid overflow */
  ------------------
  |  Branch (1142:21): [True: 0, False: 3.72M]
  ------------------
 1143|  3.72M|                matchIndex -= distanceToNextMatch;
 1144|  3.72M|                continue;
 1145|  3.72M|        }   }
 1146|       |
 1147|   843M|        {   U32 const distNextMatch = DELTANEXTU16(chainTable, matchIndex);
  ------------------
  |  |  242|   843M|#define DELTANEXTU16(table, pos) table[(U16)(pos)]   /* faster */
  ------------------
 1148|   843M|            if (patternAnalysis && distNextMatch==1 && matchChainPos==0) {
  ------------------
  |  Branch (1148:17): [True: 772M, False: 71.0M]
  |  Branch (1148:36): [True: 286M, False: 486M]
  |  Branch (1148:56): [True: 175M, False: 110M]
  ------------------
 1149|   175M|                U32 const matchCandidateIdx = matchIndex-1;
 1150|   175M|                size_t forwardPatternLength, backLength;
 1151|       |                /* may be a repeated pattern */
 1152|   175M|                if (repeat == rep_untested) {
  ------------------
  |  Branch (1152:21): [True: 941k, False: 174M]
  ------------------
 1153|   941k|                    if ( ((pattern & 0xFFFF) == (pattern >> 16))
  ------------------
  |  Branch (1153:26): [True: 920k, False: 21.5k]
  ------------------
 1154|   941k|                      &  ((pattern & 0xFF)   == (pattern >> 24)) ) {
 1155|   920k|                        DEBUGLOG(7, "Repeat pattern detected, char %02X", pattern >> 24);
  ------------------
  |  |  288|   920k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1156|   920k|                        repeat = rep_confirmed;
 1157|   920k|                        srcPatternLength = LZ4HC_countPattern(ip+sizeof(pattern), iHighLimit, pattern) + sizeof(pattern);
 1158|   920k|                    } else {
 1159|  21.5k|                        repeat = rep_not;
 1160|  21.5k|                }   }
 1161|   175M|                if ( (repeat == rep_confirmed) && (matchCandidateIdx >= lowestMatchIndex)
  ------------------
  |  Branch (1161:22): [True: 154M, False: 21.3M]
  |  Branch (1161:51): [True: 154M, False: 3.77k]
  ------------------
 1162|   154M|                  && LZ4HC_protectDictEnd(prefixIdx, matchCandidateIdx)
  ------------------
  |  Branch (1162:22): [True: 154M, False: 0]
  ------------------
 1163|   154M|                  && LZ4HC_patternSegment(hc4, matchCandidateIdx, pattern, iHighLimit, lowestMatchIndex,
  ------------------
  |  Branch (1163:22): [True: 152M, False: 1.47M]
  ------------------
 1164|   154M|                                          &forwardPatternLength, &backLength) ) {
 1165|   152M|                    size_t const currentSegmentLength = backLength + forwardPatternLength;
 1166|       |                    /* if the full source pattern fits (and hasn't been reached yet), jump to its best position :
 1167|       |                     * at the end of the segment, it might be followed by more match.
 1168|       |                     * Otherwise, jump to the farthest position in the segment : the longest match, plus maybe some back */
 1169|   152M|                    int const fullPatternFits = (currentSegmentLength >= srcPatternLength)
  ------------------
  |  Branch (1169:49): [True: 90.5M, False: 62.3M]
  ------------------
 1170|  90.5M|                                             && (forwardPatternLength <= srcPatternLength);
  ------------------
  |  Branch (1170:49): [True: 40.4M, False: 50.0M]
  ------------------
 1171|   152M|                    U32 const newMatchIndex = fullPatternFits ?
  ------------------
  |  Branch (1171:47): [True: 40.4M, False: 112M]
  ------------------
 1172|  40.4M|                                              matchCandidateIdx + (U32)forwardPatternLength - (U32)srcPatternLength :
 1173|   152M|                                              matchCandidateIdx - (U32)backLength;
 1174|   152M|                    if (!LZ4HC_protectDictEnd(prefixIdx, newMatchIndex)) {
  ------------------
  |  Branch (1174:25): [True: 0, False: 152M]
  ------------------
 1175|       |                        /* Can only happen if started in the prefix */
 1176|      0|                        assert(newMatchIndex >= prefixIdx - 3 && newMatchIndex < prefixIdx && matchCandidateIdx >= prefixIdx);
  ------------------
  |  Branch (1176:25): [True: 0, False: 0]
  |  Branch (1176:25): [True: 0, False: 0]
  |  Branch (1176:25): [True: 0, False: 0]
  |  Branch (1176:25): [True: 0, False: 0]
  |  Branch (1176:25): [True: 0, False: 0]
  |  Branch (1176:25): [True: 0, False: 0]
  ------------------
 1177|      0|                        matchIndex = prefixIdx;
 1178|      0|                        continue;
 1179|      0|                    }
 1180|   152M|                    matchIndex = newMatchIndex;
 1181|   152M|                    if (!fullPatternFits && lookBackLength==0) {  /* no back possible : the match length is known */
  ------------------
  |  Branch (1181:25): [True: 112M, False: 40.4M]
  |  Branch (1181:45): [True: 102M, False: 10.2M]
  ------------------
 1182|   102M|                        size_t const maxML = MIN(currentSegmentLength, srcPatternLength);
  ------------------
  |  |   91|   102M|#define MIN(a,b)   ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 58.3M, False: 43.7M]
  |  |  ------------------
  ------------------
 1183|   102M|                        if ((size_t)longest < maxML) {
  ------------------
  |  Branch (1183:29): [True: 168k, False: 101M]
  ------------------
 1184|   168k|                            assert(prefixPtr - prefixIdx + matchIndex != ip);
  ------------------
  |  Branch (1184:29): [True: 0, False: 168k]
  |  Branch (1184:29): [True: 168k, False: 0]
  ------------------
 1185|   168k|                            if ((size_t)(ip - prefixPtr) + prefixIdx - matchIndex > LZ4_DISTANCE_MAX) break;
  ------------------
  |  |  745|   168k|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
  |  Branch (1185:33): [True: 0, False: 168k]
  ------------------
 1186|   168k|                            assert(maxML < 2 GB);
  ------------------
  |  Branch (1186:29): [True: 0, False: 168k]
  |  Branch (1186:29): [True: 168k, False: 0]
  ------------------
 1187|   168k|                            longest = (int)maxML;
 1188|   168k|                            offset = (int)(ipIndex - matchIndex);
 1189|   168k|                            assert(sBack == 0);
  ------------------
  |  Branch (1189:29): [True: 0, False: 168k]
  |  Branch (1189:29): [True: 168k, False: 0]
  ------------------
 1190|   168k|                            DEBUGLOG(7, "Found repeat pattern match of len=%i, offset=%i", longest, offset);
  ------------------
  |  |  288|   168k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1191|   168k|                        }
 1192|   102M|                        {   U32 const distToNextPattern = DELTANEXTU16(chainTable, matchIndex);
  ------------------
  |  |  242|   102M|#define DELTANEXTU16(table, pos) table[(U16)(pos)]   /* faster */
  ------------------
 1193|   102M|                            if (distToNextPattern > matchIndex) break;  /* avoid overflow */
  ------------------
  |  Branch (1193:33): [True: 0, False: 102M]
  ------------------
 1194|   102M|                            matchIndex -= distToNextPattern;
 1195|   102M|                    }   }
 1196|   152M|                    continue;
 1197|   152M|                }
 1198|   175M|        }   }   /* PA optimization */
 1199|       |
 1200|       |        /* follow current chain */
 1201|   690M|        matchIndex -= DELTANEXTU16(chainTable, matchIndex + matchChainPos);
  ------------------
  |  |  242|   690M|#define DELTANEXTU16(table, pos) table[(U16)(pos)]   /* faster */
  ------------------
 1202|       |
 1203|   690M|    }  /* while ((matchIndex>=lowestMatchIndex) && (nbAttempts)) */
 1204|       |
 1205|   109M|    if ( dict == usingDictCtxHc
  ------------------
  |  Branch (1205:10): [True: 0, False: 109M]
  ------------------
 1206|      0|      && nbAttempts > 0
  ------------------
  |  Branch (1206:10): [True: 0, False: 0]
  ------------------
 1207|      0|      && longest < maxLength
  ------------------
  |  Branch (1207:10): [True: 0, False: 0]
  ------------------
 1208|      0|      && withinStartDistance) {
  ------------------
  |  Branch (1208:10): [True: 0, False: 0]
  ------------------
 1209|      0|        size_t const dictEndOffset = (size_t)(dictCtx->end - dictCtx->prefixStart) + dictCtx->dictLimit;
 1210|      0|        U32 dictMatchIndex = dictCtx->hashTable[LZ4HC_hashPtr(ip)];
 1211|      0|        assert(dictEndOffset <= 1 GB);
  ------------------
  |  Branch (1211:9): [True: 0, False: 0]
  |  Branch (1211:9): [True: 0, False: 0]
  ------------------
 1212|      0|        matchIndex = dictMatchIndex + lowestMatchIndex - (U32)dictEndOffset;
 1213|      0|        if (dictMatchIndex>0) DEBUGLOG(7, "dictEndOffset = %zu, dictMatchIndex = %u => relative matchIndex = %i", dictEndOffset, dictMatchIndex, (int)dictMatchIndex - (int)dictEndOffset);
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
  |  Branch (1213:13): [True: 0, False: 0]
  ------------------
 1214|      0|        while (ipIndex - matchIndex <= LZ4_DISTANCE_MAX && longest < maxLength && nbAttempts--) {
  ------------------
  |  |  745|      0|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
  |  Branch (1214:16): [True: 0, False: 0]
  |  Branch (1214:60): [True: 0, False: 0]
  |  Branch (1214:83): [True: 0, False: 0]
  ------------------
 1215|      0|            const BYTE* const matchPtr = dictCtx->prefixStart - dictCtx->dictLimit + dictMatchIndex;
 1216|       |
 1217|      0|            if (LZ4_read32(matchPtr) == pattern) {
  ------------------
  |  Branch (1217:17): [True: 0, False: 0]
  ------------------
 1218|      0|                int mlt;
 1219|      0|                int back = 0;
 1220|      0|                const BYTE* vLimit = ip + (dictEndOffset - dictMatchIndex);
 1221|      0|                if (vLimit > iHighLimit) vLimit = iHighLimit;
  ------------------
  |  Branch (1221:21): [True: 0, False: 0]
  ------------------
 1222|      0|                mlt = (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, vLimit) + MINMATCH;
  ------------------
  |  |  241|      0|#define MINMATCH 4
  ------------------
                              mlt = (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, vLimit) + MINMATCH;
  ------------------
  |  |  241|      0|#define MINMATCH 4
  ------------------
                              mlt = (int)LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, vLimit) + MINMATCH;
  ------------------
  |  |  241|      0|#define MINMATCH 4
  ------------------
 1223|      0|                back = lookBackLength ? LZ4HC_countBack(ip, matchPtr, iLowLimit, dictCtx->prefixStart) : 0;
  ------------------
  |  Branch (1223:24): [True: 0, False: 0]
  ------------------
 1224|      0|                mlt -= back;
 1225|      0|                if (mlt > longest) {
  ------------------
  |  Branch (1225:21): [True: 0, False: 0]
  ------------------
 1226|      0|                    longest = mlt;
 1227|      0|                    offset = (int)(ipIndex - matchIndex);
 1228|      0|                    sBack = back;
 1229|      0|                    DEBUGLOG(7, "found match of length %i within extDictCtx", longest);
  ------------------
  |  |  288|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1230|      0|            }   }
 1231|       |
 1232|      0|            {   U32 const nextOffset = DELTANEXTU16(dictCtx->chainTable, dictMatchIndex);
  ------------------
  |  |  242|      0|#define DELTANEXTU16(table, pos) table[(U16)(pos)]   /* faster */
  ------------------
 1233|      0|                dictMatchIndex -= nextOffset;
 1234|      0|                matchIndex -= nextOffset;
 1235|      0|    }   }   }
 1236|       |
 1237|   109M|    {   LZ4HC_match_t md;
 1238|   109M|        assert(longest >= 0);
  ------------------
  |  Branch (1238:9): [True: 0, False: 109M]
  |  Branch (1238:9): [True: 109M, False: 0]
  ------------------
 1239|   109M|        md.len = longest;
 1240|   109M|        md.off = offset;
 1241|   109M|        md.back = sBack;
 1242|   109M|        return md;
 1243|   109M|    }
 1244|   109M|}
lz4hc.c:LZ4HC_sparsestChain:
  993|  4.02M|{
  994|  4.02M|    int const kTrigger = 4;
  995|  4.02M|    U32 distanceToNextMatch = 1;
  996|  4.02M|    int const end = longest - MINMATCH + 1;
  ------------------
  |  |  241|  4.02M|#define MINMATCH 4
  ------------------
  997|  4.02M|    int step = 1;
  998|  4.02M|    int accel = 1 << kTrigger;
  999|  4.02M|    int pos;
 1000|   142M|    for (pos = 0; pos < end; pos += step) {
  ------------------
  |  Branch (1000:19): [True: 138M, False: 4.02M]
  ------------------
 1001|   138M|        U32 const candidateDist = DELTANEXTU16(chainTable, matchIndex + (U32)pos);
  ------------------
  |  |  242|   138M|#define DELTANEXTU16(table, pos) table[(U16)(pos)]   /* faster */
  ------------------
 1002|   138M|        step = (accel++ >> kTrigger);
 1003|   138M|        if (candidateDist > distanceToNextMatch) {
  ------------------
  |  Branch (1003:13): [True: 5.13M, False: 132M]
  ------------------
 1004|  5.13M|            distanceToNextMatch = candidateDist;
 1005|  5.13M|            *matchChainPosPtr = (U32)pos;
 1006|  5.13M|            accel = 1 << kTrigger;
 1007|  5.13M|    }   }
 1008|  4.02M|    return distanceToNextMatch;
 1009|  4.02M|}
lz4hc.c:LZ4HC_countPattern:
  926|   153M|{
  927|   153M|    const BYTE* const iStart = ip;
  928|   153M|    reg_t const pattern = (sizeof(pattern)==8) ?
  ------------------
  |  Branch (928:27): [True: 153M, Folded]
  ------------------
  929|   153M|        (reg_t)pattern32 + (((reg_t)pattern32) << (sizeof(pattern)*4)) : pattern32;
  930|       |
  931|   237M|    while (likely(ip < iEnd-(sizeof(pattern)-1))) {
  932|   237M|        reg_t const diff = LZ4_read_ARCH(ip) ^ pattern;
  933|   237M|        if (!diff) { ip+=sizeof(pattern); continue; }
  ------------------
  |  Branch (933:13): [True: 83.9M, False: 153M]
  ------------------
  934|   153M|        ip += LZ4_NbCommonBytes(diff);
  935|   153M|        return (unsigned)(ip - iStart);
  936|   237M|    }
  937|       |
  938|  14.5k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (938:9): [True: 14.5k, False: 0]
  ------------------
  939|  14.5k|        reg_t patternByte = pattern;
  940|  53.7k|        while ((ip<iEnd) && (*ip == (BYTE)patternByte)) {
  ------------------
  |  Branch (940:16): [True: 46.8k, False: 6.92k]
  |  Branch (940:29): [True: 39.1k, False: 7.67k]
  ------------------
  941|  39.1k|            ip++; patternByte >>= 8;
  942|  39.1k|        }
  943|  14.5k|    } else {  /* big endian */
  944|      0|        U32 bitOffset = (sizeof(pattern)*8) - 8;
  945|      0|        while (ip < iEnd) {
  ------------------
  |  Branch (945:16): [True: 0, False: 0]
  ------------------
  946|      0|            BYTE const byte = (BYTE)(pattern >> bitOffset);
  947|      0|            if (*ip != byte) break;
  ------------------
  |  Branch (947:17): [True: 0, False: 0]
  ------------------
  948|      0|            ip ++; bitOffset -= 8;
  949|      0|    }   }
  950|       |
  951|  14.5k|    return (unsigned)(ip - iStart);
  952|   153M|}
lz4hc.c:LZ4HC_protectDictEnd:
  980|   307M|{
  981|   307M|    return ((U32)((dictLimit - 1) - matchIndex) >= 3);
  982|   307M|}
lz4hc.c:LZ4HC_patternSegment:
 1020|   154M|{
 1021|   154M|    const BYTE* const prefixPtr = hc4->prefixStart;
 1022|   154M|    U32 const prefixIdx = hc4->dictLimit;
 1023|   154M|    const BYTE* const dictStart = hc4->dictStart;
 1024|   154M|    U32 const dictIdx = hc4->lowLimit;
 1025|   154M|    const BYTE* const dictEnd = dictStart + prefixIdx - dictIdx;
 1026|   154M|    int const extDict = candidateIdx < prefixIdx;
 1027|   154M|    const BYTE* const matchPtr = extDict ? dictStart + (candidateIdx - dictIdx) : prefixPtr + (candidateIdx - prefixIdx);
  ------------------
  |  Branch (1027:34): [True: 0, False: 154M]
  ------------------
 1028|   154M|    size_t forward, back;
 1029|   154M|    if (LZ4_read32(matchPtr) != pattern) return 0;
  ------------------
  |  Branch (1029:9): [True: 1.47M, False: 152M]
  ------------------
 1030|       |
 1031|   152M|    {   const BYTE* const iLimit = extDict ? dictEnd : iHighLimit;
  ------------------
  |  Branch (1031:36): [True: 0, False: 152M]
  ------------------
 1032|   152M|        forward = LZ4HC_countPattern(matchPtr+sizeof(pattern), iLimit, pattern) + sizeof(pattern);
 1033|   152M|        if (extDict && matchPtr + forward == iLimit) {   /* continues into the prefix */
  ------------------
  |  Branch (1033:13): [True: 0, False: 152M]
  |  Branch (1033:24): [True: 0, False: 0]
  ------------------
 1034|      0|            U32 const rotatedPattern = LZ4HC_rotatePattern(forward, pattern);
 1035|      0|            forward += LZ4HC_countPattern(prefixPtr, iHighLimit, rotatedPattern);
 1036|      0|    }   }
 1037|       |
 1038|   152M|    back = LZ4HC_reverseCountPattern(matchPtr, extDict ? dictStart : prefixPtr, pattern);
  ------------------
  |  Branch (1038:48): [True: 0, False: 152M]
  ------------------
 1039|   152M|    if (!extDict && matchPtr - back == prefixPtr && dictIdx < prefixIdx) {   /* continues into the external dictionary */
  ------------------
  |  Branch (1039:9): [True: 152M, False: 0]
  |  Branch (1039:21): [True: 38.3k, False: 152M]
  |  Branch (1039:53): [True: 0, False: 38.3k]
  ------------------
 1040|      0|        U32 const rotatedPattern = LZ4HC_rotatePattern((U32)(-(int)back), pattern);
 1041|      0|        back += LZ4HC_reverseCountPattern(dictEnd, dictStart, rotatedPattern);
 1042|      0|    }
 1043|       |    /* don't go below lowestMatchIndex */
 1044|   152M|    back = candidateIdx - MAX(candidateIdx - (U32)back, lowestMatchIndex);
  ------------------
  |  |   93|   152M|#define MAX(a,b)   ( (a) > (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (93:22): [True: 152M, False: 133k]
  |  |  ------------------
  ------------------
 1045|   152M|    assert(candidateIdx - back >= lowestMatchIndex);
  ------------------
  |  Branch (1045:5): [True: 0, False: 152M]
  |  Branch (1045:5): [True: 152M, False: 0]
  ------------------
 1046|       |
 1047|   152M|    *forwardPtr = forward;
 1048|   152M|    *backPtr = back;
 1049|   152M|    return 1;
 1050|   152M|}
lz4hc.c:LZ4HC_reverseCountPattern:
  959|   152M|{
  960|   152M|    const BYTE* const iStart = ip;
  961|       |
  962|  2.47G|    while (likely(ip >= iLow+4)) {
  963|  2.47G|        if (LZ4_read32(ip-4) != pattern) break;
  ------------------
  |  Branch (963:13): [True: 152M, False: 2.32G]
  ------------------
  964|  2.32G|        ip -= 4;
  965|  2.32G|    }
  966|   152M|    {   const BYTE* bytePtr = (const BYTE*)(&pattern) + 3; /* works for any endianness */
  967|   360M|        while (likely(ip>iLow)) {
  968|   360M|            if (ip[-1] != *bytePtr) break;
  ------------------
  |  Branch (968:17): [True: 152M, False: 207M]
  ------------------
  969|   207M|            ip--; bytePtr--;
  970|   207M|    }   }
  971|   152M|    return (unsigned)(iStart - ip);
  972|   152M|}
lz4hc.c:LZ4HC_compress_optimal:
 2208|  6.70k|{
 2209|  6.70k|    LZ4_STATIC_ASSERT(LZ4_STREAMHC_EXTSIZE == sizeof(LZ4_streamHC_t) + sizeof(LZ4HC_optimal_t) * (LZ4_OPT_NUM + TRAILING_LITERALS));
  ------------------
  |  |  276|  6.70k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2210|  6.70k|    if (ctx->hasWorkspace) {   /* extended state : the buffer follows it */
  ------------------
  |  Branch (2210:9): [True: 3.35k, False: 3.35k]
  ------------------
 2211|  3.35k|        LZ4HC_optimal_t* const opt = (LZ4HC_optimal_t*)(void*)((BYTE*)ctx + sizeof(LZ4_streamHC_t));
 2212|  3.35k|        return LZ4HC_compress_optimal_internal(ctx, source, dst, srcSizePtr, dstCapacity,
 2213|  3.35k|                    nbSearches, nbSearchesSeq, targetLength, limit, dict, favorDecSpeed, opt);
 2214|  3.35k|    }
 2215|  3.35k|  { /* plain state */
 2216|  3.35k|#if defined(LZ4HC_HEAPMODE) && LZ4HC_HEAPMODE==1
 2217|  3.35k|    LZ4HC_optimal_t* const opt = (LZ4HC_optimal_t*)ALLOC(sizeof(LZ4HC_optimal_t) * (LZ4_OPT_NUM + TRAILING_LITERALS));
  ------------------
  |  |  224|  3.35k|# define ALLOC(s)          malloc(s)
  ------------------
 2218|  3.35k|    int result;
 2219|  3.35k|    if (opt == NULL) return 0;
  ------------------
  |  Branch (2219:9): [True: 0, False: 3.35k]
  ------------------
 2220|  3.35k|    result = LZ4HC_compress_optimal_internal(ctx, source, dst, srcSizePtr, dstCapacity,
 2221|  3.35k|                    nbSearches, nbSearchesSeq, targetLength, limit, dict, favorDecSpeed, opt);
 2222|  3.35k|    FREEMEM(opt);
  ------------------
  |  |  226|  3.35k|# define FREEMEM(p)        free(p)
  ------------------
 2223|  3.35k|    return result;
 2224|       |#else
 2225|       |    LZ4HC_optimal_t opt[LZ4_OPT_NUM + TRAILING_LITERALS];   /* ~64 KB, which can be a bit large for some stacks... */
 2226|       |    return LZ4HC_compress_optimal_internal(ctx, source, dst, srcSizePtr, dstCapacity,
 2227|       |                    nbSearches, nbSearchesSeq, targetLength, limit, dict, favorDecSpeed, opt);
 2228|       |#endif
 2229|  3.35k|  }
 2230|  3.35k|}
lz4hc.c:LZ4HC_compress_optimal_internal:
 2061|  6.70k|{
 2062|  6.70k|    const BYTE* ip = (const BYTE*) source;
 2063|  6.70k|    const BYTE* anchor = ip;
 2064|  6.70k|    const int inputSize = *srcSizePtr;
 2065|  6.70k|    const BYTE* const iend = ip + inputSize;
 2066|  6.70k|    const BYTE* mflimit;      /* set after the size check : would precede a small input */
 2067|  6.70k|    const BYTE* matchlimit;
 2068|  6.70k|    BYTE* op = (BYTE*) dst;
 2069|       |    /* fillOutput : keep room for the final run of literals (LZ4 format restriction) */
 2070|  6.70k|    BYTE* const oend = op + dstCapacity - ((limit == fillOutput) ? LASTLITERALS : 0);
  ------------------
  |  |  244|  3.35k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2070:44): [True: 3.35k, False: 3.35k]
  ------------------
 2071|  6.70k|    int const sufficientLen = MIN(targetLength, LZ4_OPT_NUM-1);
  ------------------
  |  |   91|  6.70k|#define MIN(a,b)   ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 4.18k, False: 2.52k]
  |  |  ------------------
  ------------------
 2072|       |
 2073|  6.70k|    DEBUGLOG(5, "LZ4HC_compress_optimal(dst=%p, dstCapa=%u)", dst, (unsigned)dstCapacity);
  ------------------
  |  |  288|  6.70k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2074|       |
 2075|       |    /* preconditions verifications */
 2076|  6.70k|    assert(dstCapacity > 0);
  ------------------
  |  Branch (2076:5): [True: 0, False: 6.70k]
  |  Branch (2076:5): [True: 6.70k, False: 0]
  ------------------
 2077|  6.70k|    assert(dst != NULL);
  ------------------
  |  Branch (2077:5): [True: 0, False: 6.70k]
  |  Branch (2077:5): [True: 6.70k, False: 0]
  ------------------
 2078|  6.70k|    assert(*srcSizePtr > 0);
  ------------------
  |  Branch (2078:5): [True: 0, False: 6.70k]
  |  Branch (2078:5): [True: 6.70k, False: 0]
  ------------------
 2079|  6.70k|    assert(source != NULL);
  ------------------
  |  Branch (2079:5): [True: 0, False: 6.70k]
  |  Branch (2079:5): [True: 6.70k, False: 0]
  ------------------
 2080|  6.70k|    assert(opt != NULL);
  ------------------
  |  Branch (2080:5): [True: 0, False: 6.70k]
  |  Branch (2080:5): [True: 6.70k, False: 0]
  ------------------
 2081|  6.70k|    assert(nbSearchesSeq >= 1);
  ------------------
  |  Branch (2081:5): [True: 0, False: 6.70k]
  |  Branch (2081:5): [True: 6.70k, False: 0]
  ------------------
 2082|       |
 2083|  6.70k|    *srcSizePtr = 0;
 2084|  6.70k|    if (inputSize < LZ4_minLength) goto _last_literals;
  ------------------
  |  Branch (2084:9): [True: 24, False: 6.68k]
  ------------------
 2085|  6.68k|    mflimit = iend - MFLIMIT;
  ------------------
  |  |  245|  6.68k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2086|  6.68k|    matchlimit = iend - LASTLITERALS;
  ------------------
  |  |  244|  6.68k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2087|       |
 2088|       |    /* Main Loop */
 2089|  55.0M|    while (ip <= mflimit) {
  ------------------
  |  Branch (2089:12): [True: 55.0M, False: 4.51k]
  ------------------
 2090|  55.0M|        int const llen = LZ4HC_pricedLitlen((int)(ip - anchor));
 2091|  55.0M|        int cur, lastPos;
 2092|  55.0M|        int lastSeqPos;         /* position of the last sequence to encode */
 2093|  55.0M|        LZ4HC_match_t lastSeq;
 2094|       |
 2095|  55.0M|        LZ4HC_match_t const firstMatch = LZ4HC_FindLongestMatch(ctx, ip, matchlimit, nbSearches, dict, favorDecSpeed);
 2096|  55.0M|        if (firstMatch.len==0) { ip++; continue; }
  ------------------
  |  Branch (2096:13): [True: 54.7M, False: 388k]
  ------------------
 2097|       |
 2098|   388k|        if (firstMatch.len > sufficientLen) {
  ------------------
  |  Branch (2098:13): [True: 15.0k, False: 373k]
  ------------------
 2099|       |            /* good enough solution : immediate encoding */
 2100|  15.0k|            lastSeqPos = 0;
 2101|  15.0k|            lastSeq = firstMatch;
 2102|  15.0k|            goto encode;
 2103|  15.0k|        }
 2104|       |
 2105|       |        /* set prices for first positions (literals) */
 2106|   373k|        {   int rPos;
 2107|  1.86M|            for (rPos = 0 ; rPos < MINMATCH ; rPos++)
  ------------------
  |  |  241|  1.86M|#define MINMATCH 4
  ------------------
  |  Branch (2107:29): [True: 1.49M, False: 373k]
  ------------------
 2108|  1.49M|                LZ4HC_setLiteral(opt, rPos, llen + rPos, LZ4HC_literalsPrice(llen + rPos));
 2109|   373k|        }
 2110|   373k|        lastPos = LZ4HC_addMatch(opt, 0, firstMatch, 0, favorDecSpeed);
 2111|       |
 2112|       |        /* check further positions */
 2113|  35.3M|        for (cur = 1; cur < lastPos; cur++) {
  ------------------
  |  Branch (2113:23): [True: 34.9M, False: 364k]
  ------------------
 2114|  34.9M|            const BYTE* const curPtr = ip + cur;
 2115|  34.9M|            LZ4HC_match_t newMatch;
 2116|  34.9M|            int nbS = nbSearches;
 2117|       |
 2118|  34.9M|            if (curPtr > mflimit) break;
  ------------------
  |  Branch (2118:17): [True: 4.41k, False: 34.9M]
  ------------------
 2119|  34.9M|            DEBUGLOG(7, "rPos:%u[%u] vs [%u]%u",
  ------------------
  |  |  288|  34.9M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2120|  34.9M|                    cur, opt[cur].price, opt[cur+1].price, cur+1);
 2121|       |            /* not useful to search here if next position has same (or lower) cost */
 2122|  34.9M|            if (opt[cur+1].price <= opt[cur].price) continue;
  ------------------
  |  Branch (2122:17): [True: 32.7M, False: 2.24M]
  ------------------
 2123|       |            /* favorDecSpeed : next position costs less than one more byte, the difference comes from sequences.
 2124|       |             * A match starting here might save some : worth a cheaper search, if close to lastPos */
 2125|  2.24M|            if (favorDecSpeed && (opt[cur+1].price < opt[cur].price + LZ4HC_PRICE_SCALE)) {
  ------------------
  |  | 1914|      0|#define LZ4HC_PRICE_SCALE 4
  ------------------
  |  Branch (2125:17): [True: 0, False: 2.24M]
  |  Branch (2125:34): [True: 0, False: 0]
  ------------------
 2126|      0|                if (lastPos - cur > LZ4HC_SEQ_SEARCH_DIST) continue;
  ------------------
  |  | 1923|      0|#define LZ4HC_SEQ_SEARCH_DIST  4
  ------------------
  |  Branch (2126:21): [True: 0, False: 0]
  ------------------
 2127|      0|                nbS = nbSearchesSeq;
 2128|      0|            }
 2129|       |
 2130|  2.24M|            newMatch = LZ4HC_FindLongestMatch(ctx, curPtr, matchlimit, nbS, dict, favorDecSpeed);
 2131|  2.24M|            if (!newMatch.len) continue;
  ------------------
  |  Branch (2131:17): [True: 392k, False: 1.85M]
  ------------------
 2132|       |
 2133|  1.85M|            if ( (newMatch.len > sufficientLen)
  ------------------
  |  Branch (2133:18): [True: 3.28k, False: 1.84M]
  ------------------
 2134|  1.84M|              || (newMatch.len + cur >= LZ4_OPT_NUM) ) {
  ------------------
  |  |   86|  1.84M|#define LZ4_OPT_NUM   (1<<12)
  ------------------
  |  Branch (2134:18): [True: 684, False: 1.84M]
  ------------------
 2135|       |                /* immediate encoding */
 2136|  3.96k|                lastSeqPos = cur;
 2137|  3.96k|                lastSeq = newMatch;
 2138|  3.96k|                goto encode;
 2139|  3.96k|            }
 2140|       |
 2141|  1.84M|            lastPos = LZ4HC_addMatch(opt, cur, newMatch, lastPos, favorDecSpeed);
 2142|  1.84M|        }  /* for (cur = 1; cur < lastPos; cur++) */
 2143|       |
 2144|   373k|        assert(lastPos < LZ4_OPT_NUM + TRAILING_LITERALS);
  ------------------
  |  Branch (2144:9): [True: 0, False: 369k]
  |  Branch (2144:9): [True: 369k, False: 0]
  ------------------
 2145|   369k|        lastSeq.len = opt[lastPos].mlen;
 2146|   369k|        lastSeq.off = opt[lastPos].off;
 2147|   369k|        lastSeqPos = lastPos - lastSeq.len;
 2148|       |
 2149|   388k|encode: /* lastSeqPos and lastSeq must be set */
 2150|   388k|        assert(0 <= lastSeqPos && lastSeqPos < LZ4_OPT_NUM);
  ------------------
  |  Branch (2150:9): [True: 0, False: 388k]
  |  Branch (2150:9): [True: 0, False: 0]
  |  Branch (2150:9): [True: 388k, False: 0]
  |  Branch (2150:9): [True: 388k, False: 0]
  ------------------
 2151|   388k|        DEBUGLOG(6, "reverse traversal, looking for shortest path (lastSeqPos=%i)", lastSeqPos);
  ------------------
  |  |  288|   388k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2152|       |        /* opt[pos] describes the step ending at pos.
 2153|       |         * Walk the path backward, moving each step to its starting position instead */
 2154|   388k|        {   int pos = lastSeqPos;
 2155|   388k|            int mlen = lastSeq.len;
 2156|   388k|            int off = lastSeq.off;
 2157|   871k|            while (pos > 0) {
  ------------------
  |  Branch (2157:20): [True: 483k, False: 388k]
  ------------------
 2158|   483k|                int const prevMlen = opt[pos].mlen;
 2159|   483k|                int const prevOff = opt[pos].off;
 2160|   483k|                opt[pos].mlen = mlen;
 2161|   483k|                opt[pos].off = off;
 2162|   483k|                mlen = prevMlen;
 2163|   483k|                off = prevOff;
 2164|   483k|                assert(0 < mlen && mlen <= pos);
  ------------------
  |  Branch (2164:17): [True: 0, False: 483k]
  |  Branch (2164:17): [True: 0, False: 0]
  |  Branch (2164:17): [True: 483k, False: 0]
  |  Branch (2164:17): [True: 483k, False: 0]
  ------------------
 2165|   483k|                pos -= mlen;
 2166|   483k|            }
 2167|       |            /* first step of the path; note : opt[0] isn't necessarily initialized */
 2168|   388k|            opt[0].mlen = mlen;
 2169|   388k|            opt[0].off = off;
 2170|   388k|        }
 2171|       |
 2172|       |        /* encode all recorded sequences in order */
 2173|   388k|        {   int rPos = 0;  /* relative position (to ip) */
 2174|  1.25M|            while (rPos <= lastSeqPos) {
  ------------------
  |  Branch (2174:20): [True: 870k, False: 386k]
  ------------------
 2175|   870k|                int const ml = opt[rPos].mlen;
 2176|   870k|                int const offset = opt[rPos].off;
 2177|   870k|                if (ml == 1) { ip++; rPos++; continue; }  /* literal */
  ------------------
  |  Branch (2177:21): [True: 132k, False: 737k]
  ------------------
 2178|   737k|                rPos += ml;
 2179|   737k|                assert(ml >= MINMATCH);
  ------------------
  |  Branch (2179:17): [True: 0, False: 737k]
  |  Branch (2179:17): [True: 737k, False: 0]
  ------------------
 2180|   737k|                assert((offset >= 1) && (offset <= LZ4_DISTANCE_MAX));
  ------------------
  |  Branch (2180:17): [True: 0, False: 737k]
  |  Branch (2180:17): [True: 0, False: 0]
  |  Branch (2180:17): [True: 737k, False: 0]
  |  Branch (2180:17): [True: 737k, False: 0]
  ------------------
 2181|   737k|                if ( LZ4HC_encodeSequence(UPDATABLE(ip, op, anchor), ml, offset, limit, oend) ) {  /* updates ip, op and anchor */
  ------------------
  |  |  244|   737k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (2181:22): [True: 2.17k, False: 735k]
  ------------------
 2182|  2.17k|                    if (limit != fillOutput) return 0;  /* compression failed */
  ------------------
  |  Branch (2182:25): [True: 797, False: 1.37k]
  ------------------
 2183|  1.37k|                    LZ4HC_encodeLastSequence_fillOutput(UPDATABLE(ip, op, anchor), ml, offset, oend);
  ------------------
  |  |  244|  1.37k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
 2184|  1.37k|                    goto _last_literals;
 2185|  2.17k|        }   }   }
 2186|   388k|    }  /* while (ip <= mflimit) */
 2187|       |
 2188|  5.90k|_last_literals:
 2189|  5.90k|    if (LZ4HC_encodeLastLiterals(UPDATABLE(ip, op, anchor), iend, limit, oend))
  ------------------
  |  |  244|  5.90k|#define UPDATABLE(ip, op, anchor) &ip, &op, &anchor
  ------------------
  |  Branch (2189:9): [True: 518, False: 5.39k]
  ------------------
 2190|    518|        return 0;  /* not enough space in @dst */
 2191|       |
 2192|       |    /* End */
 2193|  5.39k|    *srcSizePtr = (int) (((const char*)ip) - source);
 2194|  5.39k|    return (int) ((char*)op-dst);
 2195|  5.90k|}
lz4hc.c:LZ4HC_pricedLitlen:
 1953|  55.0M|{
 1954|  55.0M|    int const reduceFrom = (int)RUN_MASK + 255;
  ------------------
  |  |  262|  55.0M|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  55.0M|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  55.0M|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1955|  55.0M|    assert(llen >= 0);
  ------------------
  |  Branch (1955:5): [True: 0, False: 55.0M]
  |  Branch (1955:5): [True: 55.0M, False: 0]
  ------------------
 1956|  55.0M|    if (llen < reduceFrom) return llen;
  ------------------
  |  Branch (1956:9): [True: 3.32M, False: 51.7M]
  ------------------
 1957|  51.7M|    return reduceFrom + ((llen - (int)RUN_MASK) % 255);
  ------------------
  |  |  262|  51.7M|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  51.7M|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  51.7M|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1958|  55.0M|}
lz4hc.c:LZ4HC_FindLongestMatch:
 1966|  57.3M|{
 1967|  57.3M|    LZ4HC_match_t const match0 = { 0 , 0, 0 };
 1968|       |    /* note : LZ4HC_InsertAndGetWiderMatch() can extend a match backward (md.back < 0),
 1969|       |     * but not here, since iLowLimit == ip */
 1970|  57.3M|    LZ4HC_match_t md = LZ4HC_InsertAndGetWiderMatch(ctx, ip, ip, iHighLimit, MINMATCH-1, nbSearches, 1 /*patternAnalysis*/, 1 /*chainSwap*/, dict, favorDecSpeed);
  ------------------
  |  |  241|  57.3M|#define MINMATCH 4
  ------------------
 1971|  57.3M|    assert(md.back == 0);
  ------------------
  |  Branch (1971:5): [True: 0, False: 57.3M]
  |  Branch (1971:5): [True: 57.3M, False: 0]
  ------------------
 1972|  57.3M|    if (md.len < MINMATCH) return match0;
  ------------------
  |  |  241|  57.3M|#define MINMATCH 4
  ------------------
  |  Branch (1972:9): [True: 55.0M, False: 2.23M]
  ------------------
 1973|  2.23M|    if (favorDecSpeed) {
  ------------------
  |  Branch (1973:9): [True: 0, False: 2.23M]
  ------------------
 1974|      0|        if ((md.len>18) & (md.len<=36)) md.len=18;   /* favor dec.speed (shortcut) */
  ------------------
  |  Branch (1974:13): [True: 0, False: 0]
  ------------------
 1975|      0|    }
 1976|  2.23M|    return md;
 1977|  57.3M|}
lz4hc.c:LZ4HC_setLiteral:
 1981|  8.15M|{
 1982|  8.15M|    opt[pos].mlen = 1;
 1983|  8.15M|    opt[pos].off = 0;
 1984|  8.15M|    opt[pos].litlen = litlen;
 1985|  8.15M|    opt[pos].price = price;
 1986|  8.15M|    DEBUGLOG(7, "rPos:%3i => price:%3i (litlen=%i)", pos, price, litlen);
  ------------------
  |  |  288|  8.15M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1987|  8.15M|}
lz4hc.c:LZ4HC_literalsPrice:
 1926|   197M|{
 1927|   197M|    int price = litlen;
 1928|   197M|    assert(litlen >= 0);
  ------------------
  |  Branch (1928:5): [True: 0, False: 197M]
  |  Branch (1928:5): [True: 197M, False: 0]
  ------------------
 1929|   197M|    if (litlen >= (int)RUN_MASK)
  ------------------
  |  |  262|   197M|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|   197M|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|   197M|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1929:9): [True: 3.38M, False: 194M]
  ------------------
 1930|  3.38M|        price += 1 + ((litlen-(int)RUN_MASK) / 255);
  ------------------
  |  |  262|  3.38M|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  261|  3.38M|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  259|  3.38M|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1931|   197M|    return price * LZ4HC_PRICE_SCALE;
  ------------------
  |  | 1914|   197M|#define LZ4HC_PRICE_SCALE 4
  ------------------
 1932|   197M|}
lz4hc.c:LZ4HC_addMatch:
 2014|  2.22M|{
 2015|  2.22M|    int const ll = opt[cur].litlen;
 2016|  2.22M|    int const basePrice = LZ4HC_runStartPrice(opt, cur) + (favorDecSpeed ? LZ4HC_SEQ_PRICE_FDS : 0);
  ------------------
  |  | 1922|      0|#define LZ4HC_SEQ_PRICE_FDS    1
  ------------------
  |  Branch (2016:60): [True: 0, False: 2.22M]
  ------------------
 2017|  2.22M|    int ml;
 2018|  2.22M|    assert(cur + match.len < LZ4_OPT_NUM);
  ------------------
  |  Branch (2018:5): [True: 0, False: 2.22M]
  |  Branch (2018:5): [True: 2.22M, False: 0]
  ------------------
 2019|  2.22M|    assert((U32)favorDecSpeed <= 1);
  ------------------
  |  Branch (2019:5): [True: 0, False: 2.22M]
  |  Branch (2019:5): [True: 2.22M, False: 0]
  ------------------
 2020|   191M|    for (ml = MINMATCH; ml <= match.len; ml++) {
  ------------------
  |  |  241|  2.22M|#define MINMATCH 4
  ------------------
  |  Branch (2020:25): [True: 189M, False: 2.22M]
  ------------------
 2021|   189M|        int const pos = cur + ml;
 2022|   189M|        int const price = basePrice + LZ4HC_sequencePrice(ll, ml);
 2023|       |        /* on equal price, favorDecSpeed keeps the existing solution */
 2024|   189M|        if ( pos > lastPos + TRAILING_LITERALS
  ------------------
  |  | 1910|   378M|#define TRAILING_LITERALS 3
  ------------------
  |  Branch (2024:14): [True: 33.6M, False: 155M]
  ------------------
 2025|   155M|          || price <= opt[pos].price - (int)favorDecSpeed) {
  ------------------
  |  Branch (2025:14): [True: 6.85M, False: 148M]
  ------------------
 2026|  40.4M|            LZ4HC_setMatch(opt, pos, ml, match.off, price);
 2027|  40.4M|            if ((ml == match.len) && (lastPos < pos)) lastPos = pos;
  ------------------
  |  Branch (2027:17): [True: 1.36M, False: 39.1M]
  |  Branch (2027:38): [True: 1.31M, False: 52.8k]
  ------------------
 2028|  40.4M|    }   }
 2029|       |
 2030|       |    /* complete following positions with literals */
 2031|  2.22M|    {   int addLit;
 2032|  2.22M|        assert(opt[lastPos].mlen >= MINMATCH);
  ------------------
  |  Branch (2032:9): [True: 0, False: 2.22M]
  |  Branch (2032:9): [True: 2.22M, False: 0]
  ------------------
 2033|  8.88M|        for (addLit = 1; addLit <= TRAILING_LITERALS; addLit++)
  ------------------
  |  | 1910|  8.88M|#define TRAILING_LITERALS 3
  ------------------
  |  Branch (2033:26): [True: 6.66M, False: 2.22M]
  ------------------
 2034|  6.66M|            LZ4HC_setLiteral(opt, lastPos + addLit, addLit,
 2035|  6.66M|                             opt[lastPos].price + LZ4HC_literalsPrice(addLit));
 2036|  2.22M|    }
 2037|  2.22M|    return lastPos;
 2038|  2.22M|}
lz4hc.c:LZ4HC_runStartPrice:
 2002|  2.22M|{
 2003|  2.22M|    int const ll = opt[pos].litlen;
 2004|  2.22M|    return (ll <= pos) ? opt[pos - ll].price : 0;
  ------------------
  |  Branch (2004:12): [True: 1.60M, False: 612k]
  ------------------
 2005|  2.22M|}
lz4hc.c:LZ4HC_sequencePrice:
 1936|   189M|{
 1937|   189M|    int price = 1 + 2 ; /* token + 16-bit offset */
 1938|   189M|    assert(litlen >= 0);
  ------------------
  |  Branch (1938:5): [True: 0, False: 189M]
  |  Branch (1938:5): [True: 189M, False: 0]
  ------------------
 1939|   189M|    assert(mlen >= MINMATCH);
  ------------------
  |  Branch (1939:5): [True: 0, False: 189M]
  |  Branch (1939:5): [True: 189M, False: 0]
  ------------------
 1940|       |
 1941|   189M|    if (mlen >= (int)(ML_MASK+MINMATCH))
  ------------------
  |  |  260|   189M|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|   189M|#define ML_BITS  4
  |  |  ------------------
  ------------------
                  if (mlen >= (int)(ML_MASK+MINMATCH))
  ------------------
  |  |  241|   189M|#define MINMATCH 4
  ------------------
  |  Branch (1941:9): [True: 164M, False: 24.4M]
  ------------------
 1942|   164M|        price += 1 + ((mlen-(int)(ML_MASK+MINMATCH)) / 255);
  ------------------
  |  |  260|   164M|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  259|   164M|#define ML_BITS  4
  |  |  ------------------
  ------------------
                      price += 1 + ((mlen-(int)(ML_MASK+MINMATCH)) / 255);
  ------------------
  |  |  241|   164M|#define MINMATCH 4
  ------------------
 1943|       |
 1944|   189M|    return price * LZ4HC_PRICE_SCALE + LZ4HC_literalsPrice(litlen);
  ------------------
  |  | 1914|   189M|#define LZ4HC_PRICE_SCALE 4
  ------------------
 1945|   189M|}
lz4hc.c:LZ4HC_setMatch:
 1991|  40.4M|{
 1992|  40.4M|    opt[pos].mlen = mlen;
 1993|  40.4M|    opt[pos].off = off;
 1994|  40.4M|    opt[pos].litlen = 0;
 1995|  40.4M|    opt[pos].price = price;
 1996|  40.4M|    DEBUGLOG(7, "rPos:%3i => price:%3i (matchlen=%i)", pos, price, mlen);
  ------------------
  |  |  288|  40.4M|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 1997|  40.4M|}
lz4hc.c:LZ4HC_dropPositions:
  614|  1.44k|{
  615|  1.44k|    U32* const hashTable = ctx->hashTable;
  616|  1.44k|    U32 const startIdx = ctx->dictLimit + (U32)(start - ctx->prefixStart);
  617|  1.44k|    if (end - start > LZ4HC_HASHTABLESIZE) {
  ------------------
  |  |  239|  1.44k|#define LZ4HC_HASHTABLESIZE (1 << LZ4HC_HASH_LOG)
  |  |  ------------------
  |  |  |  |  238|  1.44k|#define LZ4HC_HASH_LOG 15
  |  |  ------------------
  ------------------
  |  Branch (617:9): [True: 116, False: 1.33k]
  ------------------
  618|    116|        int i;
  619|  3.80M|        for (i = 0; i < LZ4HC_HASHTABLESIZE; i++) {
  ------------------
  |  |  239|  3.80M|#define LZ4HC_HASHTABLESIZE (1 << LZ4HC_HASH_LOG)
  |  |  ------------------
  |  |  |  |  238|  3.80M|#define LZ4HC_HASH_LOG 15
  |  |  ------------------
  ------------------
  |  Branch (619:21): [True: 3.80M, False: 116]
  ------------------
  620|       |            /* branchless, so that it can be vectorized */
  621|  3.80M|            hashTable[i] = (hashTable[i] >= startIdx) ? 0 : hashTable[i];
  ------------------
  |  Branch (621:28): [True: 2.06M, False: 1.73M]
  ------------------
  622|  3.80M|        }
  623|  1.33k|    } else {
  624|  1.33k|        U32 idx = startIdx;
  625|  1.33k|        const BYTE* p;
  626|  1.49M|        for (p = start; p < end; p++, idx++) {
  ------------------
  |  Branch (626:25): [True: 1.49M, False: 1.33k]
  ------------------
  627|  1.49M|            if (strat == lz4mid) {
  ------------------
  |  Branch (627:17): [True: 406k, False: 1.08M]
  ------------------
  628|   406k|                U32 const h4 = LZ4MID_hash4Ptr(p);
  629|   406k|                U32 const h8 = LZ4MID_HASHTABLESIZE + LZ4MID_hash8Ptr(p);
  ------------------
  |  |  157|   406k|#define LZ4MID_HASHTABLESIZE (1 << LZ4MID_HASHLOG)
  |  |  ------------------
  |  |  |  |  156|   406k|#define LZ4MID_HASHLOG (LZ4HC_HASH_LOG-1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|   406k|#define LZ4HC_HASH_LOG 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  630|   406k|                if (hashTable[h4] == idx) hashTable[h4] = 0;
  ------------------
  |  Branch (630:21): [True: 17.3k, False: 389k]
  ------------------
  631|   406k|                if (hashTable[h8] == idx) hashTable[h8] = 0;
  ------------------
  |  Branch (631:21): [True: 17.5k, False: 388k]
  ------------------
  632|  1.08M|            } else {
  633|  1.08M|                U32 const h = LZ4HC_hashPtr(p);
  634|  1.08M|                if (hashTable[h] == idx) hashTable[h] = 0;
  ------------------
  |  Branch (634:21): [True: 723k, False: 360k]
  ------------------
  635|  1.08M|    }   }   }
  636|  1.44k|}
lz4hc.c:LZ4HC_getCLevelParams:
  123|  17.5k|{
  124|       |    /* note : clevel convention is a bit different from lz4frame,
  125|       |     * possibly something worth revisiting for consistency */
  126|  17.5k|    if (cLevel < 1)
  ------------------
  |  Branch (126:9): [True: 0, False: 17.5k]
  ------------------
  127|      0|        cLevel = LZ4HC_CLEVEL_DEFAULT;
  ------------------
  |  |   47|      0|#define LZ4HC_CLEVEL_DEFAULT     9
  ------------------
  128|  17.5k|    cLevel = MIN(LZ4HC_CLEVEL_MAX, cLevel);
  ------------------
  |  |   91|  17.5k|#define MIN(a,b)   ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (91:22): [True: 0, False: 17.5k]
  |  |  ------------------
  ------------------
  129|  17.5k|    return k_clTable[cLevel];
  130|  17.5k|}
lz4hc.c:LZ4HC_Insert:
  886|   109M|{
  887|   109M|    U16* const chainTable = hc4->chainTable;
  888|   109M|    U32* const hashTable  = hc4->hashTable;
  889|   109M|    const BYTE* const prefixPtr = hc4->prefixStart;
  890|   109M|    U32 const prefixIdx = hc4->dictLimit;
  891|   109M|    U32 const target = (U32)(ip - prefixPtr) + prefixIdx;
  892|   109M|    U32 idx = hc4->nextToUpdate;
  893|   109M|    assert(ip >= prefixPtr);
  ------------------
  |  Branch (893:5): [True: 0, False: 109M]
  |  Branch (893:5): [True: 109M, False: 0]
  ------------------
  894|   109M|    assert(target >= prefixIdx);
  ------------------
  |  Branch (894:5): [True: 0, False: 109M]
  |  Branch (894:5): [True: 109M, False: 0]
  ------------------
  895|       |
  896|   489M|    while (idx < target) {
  ------------------
  |  Branch (896:12): [True: 380M, False: 109M]
  ------------------
  897|   380M|        U32 const h = LZ4HC_hashPtr(prefixPtr+idx-prefixIdx);
  898|   380M|        size_t delta = idx - hashTable[h];
  899|   380M|        if (delta>LZ4_DISTANCE_MAX) delta = LZ4_DISTANCE_MAX;
  ------------------
  |  |  745|   380M|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
                      if (delta>LZ4_DISTANCE_MAX) delta = LZ4_DISTANCE_MAX;
  ------------------
  |  |  745|  35.2M|#  define LZ4_DISTANCE_MAX 65535   /* set to maximum value by default */
  ------------------
  |  Branch (899:13): [True: 35.2M, False: 344M]
  ------------------
  900|   380M|        DELTANEXTU16(chainTable, idx) = (U16)delta;
  ------------------
  |  |  242|   380M|#define DELTANEXTU16(table, pos) table[(U16)(pos)]   /* faster */
  ------------------
  901|   380M|        hashTable[h] = idx;
  902|   380M|        idx++;
  903|   380M|    }
  904|       |
  905|   109M|    hc4->nextToUpdate = target;
  906|   109M|}

LLVMFuzzerTestOneInput:
   18|  8.84k|{
   19|  8.84k|    FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(data, size);
   20|  8.84k|    size_t const dstCapacitySeed = FUZZ_dataProducer_retrieve32(producer);
   21|  8.84k|    size_t const levelSeed = FUZZ_dataProducer_retrieve32(producer);
   22|  8.84k|    size = FUZZ_dataProducer_remainingBytes(producer);
   23|       |
   24|  8.84k|    size_t const dstCapacity = FUZZ_getRange_from_uint32(dstCapacitySeed, 0, size);
   25|  8.84k|    int const level = FUZZ_getRange_from_uint32(levelSeed, LZ4HC_CLEVEL_MIN, LZ4HC_CLEVEL_MAX);
  ------------------
  |  |   46|  8.84k|#define LZ4HC_CLEVEL_MIN         2
  ------------------
                  int const level = FUZZ_getRange_from_uint32(levelSeed, LZ4HC_CLEVEL_MIN, LZ4HC_CLEVEL_MAX);
  ------------------
  |  |   49|  8.84k|#define LZ4HC_CLEVEL_MAX        12
  ------------------
   26|       |
   27|  8.84k|    char* const dst = (char*)malloc(dstCapacity);
   28|  8.84k|    char* const rt = (char*)malloc(size);
   29|       |
   30|  8.84k|    FUZZ_ASSERT(dst);
  ------------------
  |  |   47|  8.84k|#define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), "")
  |  |  ------------------
  |  |  |  |   43|  8.84k|  ((cond) ? (void)0                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:4): [True: 8.84k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   44|  8.84k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   46|      0|             abort()))
  |  |  ------------------
  ------------------
   31|  8.84k|    FUZZ_ASSERT(rt);
  ------------------
  |  |   47|  8.84k|#define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), "")
  |  |  ------------------
  |  |  |  |   43|  8.84k|  ((cond) ? (void)0                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:4): [True: 8.84k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   44|  8.84k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   46|      0|             abort()))
  |  |  ------------------
  ------------------
   32|       |
   33|       |    /* If compression succeeds it must round trip correctly. */
   34|  8.84k|    {
   35|  8.84k|        int const dstSize = LZ4_compress_HC((const char*)data, dst, size,
   36|  8.84k|                                            dstCapacity, level);
   37|  8.84k|        if (dstSize > 0) {
  ------------------
  |  Branch (37:13): [True: 4.75k, False: 4.08k]
  ------------------
   38|  4.75k|            int const rtSize = LZ4_decompress_safe(dst, rt, dstSize, size);
   39|  4.75k|            FUZZ_ASSERT_MSG(rtSize == size, "Incorrect regenerated size");
  ------------------
  |  |   43|  4.75k|  ((cond) ? (void)0                                                            \
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 4.75k, False: 0]
  |  |  ------------------
  |  |   44|  4.75k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  ------------------
  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|      0|             abort()))
  ------------------
   40|  4.75k|            FUZZ_ASSERT_MSG(!memcmp(data, rt, size), "Corruption!");
  ------------------
  |  |   43|  4.75k|  ((cond) ? (void)0                                                            \
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 4.75k, False: 0]
  |  |  ------------------
  |  |   44|  4.75k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  ------------------
  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|      0|             abort()))
  ------------------
   41|  4.75k|        }
   42|  8.84k|    }
   43|       |
   44|  8.84k|    if (dstCapacity > 0) {
  ------------------
  |  Branch (44:9): [True: 8.79k, False: 48]
  ------------------
   45|       |        /* Compression succeeds and must round trip correctly. */
   46|  8.79k|        void* state = malloc(LZ4_sizeofStateHC());
   47|  8.79k|        FUZZ_ASSERT(state);
  ------------------
  |  |   47|  8.79k|#define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), "")
  |  |  ------------------
  |  |  |  |   43|  8.79k|  ((cond) ? (void)0                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:4): [True: 8.79k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   44|  8.79k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   46|      0|             abort()))
  |  |  ------------------
  ------------------
   48|  8.79k|        int compressedSize = size;
   49|  8.79k|        int const dstSize = LZ4_compress_HC_destSize(state, (const char*)data,
   50|  8.79k|                                                     dst, &compressedSize,
   51|  8.79k|                                                     dstCapacity, level);
   52|  8.79k|        FUZZ_ASSERT(dstSize > 0);
  ------------------
  |  |   47|  8.79k|#define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), "")
  |  |  ------------------
  |  |  |  |   43|  8.79k|  ((cond) ? (void)0                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:4): [True: 8.79k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   44|  8.79k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   46|      0|             abort()))
  |  |  ------------------
  ------------------
   53|  8.79k|        int const rtSize = LZ4_decompress_safe(dst, rt, dstSize, size);
   54|  8.79k|        FUZZ_ASSERT_MSG(rtSize == compressedSize, "Incorrect regenerated size");
  ------------------
  |  |   43|  8.79k|  ((cond) ? (void)0                                                            \
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 8.79k, False: 0]
  |  |  ------------------
  |  |   44|  8.79k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  ------------------
  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|      0|             abort()))
  ------------------
   55|  8.79k|        FUZZ_ASSERT_MSG(!memcmp(data, rt, compressedSize), "Corruption!");
  ------------------
  |  |   43|  8.79k|  ((cond) ? (void)0                                                            \
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 8.79k, False: 0]
  |  |  ------------------
  |  |   44|  8.79k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  ------------------
  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|      0|             abort()))
  ------------------
   56|  8.79k|        free(state);
   57|  8.79k|    }
   58|       |
   59|  8.84k|    free(dst);
   60|  8.84k|    free(rt);
   61|  8.84k|    FUZZ_dataProducer_free(producer);
   62|       |
   63|  8.84k|    return 0;
   64|  8.84k|}

FUZZ_dataProducer_create:
    8|  8.84k|FUZZ_dataProducer_t* FUZZ_dataProducer_create(const uint8_t* data, size_t size) {
    9|  8.84k|  FUZZ_dataProducer_t* const producer = malloc(sizeof(FUZZ_dataProducer_t));
   10|       |
   11|  8.84k|  FUZZ_ASSERT(producer != NULL);
  ------------------
  |  |   47|  8.84k|#define FUZZ_ASSERT(cond) FUZZ_ASSERT_MSG((cond), "")
  |  |  ------------------
  |  |  |  |   43|  8.84k|  ((cond) ? (void)0                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:4): [True: 8.84k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   44|  8.84k|          : (fprintf(stderr, "%s: %u: Assertion: `%s' failed. %s\n", __FILE__, \
  |  |  |  |   45|      0|                     __LINE__, FUZZ_QUOTE(cond), (msg)),                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      0|#define FUZZ_QUOTE(str) FUZZ_QUOTE_IMPL(str)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   36|      0|#define FUZZ_QUOTE_IMPL(str) #str
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   46|      0|             abort()))
  |  |  ------------------
  ------------------
   12|       |
   13|  8.84k|  producer->data = data;
   14|  8.84k|  producer->size = size;
   15|  8.84k|  return producer;
   16|  8.84k|}
FUZZ_dataProducer_free:
   18|  8.84k|void FUZZ_dataProducer_free(FUZZ_dataProducer_t *producer) { free(producer); }
FUZZ_dataProducer_retrieve32:
   20|  17.6k|uint32_t FUZZ_dataProducer_retrieve32(FUZZ_dataProducer_t *producer) {
   21|  17.6k|    const uint8_t* data = producer->data;
   22|  17.6k|    const size_t size = producer->size;
   23|  17.6k|    if (size == 0) {
  ------------------
  |  Branch (23:9): [True: 2, False: 17.6k]
  ------------------
   24|      2|        return 0;
   25|  17.6k|    } else if (size < 4) {
  ------------------
  |  Branch (25:16): [True: 40, False: 17.6k]
  ------------------
   26|     40|        producer->size -= 1;
   27|     40|        return (uint32_t)data[size - 1];
   28|  17.6k|    } else {
   29|  17.6k|        const uint8_t* const p = data + size - 4;
   30|  17.6k|        producer->size -= 4;
   31|  17.6k|        return (uint32_t)p[0] | ((uint32_t)p[1] << 8)
   32|  17.6k|            | ((uint32_t)p[2] << 16) | ((uint32_t)p[3] << 24);
   33|  17.6k|    }
   34|  17.6k|}
FUZZ_getRange_from_uint32:
   37|  17.6k|{
   38|  17.6k|    uint32_t range = max - min;
   39|  17.6k|    if (range == 0xffffffff) {
  ------------------
  |  Branch (39:9): [True: 0, False: 17.6k]
  ------------------
   40|      0|      return seed;
   41|      0|    }
   42|  17.6k|    return min + seed % (range + 1);
   43|  17.6k|}
FUZZ_dataProducer_remainingBytes:
   77|  8.84k|size_t FUZZ_dataProducer_remainingBytes(FUZZ_dataProducer_t *producer){
   78|  8.84k|  return producer->size;
   79|  8.84k|}

