zxc_compress.c:rapidhash_withSeed:
  487|   112k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_withSeed(const void *key, size_t len, uint64_t seed) RAPIDHASH_NOEXCEPT {
  488|   112k|  return rapidhash_internal(key, len, seed, rapid_secret);
  489|   112k|}
zxc_compress.c:rapidhash_internal:
  244|   112k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_internal(const void *key, size_t len, uint64_t seed, const uint64_t* secret) RAPIDHASH_NOEXCEPT {
  245|   112k|  const uint8_t *p=(const uint8_t *)key;
  246|   112k|  seed ^= rapid_mix(seed ^ secret[2], secret[1]);
  247|   112k|  uint64_t a=0, b=0;
  248|   112k|  size_t i = len;
  249|   112k|  if (_likely_(len <= 16)) {
  ------------------
  |  |  107|   112k| # define _likely_(x)  __builtin_expect(x,1)
  |  |  ------------------
  |  |  |  Branch (107:24): [True: 278, False: 112k]
  |  |  ------------------
  ------------------
  250|    278|    if (len >= 4) {
  ------------------
  |  Branch (250:9): [True: 240, False: 38]
  ------------------
  251|    240|      seed ^= len;
  252|    240|      if (len >= 8) {
  ------------------
  |  Branch (252:11): [True: 186, False: 54]
  ------------------
  253|    186|        const uint8_t* plast = p + len - 8;
  254|    186|        a = rapid_read64(p);
  255|    186|        b = rapid_read64(plast);
  256|    186|      } else {
  257|     54|        const uint8_t* plast = p + len - 4;
  258|     54|        a = rapid_read32(p);
  259|     54|        b = rapid_read32(plast);
  260|     54|      }
  261|    240|    } else if (len > 0) {
  ------------------
  |  Branch (261:16): [True: 38, False: 0]
  ------------------
  262|     38|      a = (((uint64_t)p[0])<<45)|p[len-1];
  263|     38|      b = p[len>>1];
  264|     38|    } else
  265|      0|      a = b = 0;
  266|   112k|  } else {
  267|   112k|    if (len > 112) {
  ------------------
  |  Branch (267:9): [True: 110k, False: 1.23k]
  ------------------
  268|   110k|      uint64_t see1 = seed, see2 = seed;
  269|   110k|      uint64_t see3 = seed, see4 = seed;
  270|   110k|      uint64_t see5 = seed, see6 = seed;
  271|   110k|#ifdef RAPIDHASH_COMPACT
  272|  5.24M|      do {
  273|  5.24M|        seed = rapid_mix(rapid_read64(p) ^ secret[0], rapid_read64(p + 8) ^ seed);
  274|  5.24M|        see1 = rapid_mix(rapid_read64(p + 16) ^ secret[1], rapid_read64(p + 24) ^ see1);
  275|  5.24M|        see2 = rapid_mix(rapid_read64(p + 32) ^ secret[2], rapid_read64(p + 40) ^ see2);
  276|  5.24M|        see3 = rapid_mix(rapid_read64(p + 48) ^ secret[3], rapid_read64(p + 56) ^ see3);
  277|  5.24M|        see4 = rapid_mix(rapid_read64(p + 64) ^ secret[4], rapid_read64(p + 72) ^ see4);
  278|  5.24M|        see5 = rapid_mix(rapid_read64(p + 80) ^ secret[5], rapid_read64(p + 88) ^ see5);
  279|  5.24M|        see6 = rapid_mix(rapid_read64(p + 96) ^ secret[6], rapid_read64(p + 104) ^ see6);
  280|  5.24M|        p += 112;
  281|  5.24M|        i -= 112;
  282|  5.24M|      } while(i > 112);
  ------------------
  |  Branch (282:15): [True: 5.13M, False: 110k]
  ------------------
  283|       |#else
  284|       |      while (i > 224) {
  285|       |        seed = rapid_mix(rapid_read64(p) ^ secret[0], rapid_read64(p + 8) ^ seed);
  286|       |        see1 = rapid_mix(rapid_read64(p + 16) ^ secret[1], rapid_read64(p + 24) ^ see1);
  287|       |        see2 = rapid_mix(rapid_read64(p + 32) ^ secret[2], rapid_read64(p + 40) ^ see2);
  288|       |        see3 = rapid_mix(rapid_read64(p + 48) ^ secret[3], rapid_read64(p + 56) ^ see3);
  289|       |        see4 = rapid_mix(rapid_read64(p + 64) ^ secret[4], rapid_read64(p + 72) ^ see4);
  290|       |        see5 = rapid_mix(rapid_read64(p + 80) ^ secret[5], rapid_read64(p + 88) ^ see5);
  291|       |        see6 = rapid_mix(rapid_read64(p + 96) ^ secret[6], rapid_read64(p + 104) ^ see6);
  292|       |        seed = rapid_mix(rapid_read64(p + 112) ^ secret[0], rapid_read64(p + 120) ^ seed);
  293|       |        see1 = rapid_mix(rapid_read64(p + 128) ^ secret[1], rapid_read64(p + 136) ^ see1);
  294|       |        see2 = rapid_mix(rapid_read64(p + 144) ^ secret[2], rapid_read64(p + 152) ^ see2);
  295|       |        see3 = rapid_mix(rapid_read64(p + 160) ^ secret[3], rapid_read64(p + 168) ^ see3);
  296|       |        see4 = rapid_mix(rapid_read64(p + 176) ^ secret[4], rapid_read64(p + 184) ^ see4);
  297|       |        see5 = rapid_mix(rapid_read64(p + 192) ^ secret[5], rapid_read64(p + 200) ^ see5);
  298|       |        see6 = rapid_mix(rapid_read64(p + 208) ^ secret[6], rapid_read64(p + 216) ^ see6);
  299|       |        p += 224;
  300|       |        i -= 224;
  301|       |      }
  302|       |      if (i > 112) {
  303|       |        seed = rapid_mix(rapid_read64(p) ^ secret[0], rapid_read64(p + 8) ^ seed);
  304|       |        see1 = rapid_mix(rapid_read64(p + 16) ^ secret[1], rapid_read64(p + 24) ^ see1);
  305|       |        see2 = rapid_mix(rapid_read64(p + 32) ^ secret[2], rapid_read64(p + 40) ^ see2);
  306|       |        see3 = rapid_mix(rapid_read64(p + 48) ^ secret[3], rapid_read64(p + 56) ^ see3);
  307|       |        see4 = rapid_mix(rapid_read64(p + 64) ^ secret[4], rapid_read64(p + 72) ^ see4);
  308|       |        see5 = rapid_mix(rapid_read64(p + 80) ^ secret[5], rapid_read64(p + 88) ^ see5);
  309|       |        see6 = rapid_mix(rapid_read64(p + 96) ^ secret[6], rapid_read64(p + 104) ^ see6);
  310|       |        p += 112;
  311|       |        i -= 112;
  312|       |      }
  313|       |#endif
  314|   110k|      seed ^= see1;
  315|   110k|      see2 ^= see3;
  316|   110k|      see4 ^= see5;
  317|   110k|      seed ^= see6;
  318|   110k|      see2 ^= see4;
  319|   110k|      seed ^= see2;
  320|   110k|    }
  321|   112k|    if (i > 16) {
  ------------------
  |  Branch (321:9): [True: 111k, False: 799]
  ------------------
  322|   111k|      seed = rapid_mix(rapid_read64(p) ^ secret[2], rapid_read64(p + 8) ^ seed);
  323|   111k|      if (i > 32) {
  ------------------
  |  Branch (323:11): [True: 110k, False: 1.01k]
  ------------------
  324|   110k|          seed = rapid_mix(rapid_read64(p + 16) ^ secret[2], rapid_read64(p + 24) ^ seed);
  325|   110k|          if (i > 48) {
  ------------------
  |  Branch (325:15): [True: 109k, False: 800]
  ------------------
  326|   109k|              seed = rapid_mix(rapid_read64(p + 32) ^ secret[1], rapid_read64(p + 40) ^ seed);
  327|   109k|              if (i > 64) {
  ------------------
  |  Branch (327:19): [True: 2.08k, False: 107k]
  ------------------
  328|  2.08k|                  seed = rapid_mix(rapid_read64(p + 48) ^ secret[1], rapid_read64(p + 56) ^ seed);
  329|  2.08k|                  if (i > 80) {
  ------------------
  |  Branch (329:23): [True: 1.34k, False: 739]
  ------------------
  330|  1.34k|                      seed = rapid_mix(rapid_read64(p + 64) ^ secret[2], rapid_read64(p + 72) ^ seed);
  331|  1.34k|                      if (i > 96) {
  ------------------
  |  Branch (331:27): [True: 682, False: 663]
  ------------------
  332|    682|                          seed = rapid_mix(rapid_read64(p + 80) ^ secret[1], rapid_read64(p + 88) ^ seed);
  333|    682|                      }
  334|  1.34k|                  }
  335|  2.08k|              }
  336|   109k|          }
  337|   110k|      }
  338|   111k|    }
  339|   112k|    a=rapid_read64(p+i-16) ^ i;  b=rapid_read64(p+i-8);
  340|   112k|  }
  341|   112k|  a ^= secret[1];
  342|   112k|  b ^= seed;
  343|   112k|  rapid_mum(&a, &b);
  344|   112k|  return rapid_mix(a ^ secret[7], b ^ secret[1] ^ i);
  345|   112k|}
zxc_compress.c:rapid_mix:
  209|  37.2M|  RAPIDHASH_INLINE_CONSTEXPR uint64_t rapid_mix(uint64_t A, uint64_t B) RAPIDHASH_NOEXCEPT { rapid_mum(&A,&B); return A^B; }
zxc_compress.c:rapid_read64:
  215|  74.3M| RAPIDHASH_INLINE uint64_t rapid_read64(const uint8_t *p) RAPIDHASH_NOEXCEPT { uint64_t v; memcpy(&v, p, sizeof(uint64_t)); return v;}
zxc_compress.c:rapid_read32:
  216|    108| RAPIDHASH_INLINE uint64_t rapid_read32(const uint8_t *p) RAPIDHASH_NOEXCEPT { uint32_t v; memcpy(&v, p, sizeof(uint32_t)); return v;}
zxc_compress.c:rapid_mum:
  157|  37.4M| RAPIDHASH_INLINE_CONSTEXPR void rapid_mum(uint64_t *A, uint64_t *B) RAPIDHASH_NOEXCEPT {
  158|  37.4M| #if defined(__SIZEOF_INT128__)
  159|  37.4M|   __uint128_t r=*A; r*=*B;
  160|       |   #ifdef RAPIDHASH_PROTECTED
  161|       |   *A^=(uint64_t)r; *B^=(uint64_t)(r>>64);
  162|       |   #else
  163|  37.4M|   *A=(uint64_t)r; *B=(uint64_t)(r>>64);
  164|  37.4M|   #endif
  165|       | #elif defined(_MSC_VER) && (defined(_WIN64) || defined(_M_HYBRID_CHPE_ARM64))
  166|       |   #if defined(_M_X64)
  167|       |     #ifdef RAPIDHASH_PROTECTED
  168|       |     uint64_t a, b;
  169|       |     a=_umul128(*A,*B,&b);
  170|       |     *A^=a;  *B^=b;
  171|       |     #else
  172|       |     *A=_umul128(*A,*B,B);
  173|       |     #endif
  174|       |   #else
  175|       |     #ifdef RAPIDHASH_PROTECTED
  176|       |     uint64_t a, b;
  177|       |     b = __umulh(*A, *B);
  178|       |     a = *A * *B;
  179|       |     *A^=a;  *B^=b;
  180|       |     #else
  181|       |     uint64_t c = __umulh(*A, *B);
  182|       |     *A = *A * *B;
  183|       |     *B = c;
  184|       |     #endif
  185|       |   #endif
  186|       | #else
  187|       |   uint64_t ha=*A>>32, hb=*B>>32, la=(uint32_t)*A, lb=(uint32_t)*B;
  188|       |   uint64_t rh=ha*hb, rm0=ha*lb, rm1=hb*la, rl=la*lb, t=rl+(rm0<<32), c=t<rl;
  189|       |   uint64_t lo=t+(rm1<<32); 
  190|       |   c+=lo<t; 
  191|       |   uint64_t hi=rh+(rm0>>32)+(rm1>>32)+c;
  192|       |   #ifdef RAPIDHASH_PROTECTED
  193|       |   *A^=lo;  *B^=hi;
  194|       |   #else
  195|       |   *A=lo;  *B=hi;
  196|       |   #endif
  197|       | #endif
  198|  37.4M| }

zxc_cctx_init_in_workspace:
  243|  45.1k|                               const int defer_entropy_scratch) {
  244|  45.1k|    if (UNLIKELY(!ctx || !workspace || chunk_size == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|   180k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 45.1k]
  |  |  |  Branch (154:42): [True: 0, False: 45.1k]
  |  |  |  Branch (154:42): [True: 0, False: 45.1k]
  |  |  |  Branch (154:42): [True: 0, False: 45.1k]
  |  |  ------------------
  ------------------
  245|       |
  246|  45.1k|    const zxc_cctx_layout_t layout =
  247|  45.1k|        compute_cctx_layout(chunk_size, mode, level, dict_size, defer_entropy_scratch);
  248|  45.1k|    if (UNLIKELY(workspace_size < layout.total)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  45.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 45.1k]
  |  |  ------------------
  ------------------
  249|       |
  250|  45.1k|    ZXC_MEMSET(ctx, 0, sizeof(zxc_cctx_t));
  ------------------
  |  |  175|  45.1k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  251|  45.1k|    ctx->checksum_enabled = checksum_enabled;
  252|  45.1k|    ctx->chunk_size = chunk_size;
  253|  45.1k|    const uint32_t offset_bits = zxc_log2_u32((uint32_t)chunk_size);
  254|  45.1k|    ctx->offset_bits = offset_bits;
  255|  45.1k|    ctx->offset_mask = (uint32_t)((1ULL << offset_bits) - 1);
  256|  45.1k|    ctx->max_epoch = (uint32_t)(1ULL << (32 - offset_bits));
  257|       |
  258|       |    // memory_block stays NULL on the static-init path so zxc_cctx_free does
  259|       |    // not try to free the caller's workspace.  Sub-buffer pointers carry the
  260|       |    // partition; ownership is implicit (the caller owns @p workspace).
  261|  45.1k|    uint8_t* const mem = (uint8_t*)workspace;
  262|       |
  263|       |    // Dictionary concat scratch (both modes); init owns dict_size now so callers
  264|       |    // no longer assign ctx->dict_size after init.
  265|  45.1k|    ctx->dict_size = dict_size;
  266|  45.1k|    if (dict_size > 0) {
  ------------------
  |  Branch (266:9): [True: 0, False: 45.1k]
  ------------------
  267|      0|        ctx->dict_buffer = mem + layout.off_dict;
  268|      0|        ctx->dict_buffer_cap = layout.sz_dict;
  269|      0|        ctx->dict_huf = (zxc_dict_huf_state_t*)(void*)(mem + layout.off_dict_huf);
  270|      0|    }
  271|       |
  272|  45.1k|    if (mode == 0) {
  ------------------
  |  Branch (272:9): [True: 34.4k, False: 10.6k]
  ------------------
  273|  34.4k|        ctx->work_buf = mem + layout.off_work;
  274|  34.4k|        ctx->work_buf_cap = chunk_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  361|  34.4k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  34.4k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  34.4k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  34.4k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  34.4k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  34.4k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  34.4k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|  34.4k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  275|  34.4k|        ctx->lit_buffer = mem + layout.off_lit_dctx;
  276|  34.4k|        ctx->lit_buffer_cap = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  34.4k|#define ZXC_PAD_SIZE 32
  ------------------
  277|  34.4k|        if (layout.sz_pivco_dctx) {
  ------------------
  |  Branch (277:13): [True: 0, False: 34.4k]
  ------------------
  278|      0|            ctx->tok_buffer = mem + layout.off_tok_dctx;
  279|      0|            ctx->tok_buffer_cap = layout.sz_tok_dctx;
  280|      0|            ctx->pivco_scratch = mem + layout.off_pivco_dctx;
  281|      0|            ctx->pivco_scratch_cap = layout.sz_pivco_dctx;
  282|      0|        }
  283|  34.4k|        return ZXC_OK;
  284|  34.4k|    }
  285|       |
  286|  10.6k|    ctx->hash_table = (uint32_t*)(mem + layout.off_hash_pos);
  287|  10.6k|    ctx->hash_tags = mem + layout.off_hash_tags;
  288|  10.6k|    ctx->chain_table = (uint16_t*)(mem + layout.off_chain);
  289|  10.6k|    ctx->buf_sequences = (uint32_t*)(mem + layout.off_seq_union);
  290|  10.6k|    ctx->buf_offsets = (uint16_t*)(mem + layout.off_seq_union);
  291|  10.6k|    ctx->buf_tokens = mem + layout.off_seq_union + layout.max_seq * sizeof(uint16_t);
  292|  10.6k|    ctx->buf_split = ctx->buf_tokens + layout.max_seq;
  293|  10.6k|    ctx->buf_split_hist = (zxc_spl_match_split_hist_t*)(void*)(mem + layout.off_split_hist);
  294|  10.6k|    ctx->buf_extras = mem + layout.off_extras;
  295|  10.6k|    ctx->literals = mem + layout.off_lit_cctx;
  296|  10.6k|    if (layout.sz_opt) {
  ------------------
  |  Branch (296:9): [True: 0, False: 10.6k]
  ------------------
  297|      0|        ctx->opt_scratch = mem + layout.off_opt;
  298|      0|        ctx->opt_scratch_cap = layout.sz_opt;
  299|      0|    }
  300|       |
  301|  10.6k|    ctx->compression_level = level;
  302|  10.6k|    ctx->epoch = 1;
  303|       |
  304|  10.6k|    ZXC_MEMSET(ctx->hash_table, 0, layout.sz_hash_pos);
  ------------------
  |  |  175|  10.6k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  305|  10.6k|    ZXC_MEMSET(ctx->hash_tags, 0, layout.sz_hash_tags);
  ------------------
  |  |  175|  10.6k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  306|  10.6k|    return ZXC_OK;
  307|  45.1k|}
zxc_cctx_init:
  320|  45.1k|                  const int level, const int checksum_enabled, const size_t dict_size) {
  321|  45.1k|    if (UNLIKELY(chunk_size == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  45.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 45.1k]
  |  |  ------------------
  ------------------
  322|       |    // Heap contexts defer the decode-side entropy scratch to the first entropy
  323|       |    // section; static workspaces must have it already, they may never allocate.
  324|  45.1k|    const int defer_entropy = (mode == 0);
  325|  45.1k|    const size_t total =
  326|  45.1k|        compute_cctx_layout(chunk_size, mode, level, dict_size, defer_entropy).total;
  327|  45.1k|    if (UNLIKELY(total == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  45.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 45.1k]
  |  |  ------------------
  ------------------
  328|       |
  329|  45.1k|    uint8_t* const mem = (uint8_t*)ZXC_ALIGNED_MALLOC(total, ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  134|  45.1k|#define ZXC_ALIGNED_MALLOC(size, alignment) zxc_aligned_malloc(size, alignment)
  ------------------
  330|  45.1k|    if (UNLIKELY(!mem)) return ZXC_ERROR_MEMORY;
  ------------------
  |  |  154|  45.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 45.1k]
  |  |  ------------------
  ------------------
  331|       |
  332|  45.1k|    const int rc = zxc_cctx_init_in_workspace(ctx, mem, total, chunk_size, mode, level,
  333|  45.1k|                                              checksum_enabled, dict_size, defer_entropy);
  334|  45.1k|    if (UNLIKELY(rc != ZXC_OK)) {
  ------------------
  |  |  154|  45.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 45.1k]
  |  |  ------------------
  ------------------
  335|       |        // LCOV_EXCL_START
  336|      0|        ZXC_ALIGNED_FREE(mem);
  ------------------
  |  |  137|      0|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  337|      0|        return rc;
  338|       |        // LCOV_EXCL_STOP
  339|      0|    }
  340|       |    // Library-owned buffer: record the allocation so zxc_cctx_free frees it.
  341|  45.1k|    ctx->memory_block = mem;
  342|  45.1k|    return ZXC_OK;
  343|  45.1k|}
zxc_cctx_free:
  380|  45.1k|void zxc_cctx_free(zxc_cctx_t* ctx) {
  381|  45.1k|    if (ctx->memory_block) {
  ------------------
  |  Branch (381:9): [True: 45.1k, False: 1]
  ------------------
  382|  45.1k|        ZXC_ALIGNED_FREE(ctx->memory_block);
  ------------------
  |  |  137|  45.1k|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  383|  45.1k|        ctx->memory_block = NULL;
  384|  45.1k|    }
  385|  45.1k|    if (ctx->entropy_block) {
  ------------------
  |  Branch (385:9): [True: 0, False: 45.1k]
  ------------------
  386|      0|        ZXC_ALIGNED_FREE(ctx->entropy_block);
  ------------------
  |  |  137|      0|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  387|      0|        ctx->entropy_block = NULL;
  388|      0|    }
  389|       |
  390|  45.1k|    ctx->lit_buffer = NULL;
  391|  45.1k|    ctx->hash_table = NULL;
  392|  45.1k|    ctx->hash_tags = NULL;
  393|  45.1k|    ctx->chain_table = NULL;
  394|  45.1k|    ctx->buf_sequences = NULL;
  395|  45.1k|    ctx->buf_tokens = NULL;
  396|  45.1k|    ctx->buf_offsets = NULL;
  397|  45.1k|    ctx->buf_extras = NULL;
  398|  45.1k|    ctx->buf_split = NULL;
  399|  45.1k|    ctx->buf_split_hist = NULL;
  400|  45.1k|    ctx->literals = NULL;
  401|  45.1k|    ctx->work_buf = NULL;
  402|  45.1k|    ctx->tok_buffer = NULL;
  403|  45.1k|    ctx->pivco_scratch = NULL;
  404|  45.1k|    ctx->opt_scratch = NULL;
  405|  45.1k|    ctx->dict_buffer = NULL;
  406|  45.1k|    ctx->dict_huf = NULL;
  407|       |
  408|  45.1k|    ctx->epoch = 0;
  409|  45.1k|    ctx->lit_buffer_cap = 0;
  410|  45.1k|    ctx->work_buf_cap = 0;
  411|  45.1k|    ctx->tok_buffer_cap = 0;
  412|  45.1k|    ctx->pivco_scratch_cap = 0;
  413|  45.1k|    ctx->opt_scratch_cap = 0;
  414|  45.1k|    ctx->dict_buffer_cap = 0;
  415|  45.1k|    ctx->dict_size = 0;
  416|  45.1k|    ctx->dict_huf_tree_ok = 0;
  417|       |    ctx->lit_freq_acc = NULL;
  418|  45.1k|}
zxc_write_file_header:
  467|  10.6k|                          const int has_checksum, const uint32_t dict_id, const int has_seek) {
  468|  10.6k|    if (UNLIKELY(dst_capacity < ZXC_FILE_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  469|       |
  470|  10.6k|    zxc_store_le32(dst, ZXC_MAGIC_WORD);
  ------------------
  |  |  117|  10.6k|#define ZXC_MAGIC_WORD 0x9CB02EF5U
  ------------------
  471|  10.6k|    dst[4] = ZXC_FILE_FORMAT_VERSION;
  ------------------
  |  |  328|  10.6k|#define ZXC_FILE_FORMAT_VERSION 9
  ------------------
  472|       |
  473|       |    // Block size stored as log2 exponent (e.g. 18 = 256 KB)
  474|  10.6k|    dst[5] = (uint8_t)zxc_log2_u32((uint32_t)chunk_size);
  475|       |
  476|  10.6k|    uint8_t flags = has_checksum ? (ZXC_FILE_FLAG_HAS_CHECKSUM | ZXC_CHECKSUM_RAPIDHASH) : 0;
  ------------------
  |  |  385|  5.57k|#define ZXC_FILE_FLAG_HAS_CHECKSUM 0x80U
  ------------------
                  uint8_t flags = has_checksum ? (ZXC_FILE_FLAG_HAS_CHECKSUM | ZXC_CHECKSUM_RAPIDHASH) : 0;
  ------------------
  |  |  452|  5.57k|#define ZXC_CHECKSUM_RAPIDHASH 0
  ------------------
  |  Branch (476:21): [True: 5.57k, False: 5.09k]
  ------------------
  477|  10.6k|    if (dict_id != 0) flags |= ZXC_FILE_FLAG_HAS_DICTIONARY;
  ------------------
  |  |  387|      0|#define ZXC_FILE_FLAG_HAS_DICTIONARY 0x40U
  ------------------
  |  Branch (477:9): [True: 0, False: 10.6k]
  ------------------
  478|  10.6k|    if (has_seek) flags |= ZXC_FILE_FLAG_HAS_SEEK_TABLE;
  ------------------
  |  |  390|  10.6k|#define ZXC_FILE_FLAG_HAS_SEEK_TABLE 0x20U
  ------------------
  |  Branch (478:9): [True: 10.6k, False: 0]
  ------------------
  479|  10.6k|    dst[6] = flags;
  480|       |
  481|       |    // Bytes 7-13: Reserved / Dictionary ID
  482|  10.6k|    ZXC_MEMSET(dst + 7, 0, 7);
  ------------------
  |  |  175|  10.6k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  483|  10.6k|    if (dict_id != 0) zxc_store_le32(dst + 7, dict_id);
  ------------------
  |  Branch (483:9): [True: 0, False: 10.6k]
  ------------------
  484|       |
  485|       |    // Bytes 14-15: Header Checksum (16-bit)
  486|  10.6k|    zxc_file_header_sign(dst);
  487|       |
  488|  10.6k|    return ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  10.6k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  489|  10.6k|}
zxc_read_file_header:
  498|  22.8k|                         uint32_t* RESTRICT out_dict_id, int* RESTRICT out_has_seek) {
  499|  22.8k|    if (UNLIKELY(src_size < ZXC_FILE_HEADER_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  22.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 228, False: 22.6k]
  |  |  ------------------
  ------------------
  500|  22.6k|    if (UNLIKELY(zxc_le32(src) != ZXC_MAGIC_WORD)) return ZXC_ERROR_BAD_MAGIC;
  ------------------
  |  |  154|  22.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.24k, False: 21.4k]
  |  |  ------------------
  ------------------
  501|  21.4k|    if (UNLIKELY(src[4] != ZXC_FILE_FORMAT_VERSION)) return ZXC_ERROR_BAD_VERSION;
  ------------------
  |  |  154|  21.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 17, False: 21.3k]
  |  |  ------------------
  ------------------
  502|       |
  503|  21.3k|    uint8_t temp[ZXC_FILE_HEADER_SIZE];
  504|  21.3k|    ZXC_MEMCPY(temp, src, ZXC_FILE_HEADER_SIZE);
  ------------------
  |  |  170|  21.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  505|       |    // Zero out checksum bytes (14-15) before hash check
  506|  21.3k|    temp[14] = 0;
  507|  21.3k|    temp[15] = 0;
  508|       |    // Header checksum (integrity), then the checksum-algorithm id in flags bits 0-3
  509|       |    // (only 0 = RapidHash is defined). It is checked first via short-circuit.
  510|  21.3k|    if (UNLIKELY(zxc_le16(src + 14) != zxc_hash16(temp) ||
  ------------------
  |  |  154|  42.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 49, False: 21.3k]
  |  |  |  Branch (154:42): [True: 46, False: 21.3k]
  |  |  |  Branch (154:42): [True: 3, False: 21.3k]
  |  |  ------------------
  ------------------
  511|  21.3k|                 (src[6] & ZXC_FILE_CHECKSUM_ALGO_MASK) != ZXC_CHECKSUM_RAPIDHASH))
  512|     49|        return ZXC_ERROR_BAD_HEADER;
  513|       |    // Reserved: flag bit 4, bytes 7-13 minus the dict_id (7-10).
  514|  21.3k|    if (UNLIKELY(src[6] & ZXC_FILE_FLAG_RESERVED)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  515|  21.3k|    uint8_t rsv = 0;
  516|   170k|    for (size_t i = (src[6] & ZXC_FILE_FLAG_HAS_DICTIONARY) ? 11 : 7; i < 14; i++) rsv |= src[i];
  ------------------
  |  |  387|  21.3k|#define ZXC_FILE_FLAG_HAS_DICTIONARY 0x40U
  ------------------
  |  Branch (516:21): [True: 0, False: 21.3k]
  |  Branch (516:71): [True: 149k, False: 21.3k]
  ------------------
  517|  21.3k|    if (UNLIKELY(rsv != 0)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 21.3k]
  |  |  ------------------
  ------------------
  518|       |
  519|  21.3k|    if (out_block_size) {
  ------------------
  |  Branch (519:9): [True: 21.3k, False: 0]
  ------------------
  520|  21.3k|        const uint8_t code = src[5];
  521|  21.3k|        if (UNLIKELY(code < ZXC_BLOCK_SIZE_MIN_LOG2 || code > ZXC_BLOCK_SIZE_MAX_LOG2))
  ------------------
  |  |  154|  42.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  522|      0|            return ZXC_ERROR_BAD_BLOCK_SIZE;
  523|       |        // Exponent encoding: block_size = 2^code  (4 KB - 2 MB)
  524|  21.3k|        *out_block_size = (size_t)1U << code;
  525|  21.3k|    }
  526|  21.3k|    if (out_has_checksum) *out_has_checksum = (src[6] & ZXC_FILE_FLAG_HAS_CHECKSUM) ? 1 : 0;
  ------------------
  |  |  385|  21.3k|#define ZXC_FILE_FLAG_HAS_CHECKSUM 0x80U
  ------------------
  |  Branch (526:9): [True: 21.3k, False: 0]
  |  Branch (526:47): [True: 11.1k, False: 10.1k]
  ------------------
  527|  21.3k|    if (out_dict_id) *out_dict_id = (src[6] & ZXC_FILE_FLAG_HAS_DICTIONARY) ? zxc_le32(src + 7) : 0;
  ------------------
  |  |  387|  21.3k|#define ZXC_FILE_FLAG_HAS_DICTIONARY 0x40U
  ------------------
  |  Branch (527:9): [True: 21.3k, False: 0]
  |  Branch (527:37): [True: 0, False: 21.3k]
  ------------------
  528|  21.3k|    if (out_has_seek) *out_has_seek = (src[6] & ZXC_FILE_FLAG_HAS_SEEK_TABLE) ? 1 : 0;
  ------------------
  |  |  390|  21.3k|#define ZXC_FILE_FLAG_HAS_SEEK_TABLE 0x20U
  ------------------
  |  Branch (528:9): [True: 21.3k, False: 0]
  |  Branch (528:39): [True: 21.3k, False: 0]
  ------------------
  529|       |
  530|  21.3k|    return ZXC_OK;
  531|  21.3k|}
zxc_scan_frame:
  555|  32.0k|                   zxc_frame_info_t* info, size_t* footer_len) {
  556|  32.0k|    uint8_t h[ZXC_FILE_HEADER_SIZE];
  557|  32.0k|    int rc;
  558|       |    // Too short for a frame: what is left starts the input, its header speaks first.
  559|  32.0k|    if (UNLIKELY(end < ZXC_FRAME_MIN_SIZE)) {
  ------------------
  |  |  154|  32.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 808, False: 31.1k]
  |  |  ------------------
  ------------------
  560|    808|        const size_t n = end < sizeof(h) ? (size_t)end : sizeof(h);
  ------------------
  |  Branch (560:26): [True: 228, False: 580]
  ------------------
  561|    808|        rc = zxc_scan_read(src, 0, h, n);
  562|    808|        return rc != ZXC_OK ? rc : zxc_short_input_verdict(h, n);
  ------------------
  |  Branch (562:16): [True: 0, False: 808]
  ------------------
  563|    808|    }
  564|  31.1k|    uint8_t tail[ZXC_FOOTER_MAX_SIZE_WITH_DIGEST];  // end > sizeof(tail)
  565|  31.1k|    rc = zxc_scan_read(src, end - sizeof(tail), tail, sizeof(tail));
  566|  31.1k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  31.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 31.1k]
  |  |  ------------------
  ------------------
  567|  31.1k|    uint64_t dsize = 0;
  568|  31.1k|    uint64_t frame = 0;
  569|  31.1k|    size_t sizes = 0;
  570|  31.1k|    rc = zxc_parse_file_footer(tail + sizeof(tail), sizeof(tail), &dsize, &frame, &sizes);
  571|  31.1k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  31.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 5.75k, False: 25.4k]
  |  |  ------------------
  ------------------
  572|  25.4k|    if (UNLIKELY(frame < ZXC_FRAME_MIN_SIZE || frame > end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  49.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.37k, False: 22.0k]
  |  |  |  Branch (154:42): [True: 1.20k, False: 24.2k]
  |  |  |  Branch (154:42): [True: 2.16k, False: 22.0k]
  |  |  ------------------
  ------------------
  573|       |
  574|  22.0k|    const uint64_t at = end - frame;
  575|  22.0k|    rc = zxc_scan_read(src, at, h, sizeof(h));
  576|  22.0k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  22.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 22.0k]
  |  |  ------------------
  ------------------
  577|  22.0k|    const size_t tl = zxc_frame_tail_len(frame);
  578|  22.0k|    rc = zxc_read_frame_info(h, tail + sizeof(tail) - tl, tl, frame, info, footer_len);
  579|       |    // Past the first frame, a wrong magic word is a broken container.
  580|  22.0k|    if (UNLIKELY(rc == ZXC_ERROR_BAD_MAGIC && at != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  22.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 677, False: 21.3k]
  |  |  |  Branch (154:42): [True: 700, False: 21.3k]
  |  |  |  Branch (154:42): [True: 677, False: 23]
  |  |  ------------------
  ------------------
  581|  21.3k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 54, False: 21.3k]
  |  |  ------------------
  ------------------
  582|  21.3k|    *start = at;
  583|  21.3k|    return ZXC_OK;
  584|  21.3k|}
zxc_read_frame_info:
  634|  22.0k|                        const uint64_t total, zxc_frame_info_t* info, size_t* footer_len) {
  635|  22.0k|    size_t chunk = 0;
  636|  22.0k|    int cs = 0;
  637|  22.0k|    int seek = 0;
  638|  22.0k|    uint32_t did = 0;
  639|  22.0k|    const int hrc = zxc_read_file_header(header, ZXC_FILE_HEADER_SIZE, &chunk, &cs, &did, &seek);
  ------------------
  |  |  120|  22.0k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  640|  22.0k|    if (UNLIKELY(hrc != ZXC_OK)) return hrc;
  ------------------
  |  |  154|  22.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 731, False: 21.3k]
  |  |  ------------------
  ------------------
  641|       |
  642|  21.3k|    uint64_t stored = 0;
  643|  21.3k|    uint64_t frame = 0;
  644|  21.3k|    size_t sizes = 0;
  645|  21.3k|    const int frc = zxc_parse_file_footer(tail + tail_len, tail_len, &stored, &frame, &sizes);
  646|  21.3k|    if (UNLIKELY(frc != ZXC_OK)) return frc;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  647|  21.3k|    const size_t flen = sizes + (cs ? (size_t)ZXC_FILE_DIGEST_SIZE : 0U);
  ------------------
  |  |  127|  11.1k|#define ZXC_FILE_DIGEST_SIZE 8
  ------------------
  |  Branch (647:34): [True: 11.1k, False: 10.1k]
  ------------------
  648|       |    // All the frame's bytes are there: a footer longer than they allow is forged.
  649|  21.3k|    if (UNLIKELY(flen > tail_len)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  650|  21.3k|    if (UNLIKELY(frame != total || !zxc_footer_dsize_plausible(stored, chunk, total)))
  ------------------
  |  |  154|  42.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  651|      0|        return ZXC_ERROR_CORRUPT_DATA;
  652|       |
  653|  21.3k|    ZXC_MEMSET(info, 0, sizeof(*info));  // padding too: zxc_frame_info_copy() hands it out
  ------------------
  |  |  175|  21.3k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  654|  21.3k|    info->decompressed_size = stored;
  655|  21.3k|    info->compressed_size = frame;
  656|  21.3k|    info->digest = cs ? zxc_le64(tail + tail_len - flen) : 0;
  ------------------
  |  Branch (656:20): [True: 11.1k, False: 10.1k]
  ------------------
  657|  21.3k|    info->block_size = chunk;
  658|  21.3k|    info->dict_id = did;
  659|  21.3k|    info->format_version = header[4];
  660|  21.3k|    info->has_checksum = (uint8_t)cs;
  661|  21.3k|    info->has_seek_table = (uint8_t)seek;
  662|  21.3k|    if (footer_len) *footer_len = flen;
  ------------------
  |  Branch (662:9): [True: 21.3k, False: 0]
  ------------------
  663|  21.3k|    return ZXC_OK;
  664|  21.3k|}
zxc_write_block_header:
  670|   934k|                           const zxc_block_header_t* RESTRICT bh) {
  671|   934k|    if (UNLIKELY(dst_capacity < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|   934k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 934k]
  |  |  ------------------
  ------------------
  672|       |
  673|   934k|    dst[0] = bh->block_type;
  674|   934k|    dst[1] = 0;  // Flags not used currently
  675|   934k|    dst[2] = 0;  // Reserved
  676|   934k|    zxc_store_le32(dst + 3, bh->comp_size);
  677|   934k|    dst[7] = 0;               // Zero before hashing
  678|   934k|    dst[7] = zxc_hash8(dst);  // Checksum at the end
  679|       |
  680|   934k|    return ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|   934k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  681|   934k|}
zxc_read_block_header:
  689|   479k|                          zxc_block_header_t* RESTRICT bh) {
  690|   479k|    if (UNLIKELY(src_size < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|   479k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 479k]
  |  |  ------------------
  ------------------
  691|       |
  692|   479k|    uint8_t temp[ZXC_BLOCK_HEADER_SIZE];
  693|   479k|    ZXC_MEMCPY(temp, src, ZXC_BLOCK_HEADER_SIZE);
  ------------------
  |  |  170|   479k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  694|   479k|    temp[7] = 0;  // Zero out checksum byte before hashing
  695|   479k|    if (UNLIKELY(src[7] != zxc_hash8(temp))) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|   479k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4.23k, False: 474k]
  |  |  ------------------
  ------------------
  696|   474k|    if (UNLIKELY((src[1] | src[2]) != 0)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|   474k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 474k]
  |  |  ------------------
  ------------------
  697|       |
  698|   474k|    bh->block_type = src[0];
  699|   474k|    bh->block_flags = src[1];
  700|   474k|    bh->reserved = src[2];
  701|   474k|    bh->comp_size = zxc_le32(src + 3);
  702|   474k|    bh->header_checksum = src[7];
  703|       |
  704|   474k|    return ZXC_OK;
  705|   474k|}
zxc_seek_table_size:
  717|  10.6k|size_t zxc_seek_table_size(const uint64_t num_blocks) {
  718|  10.6k|    if (UNLIKELY(num_blocks > UINT64_MAX / ZXC_SEEK_ANCHOR_SIZE)) return 0;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  719|  10.6k|    const uint64_t bytes = zxc_seek_table_bytes(num_blocks);
  720|  10.6k|    if (UNLIKELY(bytes > SIZE_MAX - ZXC_BLOCK_HEADER_SIZE)) return 0;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  721|  10.6k|    return ZXC_BLOCK_HEADER_SIZE + (size_t)bytes;
  ------------------
  |  |  428|  10.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  722|  10.6k|}
zxc_seek_table_header:
  724|   374k|int zxc_seek_table_header(uint8_t* dst, const size_t dst_capacity, const uint64_t num_blocks) {
  725|       |    // The field keeps the table size modulo 2^32; readers derive the count from the footer.
  726|   374k|    const zxc_block_header_t bh = {
  727|   374k|        .block_type = ZXC_BLOCK_SEK,
  728|   374k|        .block_flags = 0,
  729|   374k|        .reserved = 0,
  730|   374k|        .comp_size = zxc_seek_size_field(zxc_seek_table_bytes(num_blocks))};
  731|   374k|    return zxc_write_block_header(dst, dst_capacity, &bh);
  732|   374k|}
zxc_check_eof_header:
  734|   364k|int zxc_check_eof_header(const uint8_t* hdr) {
  735|   364k|    const zxc_block_header_t eof = {
  736|   364k|        .block_type = ZXC_BLOCK_EOF, .block_flags = 0, .reserved = 0, .comp_size = 0};
  737|   364k|    uint8_t want[ZXC_BLOCK_HEADER_SIZE];
  738|   364k|    if (UNLIKELY(zxc_write_block_header(want, sizeof(want), &eof) < 0))
  ------------------
  |  |  154|   364k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 364k]
  |  |  ------------------
  ------------------
  739|      0|        return ZXC_ERROR_BAD_HEADER;  // LCOV_EXCL_LINE
  740|   364k|    return memcmp(hdr, want, sizeof(want)) == 0 ? ZXC_OK : ZXC_ERROR_BAD_HEADER;
  ------------------
  |  Branch (740:12): [True: 364k, False: 0]
  ------------------
  741|   364k|}
zxc_check_seek_header:
  744|   364k|                          const size_t block_size, uint64_t* sek_bytes) {
  745|   364k|    const uint64_t n = zxc_seek_block_count(total_out, block_size);
  746|   364k|    uint8_t want[ZXC_BLOCK_HEADER_SIZE];
  747|   364k|    if (UNLIKELY(zxc_seek_table_header(want, sizeof(want), n) < 0))
  ------------------
  |  |  154|   364k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 364k]
  |  |  ------------------
  ------------------
  748|      0|        return ZXC_ERROR_CORRUPT_DATA;  // LCOV_EXCL_LINE
  749|   364k|    const size_t m = avail < sizeof(want) ? avail : sizeof(want);
  ------------------
  |  Branch (749:22): [True: 0, False: 364k]
  ------------------
  750|   364k|    if (memcmp(hdr, want, m) != 0) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  Branch (750:9): [True: 0, False: 364k]
  ------------------
  751|   364k|    if (avail < sizeof(want)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  Branch (751:9): [True: 0, False: 364k]
  ------------------
  752|   364k|    if (sek_bytes) *sek_bytes = zxc_seek_table_bytes(n);
  ------------------
  |  Branch (752:9): [True: 0, False: 364k]
  ------------------
  753|   364k|    return ZXC_OK;
  754|   364k|}
zxc_write_file_footer:
  820|  10.6k|                          const int checksum_enabled) {
  821|  10.6k|    const zxc_footer_layout_t l = zxc_footer_layout(prefix, src_size, checksum_enabled);
  822|  10.6k|    if (UNLIKELY(dst_capacity < l.len)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  823|  10.6k|    zxc_encode_footer(dst, &l, src_size, digest);
  824|  10.6k|    return (int)l.len;
  825|  10.6k|}
zxc_parse_file_footer:
  852|  52.5k|                          uint64_t* compressed_size, size_t* sizes_len) {
  853|  52.5k|    if (UNLIKELY(avail < ZXC_FILE_FOOTER_MIN_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  52.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 52.5k]
  |  |  ------------------
  ------------------
  854|  52.5k|    const uint8_t L = end[-1];
  855|  52.5k|    if (UNLIKELY(L & 0x88U)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  52.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 5.35k, False: 47.1k]
  |  |  ------------------
  ------------------
  856|  47.1k|    const size_t nd = (size_t)(L & 0x07U) + 1;
  857|  47.1k|    const size_t nf = (size_t)(L >> 4) + 1;
  858|  47.1k|    const size_t need = nd + nf + 1;
  859|  47.1k|    if (UNLIKELY(avail < need)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  47.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 47.1k]
  |  |  ------------------
  ------------------
  860|  47.1k|    const uint64_t d = zxc_load_le_n(end - need, nd);
  861|  47.1k|    const uint64_t f = zxc_load_le_n(end - 1 - nf, nf);
  862|       |    // Minimal lengths: d on exactly nd bytes; f too, and nf the fewest that hold
  863|       |    // the total, which one byte less would not (f counts its own bytes).
  864|  47.1k|    if (UNLIKELY(zxc_uint_bytes(d) != nd || zxc_uint_bytes(f) != nf ||
  ------------------
  |  |  154|   264k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 401, False: 46.7k]
  |  |  |  Branch (154:42): [True: 315, False: 46.8k]
  |  |  |  Branch (154:42): [True: 79, False: 46.7k]
  |  |  |  Branch (154:42): [True: 29.2k, False: 17.5k]
  |  |  |  Branch (154:42): [True: 7, False: 29.2k]
  |  |  ------------------
  ------------------
  865|  47.1k|                 (nf > 1 && zxc_uint_bytes(f - 1) < nf)))
  866|    401|        return ZXC_ERROR_CORRUPT_DATA;
  867|  46.7k|    *src_size = d;
  868|  46.7k|    *compressed_size = f;
  869|  46.7k|    *sizes_len = need;
  870|  46.7k|    return ZXC_OK;
  871|  47.1k|}
zxc_write_spl_header_and_desc:
  928|  83.9k|                                  const uint32_t tok_comp) {
  929|  83.9k|    const size_t desc_sz = zxc_spl_desc_size(gh->enc_lit, gh->enc_tok);
  930|  83.9k|    const size_t needed = ZXC_SPL_HEADER_BINARY_SIZE + desc_sz;
  ------------------
  |  |  432|  83.9k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  931|       |
  932|  83.9k|    if (UNLIKELY(rem < needed)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
  933|       |
  934|  83.9k|    zxc_write_gnr_header(dst, gh);
  935|  83.9k|    uint8_t* p = dst + ZXC_SPL_HEADER_BINARY_SIZE;
  ------------------
  |  |  432|  83.9k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  936|       |
  937|  83.9k|    if (gh->enc_lit != ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (937:9): [True: 22.4k, False: 61.5k]
  ------------------
  938|  22.4k|        zxc_store_le32(p, lit_comp);
  939|  22.4k|        p += sizeof(uint32_t);
  940|  22.4k|    }
  941|  83.9k|    if (gh->enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) {
  ------------------
  |  Branch (941:9): [True: 0, False: 83.9k]
  ------------------
  942|      0|        zxc_store_le32(p, tok_comp);
  943|      0|    }
  944|       |
  945|  83.9k|    return (int)needed;
  946|  83.9k|}
zxc_read_spl_header_and_desc:
  953|   211k|                                 uint32_t* RESTRICT tok_comp) {
  954|   211k|    if (UNLIKELY(len < ZXC_SPL_HEADER_BINARY_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|   211k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 211k]
  |  |  ------------------
  ------------------
  955|       |
  956|   211k|    zxc_read_gnr_header(src, gh);
  957|       |
  958|   211k|    const size_t desc_sz = zxc_spl_desc_size(gh->enc_lit, gh->enc_tok);
  959|   211k|    const size_t needed = ZXC_SPL_HEADER_BINARY_SIZE + desc_sz;
  ------------------
  |  |  432|   211k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  960|   211k|    if (UNLIKELY(len < needed)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|   211k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 211k]
  |  |  ------------------
  ------------------
  961|       |
  962|   211k|    const uint8_t* p = src + ZXC_SPL_HEADER_BINARY_SIZE;
  ------------------
  |  |  432|   211k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  963|       |
  964|   211k|    if (gh->enc_lit != ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (964:9): [True: 70.4k, False: 140k]
  ------------------
  965|  70.4k|        *lit_comp = zxc_le32(p);
  966|  70.4k|        p += sizeof(uint32_t);
  967|   140k|    } else {
  968|   140k|        *lit_comp = gh->n_literals;
  969|   140k|    }
  970|   211k|    *tok_comp = (gh->enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? zxc_le32(p) : gh->n_sequences;
  ------------------
  |  Branch (970:17): [True: 20, False: 211k]
  ------------------
  971|       |
  972|   211k|    return (int)needed;
  973|   211k|}
zxc_write_pak_header:
  984|  64.7k|                         const zxc_gnr_header_t* RESTRICT gh) {
  985|  64.7k|    if (UNLIKELY(rem < ZXC_PAK_HEADER_BINARY_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  64.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 64.7k]
  |  |  ------------------
  ------------------
  986|       |
  987|  64.7k|    zxc_write_gnr_header(dst, gh);
  988|  64.7k|    return ZXC_PAK_HEADER_BINARY_SIZE;
  ------------------
  |  |  434|  64.7k|#define ZXC_PAK_HEADER_BINARY_SIZE 12
  ------------------
  989|  64.7k|}
zxc_read_pak_header:
  995|   146k|                        zxc_gnr_header_t* RESTRICT gh) {
  996|   146k|    if (UNLIKELY(len < ZXC_PAK_HEADER_BINARY_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|   146k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 146k]
  |  |  ------------------
  ------------------
  997|       |
  998|   146k|    zxc_read_gnr_header(src, gh);
  999|   146k|    return ZXC_OK;
 1000|   146k|}
zxc_compress_bound:
 1015|  10.6k|size_t zxc_compress_bound(const size_t input_size) {
 1016|       |    // n <= 2^52 even for a 64-bit size_t, so the overhead sum fits a uint64.
 1017|  10.6k|    uint64_t n = (uint64_t)input_size / ZXC_BLOCK_SIZE_MIN + (input_size % ZXC_BLOCK_SIZE_MIN != 0);
  ------------------
  |  |   73|  10.6k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  10.6k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
                  uint64_t n = (uint64_t)input_size / ZXC_BLOCK_SIZE_MIN + (input_size % ZXC_BLOCK_SIZE_MIN != 0);
  ------------------
  |  |   73|  10.6k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  10.6k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
 1018|  10.6k|    if (n == 0) n = 1;
  ------------------
  |  Branch (1018:9): [True: 0, False: 10.6k]
  ------------------
 1019|  10.6k|    const uint64_t overhead =
 1020|  10.6k|        ZXC_FILE_HEADER_SIZE +
  ------------------
  |  |  120|  10.6k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
 1021|  10.6k|        (n * (ZXC_BLOCK_HEADER_SIZE + ZXC_BLOCK_CHECKSUM_SIZE + ZXC_BLOCK_FORMAT_OVERHEAD)) +
  ------------------
  |  |  428|  10.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                      (n * (ZXC_BLOCK_HEADER_SIZE + ZXC_BLOCK_CHECKSUM_SIZE + ZXC_BLOCK_FORMAT_OVERHEAD)) +
  ------------------
  |  |  430|  10.6k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
                      (n * (ZXC_BLOCK_HEADER_SIZE + ZXC_BLOCK_CHECKSUM_SIZE + ZXC_BLOCK_FORMAT_OVERHEAD)) +
  ------------------
  |  |  446|  10.6k|#define ZXC_BLOCK_FORMAT_OVERHEAD 68
  ------------------
 1022|  10.6k|        ZXC_BLOCK_HEADER_SIZE +          /* EOF block */
  ------------------
  |  |  428|  10.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1023|  10.6k|        ZXC_BLOCK_HEADER_SIZE +          /* SEK block header (seekable) */
  ------------------
  |  |  428|  10.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1024|  10.6k|        zxc_seek_table_bytes(n) +        /* SEK groups (seekable) */
 1025|  10.6k|        ZXC_FOOTER_MAX_SIZE_WITH_DIGEST; /* optional digest + footer */
  ------------------
  |  | 2445|  10.6k|#define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  127|  10.6k|#define ZXC_FILE_DIGEST_SIZE 8
  |  |  ------------------
  |  |               #define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  125|  10.6k|#define ZXC_FILE_FOOTER_MAX_SIZE 17
  |  |  ------------------
  ------------------
 1026|       |    // The bound is a buffer size: input + overhead must fit a size_t.
 1027|  10.6k|    if (UNLIKELY(overhead > (uint64_t)(SIZE_MAX - input_size))) return 0;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1028|  10.6k|    return input_size + (size_t)overhead;
 1029|  10.6k|}
zxc_common.c:compute_cctx_layout:
  122|  90.2k|                                             const int defer_entropy_scratch) {
  123|  90.2k|    zxc_cctx_layout_t layout = {0};
  124|       |
  125|  90.2k|    const size_t max_seq = zxc_cctx_max_seq(chunk_size);
  126|       |
  127|  90.2k|    if (mode == 0) {
  ------------------
  |  Branch (127:9): [True: 68.9k, False: 21.3k]
  ------------------
  128|       |        // Decompress: work_buf + lit_buffer, padded for wild-copy overshoot and
  129|       |        // sized worst-case. lit_buffer is provisioned at every level - the decoder
  130|       |        // cannot predict a block's literal encoding (RAW / RLE / HUFFMAN).
  131|  68.9k|        const size_t sz_work = chunk_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  361|  68.9k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  68.9k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  68.9k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  68.9k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  68.9k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  68.9k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  68.9k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|  68.9k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  132|  68.9k|        const size_t sz_lit = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  68.9k|#define ZXC_PAD_SIZE 32
  ------------------
  133|       |
  134|  68.9k|        layout.off_work = layout.total;
  135|  68.9k|        layout.total += ZXC_ALIGN_CL(sz_work);
  ------------------
  |  |  373|  68.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  68.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  68.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  68.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  68.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|  68.9k|        layout.off_lit_dctx = layout.total;
  137|  68.9k|        layout.total += ZXC_ALIGN_CL(sz_lit);
  ------------------
  |  |  373|  68.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  68.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  68.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  68.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  68.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  138|       |        // Token-section decode scratch (level-7 SPL Huffman-codes the tokens) +
  139|       |        // PivCo ping-pong scratch. enc_lit/enc_tok are unpredictable, so static
  140|       |        // workspaces provision both up front (no-alloc contract); heap contexts
  141|       |        // defer them to the first entropy section, sparing L1-5 archives ~1.2x
  142|       |        // chunk_size. See zxc_cctx_alloc_entropy_scratch.
  143|  68.9k|        if (!defer_entropy_scratch) {
  ------------------
  |  Branch (143:13): [True: 0, False: 68.9k]
  ------------------
  144|      0|            size_t sz_tok = 0;
  145|      0|            size_t sz_pivco = 0;
  146|      0|            zxc_dctx_entropy_sizes(chunk_size, &sz_tok, &sz_pivco);
  147|      0|            layout.sz_tok_dctx = sz_tok;
  148|      0|            layout.off_tok_dctx = layout.total;
  149|      0|            layout.total += ZXC_ALIGN_CL(layout.sz_tok_dctx);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|      0|            layout.sz_pivco_dctx = sz_pivco;
  151|      0|            layout.off_pivco_dctx = layout.total;
  152|      0|            layout.total += ZXC_ALIGN_CL(layout.sz_pivco_dctx);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|      0|        }
  154|  68.9k|    } else {
  155|       |        // Compress: 7 partitions + optional opt_scratch at level >= ZXC_LEVEL_DENSITY.
  156|  21.3k|        const uint32_t offset_bits = zxc_log2_u32((uint32_t)chunk_size);
  157|  21.3k|        layout.max_seq = max_seq;
  158|  21.3k|        layout.sz_hash_pos = ZXC_LZ_HASH_SIZE * sizeof(uint32_t);
  ------------------
  |  |  569|  21.3k|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  ------------------
  |  |  |  |  567|  21.3k|#define ZXC_LZ_HASH_BITS 15
  |  |  ------------------
  ------------------
  159|  21.3k|        layout.sz_hash_tags = ZXC_LZ_HASH_SIZE * sizeof(uint8_t);
  ------------------
  |  |  569|  21.3k|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  ------------------
  |  |  |  |  567|  21.3k|#define ZXC_LZ_HASH_BITS 15
  |  |  ------------------
  ------------------
  160|  21.3k|        const size_t sz_chain = ZXC_LZ_WINDOW_SIZE * sizeof(uint16_t);
  ------------------
  |  |  571|  21.3k|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  ------------------
  161|       |        // buf_sequences (PAK, level <= ZXC_LEVEL_FAST) aliases buf_offsets, buf_tokens and
  162|       |        // buf_split (SPL, level >= ZXC_LEVEL_DEFAULT): 4 bytes per sequence either way.
  163|  21.3k|        const size_t sz_seq_union = layout.max_seq * sizeof(uint32_t);
  164|  21.3k|        const size_t vbyte_len = (offset_bits + 6) / 7;
  165|  21.3k|        const size_t sz_extras = layout.max_seq * 2 * vbyte_len;
  166|  21.3k|        const size_t sz_lit = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  21.3k|#define ZXC_PAD_SIZE 32
  ------------------
  167|       |
  168|       |        // opt_scratch (level >= ZXC_LEVEL_DENSITY): the optimal parser's DP arrays,
  169|       |        // reused transiently by the code-length builder and its nudge, so sized to
  170|       |        // the larger demand. Keep in sync with zxc_estimate_cctx_size() and its
  171|       |        // consumer in zxc_compress.c.
  172|  21.3k|        if (level >= ZXC_LEVEL_DENSITY) {
  ------------------
  |  Branch (172:13): [True: 0, False: 21.3k]
  ------------------
  173|      0|            size_t sz_dp;
  174|      0|            size_t sz_pl;
  175|      0|            size_t sz_po;
  176|      0|            size_t sz_bm;
  177|      0|            zxc_opt_dp_sizes(chunk_size, &sz_dp, &sz_pl, &sz_po, &sz_bm);
  178|      0|            const size_t dp_needed = sz_dp + sz_pl + sz_po + sz_bm;
  179|      0|            layout.sz_opt =
  180|      0|                (dp_needed > ZXC_HUF_NUDGE_SCRATCH_SIZE) ? dp_needed : ZXC_HUF_NUDGE_SCRATCH_SIZE;
  ------------------
  |  | 1091|      0|#define ZXC_HUF_NUDGE_SCRATCH_SIZE (ZXC_HUF_NUDGE_SCRATCH_OFF + sizeof(zxc_huf_nudge_ws_t))
  |  |  ------------------
  |  |  |  | 1089|      0|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (dp_needed > ZXC_HUF_NUDGE_SCRATCH_SIZE) ? dp_needed : ZXC_HUF_NUDGE_SCRATCH_SIZE;
  ------------------
  |  | 1091|      0|#define ZXC_HUF_NUDGE_SCRATCH_SIZE (ZXC_HUF_NUDGE_SCRATCH_OFF + sizeof(zxc_huf_nudge_ws_t))
  |  |  ------------------
  |  |  |  | 1089|      0|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (180:17): [True: 0, False: 0]
  ------------------
  181|      0|        }
  182|       |
  183|  21.3k|        layout.off_hash_pos = layout.total;
  184|  21.3k|        layout.total += ZXC_ALIGN_CL(layout.sz_hash_pos);
  ------------------
  |  |  373|  21.3k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  21.3k|        layout.off_hash_tags = layout.total;
  186|  21.3k|        layout.total += ZXC_ALIGN_CL(layout.sz_hash_tags);
  ------------------
  |  |  373|  21.3k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|  21.3k|        layout.off_chain = layout.total;
  188|  21.3k|        layout.total += ZXC_ALIGN_CL(sz_chain);
  ------------------
  |  |  373|  21.3k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|  21.3k|        layout.off_seq_union = layout.total;
  190|  21.3k|        layout.total += ZXC_ALIGN_CL(sz_seq_union);
  ------------------
  |  |  373|  21.3k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  21.3k|        layout.off_split_hist = layout.total;
  192|  21.3k|        layout.total += ZXC_ALIGN_CL(sizeof(zxc_spl_match_split_hist_t));
  ------------------
  |  |  373|  21.3k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  21.3k|        layout.off_extras = layout.total;
  194|  21.3k|        layout.total += ZXC_ALIGN_CL(sz_extras);
  ------------------
  |  |  373|  21.3k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  21.3k|        layout.off_lit_cctx = layout.total;
  196|  21.3k|        layout.total += ZXC_ALIGN_CL(sz_lit);
  ------------------
  |  |  373|  21.3k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  21.3k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  21.3k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |        // opt_scratch is appended last so it is absent for levels 1..5 (zero
  198|       |        // waste on the common path) and only inflates the workspace at level 6.
  199|  21.3k|        if (layout.sz_opt) {
  ------------------
  |  Branch (199:13): [True: 0, False: 21.3k]
  ------------------
  200|      0|            layout.off_opt = layout.total;
  201|      0|            layout.total += ZXC_ALIGN_CL(layout.sz_opt);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|      0|        }
  203|  21.3k|    }
  204|       |
  205|       |    // [dict | data] concat scratch (dict only). Compress chunk_size already
  206|       |    // spans [dict | block]; decompress prepends dict to a (chunk + PAD) region.
  207|  90.2k|    if (dict_size > 0) {
  ------------------
  |  Branch (207:9): [True: 0, False: 90.2k]
  ------------------
  208|      0|        layout.sz_dict = (mode == 1) ? (chunk_size + ZXC_DECOMPRESS_TAIL_PAD)
  ------------------
  |  |  361|      0|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|      0|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|      0|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|      0|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|      0|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (208:26): [True: 0, False: 0]
  ------------------
  209|      0|                                     : (dict_size + chunk_size + ZXC_DECOMPRESS_TAIL_PAD);
  ------------------
  |  |  361|      0|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|      0|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|      0|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|      0|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|      0|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  210|      0|        layout.off_dict = layout.total;
  211|      0|        layout.total += ZXC_ALIGN_CL(layout.sz_dict);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|      0|        layout.off_dict_huf = layout.total;
  213|      0|        layout.total += ZXC_ALIGN_CL(sizeof(zxc_dict_huf_state_t));
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|      0|    }
  215|  90.2k|    return layout;
  216|  90.2k|}
zxc_common.c:zxc_cctx_max_seq:
   74|  90.2k|static ZXC_ALWAYS_INLINE size_t zxc_cctx_max_seq(const size_t chunk_size) {
   75|  90.2k|    return chunk_size / ZXC_LZ_MIN_MATCH_LEN + 16;
  ------------------
  |  |  575|  90.2k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
   76|  90.2k|}
zxc_common.c:zxc_scan_read:
  535|  54.0k|                         const size_t len) {
  536|  54.0k|    if (UNLIKELY(off > src->size || (uint64_t)len > src->size - off))
  ------------------
  |  |  154|   108k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 54.0k]
  |  |  |  Branch (154:42): [True: 0, False: 54.0k]
  |  |  |  Branch (154:42): [True: 0, False: 54.0k]
  |  |  ------------------
  ------------------
  537|      0|        return ZXC_ERROR_SRC_TOO_SMALL;
  538|  54.0k|    if (src->read_at) return src->read_at(src, off, dst, len);
  ------------------
  |  Branch (538:9): [True: 54.0k, False: 0]
  ------------------
  539|      0|    ZXC_MEMCPY(dst, src->data + off, len);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  540|      0|    return ZXC_OK;
  541|  54.0k|}
zxc_common.c:zxc_encode_footer:
  805|  10.6k|                              const uint64_t digest) {
  806|  10.6k|    if (l->skip) zxc_store_le64(dst, digest);
  ------------------
  |  Branch (806:9): [True: 5.57k, False: 5.09k]
  ------------------
  807|  10.6k|    uint8_t* p = dst + l->skip;
  808|  10.6k|    zxc_store_le_n(p, src_size, l->nd);
  809|  10.6k|    p += l->nd;
  810|  10.6k|    zxc_store_le_n(p, l->compressed_size, l->nf);
  811|  10.6k|    p[l->nf] = (uint8_t)((l->nd - 1) | (l->nf - 1) << 4);
  812|  10.6k|}
zxc_common.c:zxc_store_le_n:
  792|  21.3k|static void zxc_store_le_n(uint8_t* dst, uint64_t v, const size_t n) {
  793|  61.6k|    for (size_t i = 0; i < n; i++, v >>= 8) dst[i] = (uint8_t)v;
  ------------------
  |  Branch (793:24): [True: 40.3k, False: 21.3k]
  ------------------
  794|  21.3k|}
zxc_common.c:zxc_load_le_n:
  797|  94.3k|static uint64_t zxc_load_le_n(const uint8_t* src, const size_t n) {
  798|  94.3k|    uint64_t v = 0;
  799|   284k|    for (size_t i = n; i > 0; i--) v = (v << 8) | src[i - 1];
  ------------------
  |  Branch (799:24): [True: 190k, False: 94.3k]
  ------------------
  800|  94.3k|    return v;
  801|  94.3k|}
zxc_common.c:zxc_spl_desc_size:
  912|   294k|static ZXC_ALWAYS_INLINE size_t zxc_spl_desc_size(const uint8_t enc_lit, const uint8_t enc_tok) {
  913|   294k|    return ((enc_lit != ZXC_SECTION_ENCODING_RAW) ? sizeof(uint32_t) : 0) +
  ------------------
  |  Branch (913:13): [True: 92.8k, False: 201k]
  ------------------
  914|   294k|           ((enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? sizeof(uint32_t) : 0);
  ------------------
  |  Branch (914:13): [True: 20, False: 294k]
  ------------------
  915|   294k|}
zxc_common.c:zxc_write_gnr_header:
  880|   148k|                                                   const zxc_gnr_header_t* RESTRICT gh) {
  881|   148k|    zxc_store_le32(dst, gh->n_sequences);
  882|   148k|    zxc_store_le32(dst + 4, gh->n_literals);
  883|       |
  884|   148k|    dst[8] = gh->enc_lit;
  885|   148k|    dst[9] = gh->enc_tok;
  886|   148k|    dst[10] = gh->enc_mlen;
  887|   148k|    dst[11] = gh->enc_off;
  888|   148k|}
zxc_common.c:zxc_read_gnr_header:
  897|   357k|                                                  zxc_gnr_header_t* RESTRICT gh) {
  898|   357k|    gh->n_sequences = zxc_le32(src);
  899|   357k|    gh->n_literals = zxc_le32(src + 4);
  900|   357k|    gh->enc_lit = src[8];
  901|   357k|    gh->enc_tok = src[9];
  902|   357k|    gh->enc_mlen = src[10];
  903|   357k|    gh->enc_off = src[11];
  904|   357k|}

zxc_compress_chunk_wrapper_default:
 2221|   148k|                               const uint64_t block_index) {
 2222|   148k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|   148k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 148k]
  |  |  ------------------
  ------------------
 2223|       |
 2224|   148k|    const size_t dict_sz = ctx->dict_size;
 2225|   148k|    const size_t block_sz = src_sz - dict_sz;
 2226|   148k|    const uint8_t* block_data = chunk + dict_sz;
 2227|   148k|    size_t w = 0;
 2228|   148k|    int res = ZXC_OK;
 2229|       |
 2230|   148k|    if (ctx->compression_level <= 2)
  ------------------
  |  Branch (2230:9): [True: 64.7k, False: 83.9k]
  ------------------
 2231|  64.7k|        res = zxc_encode_block_pak(ctx, chunk, src_sz, dst, dst_cap, &w);
 2232|  83.9k|    else
 2233|  83.9k|        res = zxc_encode_block_spl(ctx, chunk, src_sz, dst, dst_cap, &w);
 2234|       |
 2235|       |    // Check expansion against block data size (excluding dict prefix).
 2236|   148k|    if (UNLIKELY(res != ZXC_OK || w >= block_sz)) {
  ------------------
  |  |  154|   297k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 36.1k, False: 112k]
  |  |  |  Branch (154:42): [True: 0, False: 148k]
  |  |  |  Branch (154:42): [True: 36.1k, False: 112k]
  |  |  ------------------
  ------------------
 2237|  36.1k|        res = zxc_encode_block_raw(block_data, block_sz, dst, dst_cap, &w);
 2238|  36.1k|        if (UNLIKELY(res != ZXC_OK)) return res;
  ------------------
  |  |  154|  36.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 36.1k]
  |  |  ------------------
  ------------------
 2239|  36.1k|    }
 2240|       |
 2241|   148k|    if (ctx->checksum_enabled) {
  ------------------
  |  Branch (2241:9): [True: 112k, False: 36.2k]
  ------------------
 2242|   112k|        if (UNLIKELY(w + ZXC_BLOCK_CHECKSUM_SIZE > dst_cap)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|   112k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 112k]
  |  |  ------------------
  ------------------
 2243|       |
 2244|   112k|        zxc_store_le32(dst + w,
 2245|   112k|                       zxc_checksum(block_data, block_sz, block_index, ZXC_CHECKSUM_RAPIDHASH));
  ------------------
  |  |  452|   112k|#define ZXC_CHECKSUM_RAPIDHASH 0
  ------------------
 2246|   112k|        w += ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  430|   112k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
 2247|   112k|    }
 2248|       |
 2249|   148k|    return (int)w;
 2250|   148k|}
zxc_compress.c:zxc_encode_block_pak:
 2021|  64.7k|                                size_t* RESTRICT const out_sz) {
 2022|  64.7k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  64.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 64.7k]
  |  |  ------------------
  ------------------
 2023|       |
 2024|  64.7k|    const int level = ctx->compression_level;
 2025|  64.7k|    const size_t dict_sz = ctx->dict_size;
 2026|       |
 2027|  64.7k|    zxc_lz77_params_t lzp = zxc_get_lz77_params(level);
 2028|       |    // The floor is a candidate until the block itself clears it.
 2029|  64.7k|    if (lzp.min_offset > 1 && zxc_block_is_short_dist_bound(src + dict_sz, src_sz - dict_sz))
  ------------------
  |  Branch (2029:9): [True: 64.7k, False: 0]
  |  Branch (2029:31): [True: 36.8k, False: 27.8k]
  ------------------
 2030|  36.8k|        lzp.min_offset = 1;
 2031|       |
 2032|  64.7k|    ctx->epoch++;
 2033|  64.7k|    if (UNLIKELY(ctx->epoch >= ctx->max_epoch)) {
  ------------------
  |  |  154|  64.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 64.7k]
  |  |  ------------------
  ------------------
 2034|      0|        ZXC_MEMSET(ctx->hash_table, 0, ZXC_LZ_HASH_SIZE * sizeof(uint32_t));
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2035|      0|        ZXC_MEMSET(ctx->hash_tags, 0, ZXC_LZ_HASH_SIZE * sizeof(uint8_t));
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2036|      0|        ctx->epoch = 1;
 2037|      0|    }
 2038|  64.7k|    const uint32_t offset_bits = ctx->offset_bits;
 2039|  64.7k|    const uint32_t offset_mask = ctx->offset_mask;
 2040|  64.7k|    const uint32_t epoch_mark = ctx->epoch << offset_bits;
 2041|       |
 2042|  64.7k|    if (dict_sz > 0)
  ------------------
  |  Branch (2042:9): [True: 0, False: 64.7k]
  ------------------
 2043|      0|        zxc_lz_seed_dict(src, dict_sz, ctx->hash_table, ctx->hash_tags, ctx->chain_table,
 2044|      0|                         epoch_mark, offset_mask, level);
 2045|       |
 2046|  64.7k|    const uint8_t* ip = src + dict_sz;
 2047|  64.7k|    const uint8_t* iend = src + src_sz;
 2048|  64.7k|    const uint8_t* anchor = ip;
 2049|  64.7k|    const uint8_t* search_limit = iend - ZXC_LZ_SEARCH_MARGIN;
  ------------------
  |  |  717|  64.7k|#define ZXC_LZ_SEARCH_MARGIN (sizeof(uint64_t))
  ------------------
 2050|       |
 2051|  64.7k|    uint32_t* const hash_table = ctx->hash_table;
 2052|  64.7k|    uint8_t* const hash_tags = ctx->hash_tags;
 2053|  64.7k|    uint8_t* const buf_extras = ctx->buf_extras;
 2054|  64.7k|    uint16_t* const chain_table = ctx->chain_table;
 2055|  64.7k|    uint8_t* const literals = ctx->literals;
 2056|  64.7k|    uint32_t* const buf_sequences = ctx->buf_sequences;
 2057|       |
 2058|  64.7k|    uint32_t seq_c = 0;
 2059|  64.7k|    size_t extras_c = 0;
 2060|  64.7k|    size_t lit_c = 0;
 2061|       |
 2062|  19.1M|    while (LIKELY(ip < search_limit)) {
  ------------------
  |  |  148|  19.1M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 19.0M, False: 64.7k]
  |  |  ------------------
  ------------------
 2063|  19.0M|        size_t dist = (size_t)(ip - anchor);
 2064|  19.0M|        size_t step = lzp.step_base + (dist >> lzp.step_shift);
 2065|  19.0M|        if (UNLIKELY(ip + step >= search_limit)) step = 1;
  ------------------
  |  |  154|  19.0M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.61M, False: 15.4M]
  |  |  ------------------
  ------------------
 2066|       |
 2067|  19.0M|        ZXC_PREFETCH_READ(ip + step * 4 + ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  165|  19.0M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2068|       |
 2069|  19.0M|        if (LIKELY(ip + step + sizeof(uint64_t) <= iend)) {
  ------------------
  |  |  148|  19.0M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 19.0M, False: 0]
  |  |  ------------------
  ------------------
 2070|  19.0M|            const uint64_t v_next = zxc_le64(ip + step);
 2071|       |            // cppcheck-suppress unreadVariable
 2072|  19.0M|            const uint32_t h_next = zxc_hash_func(v_next, 0);
 2073|  19.0M|            ZXC_PREFETCH_READ(&hash_tags[h_next]);
  ------------------
  |  |  165|  19.0M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2074|  19.0M|            ZXC_PREFETCH_READ(&hash_table[h_next]);
  ------------------
  |  |  165|  19.0M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2075|  19.0M|        }
 2076|       |
 2077|  19.0M|        const zxc_match_t m =
 2078|  19.0M|            zxc_lz77_find_best_match(src, ip, iend, search_limit, anchor, hash_table, hash_tags,
 2079|  19.0M|                                     chain_table, epoch_mark, offset_mask, level, lzp,
 2080|  19.0M|                                     /*last_off=*/0U);
 2081|       |
 2082|  19.0M|        if (m.ref) {
  ------------------
  |  Branch (2082:13): [True: 3.13M, False: 15.9M]
  ------------------
 2083|  3.13M|            ip -= m.backtrack;
 2084|  3.13M|            const uint32_t ll = (uint32_t)(ip - anchor);
 2085|  3.13M|            const uint32_t ml = m.len - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  3.13M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 2086|  3.13M|            const uint32_t off = (uint32_t)(ip - m.ref);
 2087|       |
 2088|  3.13M|            if (ll > 0) zxc_flush_literals(literals, &lit_c, anchor, ll, iend);
  ------------------
  |  Branch (2088:17): [True: 1.29M, False: 1.84M]
  ------------------
 2089|       |
 2090|  3.13M|            const uint32_t ll_write = (ll >= ZXC_SEQ_LL_MASK) ? ZXC_SEQ_LL_MASK : ll;
  ------------------
  |  |  528|  3.13M|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|  3.13M|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
                          const uint32_t ll_write = (ll >= ZXC_SEQ_LL_MASK) ? ZXC_SEQ_LL_MASK : ll;
  ------------------
  |  |  528|  49.5k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|  49.5k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
  |  Branch (2090:39): [True: 49.5k, False: 3.08M]
  ------------------
 2091|  3.13M|            const uint32_t ml_write = (ml >= ZXC_SEQ_ML_MASK) ? ZXC_SEQ_ML_MASK : ml;
  ------------------
  |  |  530|  3.13M|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|  3.13M|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
                          const uint32_t ml_write = (ml >= ZXC_SEQ_ML_MASK) ? ZXC_SEQ_ML_MASK : ml;
  ------------------
  |  |  530|   155k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|   155k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
  |  Branch (2091:39): [True: 155k, False: 2.98M]
  ------------------
 2092|  3.13M|            const uint32_t seq_val = (ll_write << ZXC_SEQ_LL_SHIFT) |
  ------------------
  |  |  534|  3.13M|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|  3.13M|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|  3.13M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2093|  3.13M|                                     (ml_write << ZXC_SEQ_ML_SHIFT) |
  ------------------
  |  |  536|  3.13M|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|  3.13M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2094|  3.13M|                                     ((off - ZXC_LZ_OFFSET_BIAS) & ZXC_SEQ_OFF_MASK);
  ------------------
  |  |  676|  3.13M|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
                                                   ((off - ZXC_LZ_OFFSET_BIAS) & ZXC_SEQ_OFF_MASK);
  ------------------
  |  |  532|  3.13M|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|  3.13M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2095|  3.13M|            buf_sequences[seq_c] = seq_val;
 2096|  3.13M|            seq_c++;
 2097|       |
 2098|  3.13M|            if (UNLIKELY(!zxc_emit_extra(buf_extras, &extras_c, ll, ZXC_SEQ_LL_MASK) ||
  ------------------
  |  |  154|  6.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 3.13M]
  |  |  |  Branch (154:42): [True: 0, False: 3.13M]
  |  |  |  Branch (154:42): [True: 0, False: 3.13M]
  |  |  ------------------
  ------------------
 2099|  3.13M|                         !zxc_emit_extra(buf_extras, &extras_c, ml, ZXC_SEQ_ML_MASK)))
 2100|      0|                return ZXC_ERROR_OVERFLOW;
 2101|       |
 2102|  3.13M|            ip += m.len;
 2103|  3.13M|            anchor = ip;
 2104|  15.9M|        } else {
 2105|  15.9M|            ip += step;
 2106|  15.9M|        }
 2107|  19.0M|    }
 2108|       |
 2109|  64.7k|    const size_t last_lits = (size_t)(iend - anchor);
 2110|  64.7k|    if (last_lits > 0) {
  ------------------
  |  Branch (2110:9): [True: 34.7k, False: 30.0k]
  ------------------
 2111|  34.7k|        ZXC_MEMCPY(literals + lit_c, anchor, last_lits);
  ------------------
  |  |  170|  34.7k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2112|  34.7k|        lit_c += last_lits;
 2113|  34.7k|    }
 2114|       |
 2115|  64.7k|    zxc_block_header_t bh = {.block_type = ZXC_BLOCK_PAK};
 2116|  64.7k|    uint8_t* const p = dst + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  64.7k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2117|  64.7k|    size_t rem = dst_cap - ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  64.7k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2118|       |
 2119|  64.7k|    const zxc_gnr_header_t gh = {.n_sequences = seq_c,
 2120|  64.7k|                                 .n_literals = (uint32_t)lit_c,
 2121|  64.7k|                                 .enc_lit = ZXC_SECTION_ENCODING_RAW,
 2122|  64.7k|                                 .enc_tok = 0,
 2123|  64.7k|                                 .enc_mlen = 0,
 2124|  64.7k|                                 .enc_off = 0};
 2125|       |
 2126|  64.7k|    const int ghs = zxc_write_pak_header(p, rem, &gh);
 2127|  64.7k|    if (UNLIKELY(ghs < 0)) return ghs;
  ------------------
  |  |  154|  64.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 64.7k]
  |  |  ------------------
  ------------------
 2128|       |
 2129|  64.7k|    uint8_t* p_curr = p + ghs;
 2130|  64.7k|    rem -= (size_t)ghs;
 2131|       |
 2132|  64.7k|    const size_t sz_lit = lit_c;
 2133|  64.7k|    const size_t sz_seq = seq_c * sizeof(uint32_t);
 2134|  64.7k|    const size_t sz_ext = extras_c;
 2135|       |
 2136|       |    // See the SPL twin. PAK literals are always RAW, so the slack always
 2137|       |    // matters here.
 2138|  64.7k|    const size_t behind_lit = sz_seq + sz_ext;
 2139|  64.7k|    const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  345|  64.7k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
                  const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  345|  41.5k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
  |  Branch (2139:24): [True: 41.5k, False: 23.2k]
  ------------------
 2140|       |
 2141|  64.7k|    if (UNLIKELY(rem < sz_lit + sz_seq + sz_ext + pad)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  64.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 64.7k]
  |  |  ------------------
  ------------------
 2142|       |
 2143|  64.7k|    ZXC_MEMCPY(p_curr, literals, lit_c);
  ------------------
  |  |  170|  64.7k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2144|  64.7k|    p_curr += lit_c;
 2145|       |
 2146|       |    // Write sequences in little-endian order
 2147|       |#ifdef ZXC_BIG_ENDIAN
 2148|       |    for (uint32_t i = 0; i < seq_c; i++) {
 2149|       |        zxc_store_le32(p_curr, buf_sequences[i]);
 2150|       |        p_curr += sizeof(uint32_t);
 2151|       |    }
 2152|       |#else
 2153|  64.7k|    ZXC_MEMCPY(p_curr, buf_sequences, sz_seq);
  ------------------
  |  |  170|  64.7k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2154|  64.7k|    p_curr += sz_seq;
 2155|  64.7k|#endif
 2156|       |
 2157|       |    // --- WRITE EXTRAS ---
 2158|  64.7k|    ZXC_MEMCPY(p_curr, buf_extras, sz_ext);
  ------------------
  |  |  170|  64.7k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2159|  64.7k|    p_curr += sz_ext;
 2160|       |
 2161|  64.7k|    ZXC_MEMSET(p_curr, 0, pad);
  ------------------
  |  |  175|  64.7k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2162|  64.7k|    p_curr += pad;
 2163|       |
 2164|  64.7k|    bh.comp_size = (uint32_t)(p_curr - (dst + ZXC_BLOCK_HEADER_SIZE));
  ------------------
  |  |  428|  64.7k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2165|  64.7k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 2166|  64.7k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  154|  64.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 64.7k]
  |  |  ------------------
  ------------------
 2167|       |
 2168|       |    // Checksum will be appended by the wrapper
 2169|  64.7k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + bh.comp_size;
  ------------------
  |  |  428|  64.7k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2170|  64.7k|    return ZXC_OK;
 2171|  64.7k|}
zxc_compress.c:zxc_hash_tag:
   61|  71.2M|static ZXC_ALWAYS_INLINE uint8_t zxc_hash_tag(const uint32_t val4) {
   62|  71.2M|    return (uint8_t)(val4 ^ (val4 >> 16));
   63|  71.2M|}
zxc_compress.c:zxc_epoch_pos:
   72|  59.5M|                                                const uint32_t epoch_mark) {
   73|  59.5M|    return ((head & ~offset_mask) == epoch_mark) ? (head & offset_mask) : 0;
  ------------------
  |  Branch (73:12): [True: 25.5M, False: 34.0M]
  ------------------
   74|  59.5M|}
zxc_compress.c:zxc_chain_delta:
   82|  62.7M|static ZXC_ALWAYS_INLINE uint16_t zxc_chain_delta(const uint32_t cur_pos, const uint32_t prev_idx) {
   83|  62.7M|    const uint32_t dist = cur_pos - prev_idx;
   84|       |    // cppcheck-suppress bitwiseOnBoolean
   85|  62.7M|    const uint32_t valid = 0U - (uint32_t)((prev_idx != 0) & (dist < ZXC_LZ_WINDOW_SIZE));
  ------------------
  |  |  571|  62.7M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  ------------------
   86|  62.7M|    return (uint16_t)(dist & valid);
   87|  62.7M|}
zxc_compress.c:zxc_hash_func:
   45|   132M|static ZXC_ALWAYS_INLINE uint32_t zxc_hash_func(const uint64_t val, const int use_hash5) {
   46|   132M|    if (use_hash5) {
  ------------------
  |  Branch (46:9): [True: 94.5M, False: 38.1M]
  ------------------
   47|  94.5M|        const uint64_t v5 = val & 0xFFFFFFFFFFULL;
   48|  94.5M|        return (uint32_t)((v5 * ZXC_HASH_XORSHIFT64) >> (64 - ZXC_LZ_HASH_BITS));
  ------------------
  |  |  751|  94.5M|#define ZXC_HASH_XORSHIFT64 0x2545F4914F6CDD1DULL
  ------------------
                      return (uint32_t)((v5 * ZXC_HASH_XORSHIFT64) >> (64 - ZXC_LZ_HASH_BITS));
  ------------------
  |  |  567|  94.5M|#define ZXC_LZ_HASH_BITS 15
  ------------------
   49|  94.5M|    } else {
   50|  38.1M|        const uint64_t v4 = val ^ (val >> 15);
   51|  38.1M|        return ((uint32_t)v4 * ZXC_HASH_MULT32) >> (32 - ZXC_LZ_HASH_BITS);
  ------------------
  |  |  753|  38.1M|#define ZXC_HASH_MULT32 0x2D35182DU
  ------------------
                      return ((uint32_t)v4 * ZXC_HASH_MULT32) >> (32 - ZXC_LZ_HASH_BITS);
  ------------------
  |  |  567|  38.1M|#define ZXC_LZ_HASH_BITS 15
  ------------------
   52|  38.1M|    }
   53|   132M|}
zxc_compress.c:zxc_lz77_find_best_match:
  572|  61.4M|    const int level, const zxc_lz77_params_t p, const uint32_t last_off) {
  573|  61.4M|    const int use_hash5 = (level >= ZXC_LEVEL_DEFAULT);
  574|       |    // Sentinel length just below the minimum, so any valid match replaces it.
  575|  61.4M|    zxc_match_t best = (zxc_match_t){NULL, ZXC_LZ_MIN_MATCH_LEN - 1, 0};
  ------------------
  |  |  575|  61.4M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  576|       |
  577|  61.4M|    uint64_t cur_val8 = zxc_le64(ip);
  578|  61.4M|    uint32_t cur_val = (uint32_t)cur_val8;
  579|  61.4M|    uint32_t h = zxc_hash_func(cur_val8, use_hash5);
  580|       |
  581|       |    // 8-bit tag: XOR fold of first 4 bytes for fast rejection
  582|  61.4M|    const uint8_t cur_tag = zxc_hash_tag(cur_val);
  583|       |
  584|  61.4M|    const uint32_t cur_pos = (uint32_t)(ip - src);
  585|       |
  586|       |    // Tag-first filter on fast levels.
  587|  61.4M|    const uint8_t stored_tag = hash_tags[h];
  588|  61.4M|    uint32_t match_idx;
  589|  61.4M|    if (level <= ZXC_LEVEL_FAST && stored_tag != cur_tag) {
  ------------------
  |  Branch (589:9): [True: 19.0M, False: 42.3M]
  |  Branch (589:36): [True: 11.7M, False: 7.37M]
  ------------------
  590|  11.7M|        match_idx = 0;
  591|  49.7M|    } else {
  592|  49.7M|        match_idx = zxc_epoch_pos(hash_table[h], offset_mask, epoch_mark);
  593|  49.7M|    }
  594|       |
  595|       |    // skip_head still drives the chain walk on level >= 3 (advances past the
  596|       |    // mismatched head without comparing). On level <= 2 it is always 0 here:
  597|       |    // either match_idx == 0 (filter-skip) or stored_tag == cur_tag.
  598|       |    // cppcheck-suppress bitwiseOnBoolean
  599|  61.4M|    const int skip_head = (match_idx != 0) & (stored_tag != cur_tag);
  600|       |
  601|       |    // Split table writes
  602|  61.4M|    hash_table[h] = epoch_mark | cur_pos;
  603|  61.4M|    hash_tags[h] = cur_tag;
  604|       |
  605|  61.4M|    chain_table[cur_pos & ZXC_LZ_WINDOW_MASK] = zxc_chain_delta(cur_pos, match_idx);
  ------------------
  |  |  573|  61.4M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|  61.4M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  606|       |
  607|  61.4M|    int attempts = p.search_depth;
  608|       |
  609|       |    // Repeat-offset seed (level-6 parser passes last_off; others pass 0).
  610|       |    // Probing the previous offset first often finds the longest match right
  611|       |    // away, speeding up the chain walk. It only raises best.len, never lowers
  612|       |    // it, so the result is unchanged - this is purely a speed optimization.
  613|  61.4M|    if (last_off != 0U && last_off >= p.min_offset && last_off <= (uint32_t)ZXC_LZ_MAX_DIST &&
  ------------------
  |  |  678|  61.4M|#define ZXC_LZ_MAX_DIST (ZXC_LZ_WINDOW_SIZE - 1)
  |  |  ------------------
  |  |  |  |  571|      0|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  |  Branch (613:9): [True: 0, False: 61.4M]
  |  Branch (613:27): [True: 0, False: 0]
  |  Branch (613:55): [True: 0, False: 0]
  ------------------
  614|      0|        last_off <= cur_pos) {
  ------------------
  |  Branch (614:9): [True: 0, False: 0]
  ------------------
  615|      0|        const uint8_t* const rep_ref = src + (cur_pos - last_off);
  616|      0|        if (zxc_le32(rep_ref) == cur_val) {
  ------------------
  |  Branch (616:13): [True: 0, False: 0]
  ------------------
  617|      0|            uint32_t mlen = sizeof(uint32_t);
  618|      0|            const uint8_t* const limit_8 = iend - sizeof(uint64_t);
  619|      0|            while (ip + mlen < limit_8) {
  ------------------
  |  Branch (619:20): [True: 0, False: 0]
  ------------------
  620|      0|                const uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(rep_ref + mlen);
  621|      0|                if (diff == 0) {
  ------------------
  |  Branch (621:21): [True: 0, False: 0]
  ------------------
  622|      0|                    mlen += sizeof(uint64_t);
  623|      0|                } else {
  624|      0|                    mlen += (uint32_t)(zxc_ctz64(diff) >> 3);
  625|      0|                    goto _rep_done;
  626|      0|                }
  627|      0|            }
  628|      0|            while (ip + mlen < iend && rep_ref[mlen] == ip[mlen]) mlen++;
  ------------------
  |  Branch (628:20): [True: 0, False: 0]
  |  Branch (628:40): [True: 0, False: 0]
  ------------------
  629|      0|        _rep_done:;
  630|      0|            best.len = mlen;
  631|      0|            best.ref = rep_ref;
  632|      0|            if (UNLIKELY(best.len >= (uint32_t)p.sufficient_len || ip + best.len >= iend))
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  633|      0|                goto _finalize_match;
  634|      0|        }
  635|      0|    }
  636|       |
  637|  61.4M|    if (match_idx == 0) goto _finalize_match;
  ------------------
  |  Branch (637:9): [True: 44.3M, False: 17.1M]
  ------------------
  638|       |
  639|       |    // Optimization: If head tag doesn't match, advance immediately without loading the first
  640|       |    // mismatch.
  641|  17.1M|    if (skip_head) {
  ------------------
  |  Branch (641:9): [True: 4.80M, False: 12.3M]
  ------------------
  642|  4.80M|        const uint16_t delta = chain_table[match_idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  573|  4.80M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|  4.80M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  643|  4.80M|        const uint32_t next_idx = match_idx - delta;
  644|  4.80M|        match_idx = (delta != 0) ? next_idx : 0;
  ------------------
  |  Branch (644:21): [True: 2.16M, False: 2.63M]
  ------------------
  645|  4.80M|        attempts--;
  646|  4.80M|    }
  647|       |
  648|  65.8M|    while (match_idx > 0) {
  ------------------
  |  Branch (648:12): [True: 59.2M, False: 6.61M]
  ------------------
  649|  59.2M|        if (UNLIKELY(attempts-- < 0 || cur_pos - match_idx > ZXC_LZ_MAX_DIST)) break;
  ------------------
  |  |  154|   114M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 7.54M, False: 51.6M]
  |  |  |  Branch (154:42): [True: 3.89M, False: 55.3M]
  |  |  |  Branch (154:42): [True: 3.64M, False: 51.6M]
  |  |  ------------------
  ------------------
  650|  51.6M|        const uint8_t* ref = src + match_idx;
  651|       |
  652|       |        // Load the next chain link early (before the compare) so its address
  653|       |        // resolves while we prefetch. The prefetch aims at the next gate for
  654|       |        // the current best.len; a longer match found here moves that gate.
  655|  51.6M|        const uint16_t delta = chain_table[match_idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  573|  51.6M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|  51.6M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  656|  51.6M|        const uint32_t next_idx = match_idx - delta;
  657|  51.6M|        ZXC_PREFETCH_READ(src + next_idx + best.len - 3);
  ------------------
  |  |  165|  51.6M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
  658|       |
  659|       |        // Gate first: most candidates share the head and fail on bytes
  660|       |        // [best.len-3, best.len], which a longer match must also cover.
  661|  51.6M|        const int should_compare = (cur_pos - match_idx) >= p.min_offset &&
  ------------------
  |  Branch (661:36): [True: 49.1M, False: 2.55M]
  ------------------
  662|  49.1M|                                   zxc_le32(ref + best.len - 3) == zxc_le32(ip + best.len - 3) &&
  ------------------
  |  Branch (662:36): [True: 14.7M, False: 34.3M]
  ------------------
  663|  14.7M|                                   zxc_le32(ref) == cur_val;
  ------------------
  |  Branch (663:36): [True: 14.7M, False: 8.53k]
  ------------------
  664|       |
  665|  51.6M|        if (should_compare) {
  ------------------
  |  Branch (665:13): [True: 14.7M, False: 36.9M]
  ------------------
  666|  14.7M|            uint32_t mlen = sizeof(uint32_t);  // We already know the first 4 bytes match
  667|       |
  668|       |            // Fast path: Scalar 64-bit comparison for short matches (=< 64 bytes)
  669|       |            // Most matches are short, so this avoids SIMD overhead for common cases
  670|  14.7M|            const uint8_t* limit_8 = iend - sizeof(uint64_t);
  671|  14.7M|            const uint8_t* scalar_limit = ip + mlen + 64;
  672|  14.7M|            if (scalar_limit > limit_8) scalar_limit = limit_8;
  ------------------
  |  Branch (672:17): [True: 154k, False: 14.6M]
  ------------------
  673|       |
  674|  29.5M|            while (ip + mlen < scalar_limit) {
  ------------------
  |  Branch (674:20): [True: 28.8M, False: 670k]
  ------------------
  675|  28.8M|                uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(ref + mlen);
  676|  28.8M|                if (diff == 0)
  ------------------
  |  Branch (676:21): [True: 14.7M, False: 14.0M]
  ------------------
  677|  14.7M|                    mlen += sizeof(uint64_t);
  678|  14.0M|                else {
  679|  14.0M|                    mlen += (uint32_t)zxc_ctz64(diff) >> 3;
  680|  14.0M|                    goto _match_len_done;
  681|  14.0M|                }
  682|  28.8M|            }
  683|       |
  684|       |            // Long match path: Use SIMD for matches exceeding 64 bytes
  685|       |#if defined(ZXC_USE_AVX512)
  686|       |            const uint8_t* limit_64 = iend - 64;
  687|       |            while (ip + mlen < limit_64) {
  688|       |                const __m512i v_src = _mm512_loadu_si512((const void*)(ip + mlen));
  689|       |                const __m512i v_ref = _mm512_loadu_si512((const void*)(ref + mlen));
  690|       |                const __mmask64 mask = _mm512_cmpeq_epi8_mask(v_src, v_ref);
  691|       |                if (mask == 0xFFFFFFFFFFFFFFFF)
  692|       |                    mlen += 64;
  693|       |                else {
  694|       |                    mlen += (uint32_t)zxc_ctz64(~mask);
  695|       |                    goto _match_len_done;
  696|       |                }
  697|       |            }
  698|       |#elif defined(ZXC_USE_AVX2)
  699|       |            const uint8_t* limit_32 = iend - 32;
  700|       |            while (ip + mlen < limit_32) {
  701|       |                const __m256i v_src = _mm256_loadu_si256((const __m256i*)(ip + mlen));
  702|       |                const __m256i v_ref = _mm256_loadu_si256((const __m256i*)(ref + mlen));
  703|       |                const __m256i v_cmp = _mm256_cmpeq_epi8(v_src, v_ref);
  704|       |                const uint32_t mask = (uint32_t)_mm256_movemask_epi8(v_cmp);
  705|       |                if (mask == 0xFFFFFFFF)
  706|       |                    mlen += 32;
  707|       |                else {
  708|       |                    mlen += (uint32_t)zxc_ctz32(~mask);
  709|       |                    goto _match_len_done;
  710|       |                }
  711|       |            }
  712|       |#elif defined(ZXC_USE_SSE2)
  713|   670k|            const uint8_t* limit_16 = iend - 16;
  714|  30.1M|            while (ip + mlen < limit_16) {
  ------------------
  |  Branch (714:20): [True: 30.0M, False: 86.1k]
  ------------------
  715|  30.0M|                const __m128i v_src = _mm_loadu_si128((const __m128i*)(ip + mlen));
  716|  30.0M|                const __m128i v_ref = _mm_loadu_si128((const __m128i*)(ref + mlen));
  717|  30.0M|                const __m128i v_cmp = _mm_cmpeq_epi8(v_src, v_ref);
  718|  30.0M|                const uint32_t mask = (uint32_t)_mm_movemask_epi8(v_cmp);
  719|  30.0M|                if (mask == 0xFFFFU)
  ------------------
  |  Branch (719:21): [True: 29.4M, False: 584k]
  ------------------
  720|  29.4M|                    mlen += 16;
  721|   584k|                else {
  722|       |                    // mask != 0xFFFF => a differing byte exists in bits 0..15,
  723|       |                    // so the lowest set bit of ~mask lies in that range.
  724|   584k|                    mlen += (uint32_t)zxc_ctz32(~mask);
  725|   584k|                    goto _match_len_done;
  726|   584k|                }
  727|  30.0M|            }
  728|       |#elif defined(ZXC_USE_NEON64)
  729|       |            {
  730|       |                const uint8_t* limit_32 = iend - 32;
  731|       |                while (ip + mlen < limit_32) {
  732|       |                    const uint8x16_t s0 = vld1q_u8(ip + mlen);
  733|       |                    const uint8x16_t r0 = vld1q_u8(ref + mlen);
  734|       |                    const uint8x16_t c0 = vceqq_u8(s0, r0);
  735|       |                    const uint64_t m0 = vget_lane_u64(
  736|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(c0), 4)), 0);
  737|       |                    if (UNLIKELY(m0 != ~(uint64_t)0)) {
  738|       |                        mlen += (uint32_t)(zxc_ctz64(~m0) >> 2);
  739|       |                        goto _match_len_done;
  740|       |                    }
  741|       |                    const uint8x16_t s1 = vld1q_u8(ip + mlen + 16);
  742|       |                    const uint8x16_t r1 = vld1q_u8(ref + mlen + 16);
  743|       |                    const uint8x16_t c1 = vceqq_u8(s1, r1);
  744|       |                    const uint64_t m1 = vget_lane_u64(
  745|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(c1), 4)), 0);
  746|       |                    if (UNLIKELY(m1 != ~(uint64_t)0)) {
  747|       |                        mlen += 16 + (uint32_t)(zxc_ctz64(~m1) >> 2);
  748|       |                        goto _match_len_done;
  749|       |                    }
  750|       |                    mlen += 32;
  751|       |                }
  752|       |                if (ip + mlen < iend - 16) {
  753|       |                    const uint8x16_t v_src = vld1q_u8(ip + mlen);
  754|       |                    const uint8x16_t v_ref = vld1q_u8(ref + mlen);
  755|       |                    const uint8x16_t v_cmp = vceqq_u8(v_src, v_ref);
  756|       |                    const uint64_t mask = vget_lane_u64(
  757|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(v_cmp), 4)), 0);
  758|       |                    if (LIKELY(mask == ~(uint64_t)0))
  759|       |                        mlen += 16;
  760|       |                    else {
  761|       |                        mlen += (uint32_t)(zxc_ctz64(~mask) >> 2);
  762|       |                        goto _match_len_done;
  763|       |                    }
  764|       |                }
  765|       |            }
  766|       |#elif defined(ZXC_USE_NEON32)
  767|       |            {
  768|       |                const uint8_t* limit_16 = iend - 16;
  769|       |                while (ip + mlen < limit_16) {
  770|       |                    const uint8x16_t v_src = vld1q_u8(ip + mlen);
  771|       |                    const uint8x16_t v_ref = vld1q_u8(ref + mlen);
  772|       |                    const uint8x16_t v_cmp = vceqq_u8(v_src, v_ref);
  773|       |                    uint8x8_t p1 = vpmin_u8(vget_low_u8(v_cmp), vget_high_u8(v_cmp));
  774|       |                    uint8x8_t p2 = vpmin_u8(p1, p1);
  775|       |                    uint8x8_t p3 = vpmin_u8(p2, p2);
  776|       |                    uint8x8_t p4 = vpmin_u8(p3, p3);
  777|       |                    uint8_t min_val = vget_lane_u8(p4, 0);
  778|       |                    if (min_val == 0xFF)
  779|       |                        mlen += 16;
  780|       |                    else {
  781|       |                        uint8x16_t v_diff = vmvnq_u8(v_cmp);
  782|       |                        uint64_t lo =
  783|       |                            (uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 0) |
  784|       |                            ((uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 1) << 32);
  785|       |                        if (lo != 0)
  786|       |                            mlen += (zxc_ctz64(lo) >> 3);
  787|       |                        else
  788|       |                            mlen +=
  789|       |                                8 + (zxc_ctz64(
  790|       |                                         (uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 2) |
  791|       |                                         ((uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 3)
  792|       |                                          << 32)) >>
  793|       |                                     3);
  794|       |                        goto _match_len_done;
  795|       |                    }
  796|       |                }
  797|       |            }
  798|       |#endif
  799|   120k|            while (ip + mlen < limit_8) {
  ------------------
  |  Branch (799:20): [True: 34.7k, False: 85.4k]
  ------------------
  800|  34.7k|                const uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(ref + mlen);
  801|  34.7k|                if (diff == 0)
  ------------------
  |  Branch (801:21): [True: 34.0k, False: 738]
  ------------------
  802|  34.0k|                    mlen += sizeof(uint64_t);
  803|    738|                else {
  804|    738|                    mlen += (uint32_t)zxc_ctz64(diff) >> 3;
  805|    738|                    goto _match_len_done;
  806|    738|                }
  807|  34.7k|            }
  808|   417k|            while (ip + mlen < iend && ref[mlen] == ip[mlen]) mlen++;
  ------------------
  |  Branch (808:20): [True: 342k, False: 74.3k]
  |  Branch (808:40): [True: 331k, False: 11.0k]
  ------------------
  809|       |
  810|  14.7M|        _match_len_done:;
  811|  14.7M|            const int better = (mlen > best.len);
  812|  14.7M|            best.len = better ? mlen : best.len;
  ------------------
  |  Branch (812:24): [True: 13.2M, False: 1.51M]
  ------------------
  813|  14.7M|            best.ref = better ? ref : best.ref;
  ------------------
  |  Branch (813:24): [True: 13.2M, False: 1.51M]
  ------------------
  814|       |
  815|  14.7M|            if (UNLIKELY(best.len >= (uint32_t)p.sufficient_len || ip + best.len >= iend)) break;
  ------------------
  |  |  154|  26.5M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.00M, False: 11.7M]
  |  |  |  Branch (154:42): [True: 3.00M, False: 11.7M]
  |  |  |  Branch (154:42): [True: 6.67k, False: 11.7M]
  |  |  ------------------
  ------------------
  816|  14.7M|        }
  817|       |
  818|  48.6M|        match_idx = (delta != 0) ? next_idx : 0;
  ------------------
  |  Branch (818:21): [True: 44.7M, False: 3.97M]
  ------------------
  819|  48.6M|    }
  820|       |
  821|  61.4M|_finalize_match:
  822|  61.4M|    if (best.ref) {
  ------------------
  |  Branch (822:9): [True: 9.75M, False: 51.7M]
  ------------------
  823|       |        // Backtrack to extend match backwards
  824|  9.75M|        const uint8_t* b_ip = ip;
  825|  9.75M|        const uint8_t* b_ref = best.ref;
  826|  16.9M|        while (b_ip > anchor && b_ref > src && b_ip[-1] == b_ref[-1]) {
  ------------------
  |  Branch (826:16): [True: 11.9M, False: 4.95M]
  |  Branch (826:33): [True: 11.9M, False: 74.6k]
  |  Branch (826:48): [True: 7.18M, False: 4.72M]
  ------------------
  827|  7.18M|            b_ip--;
  828|  7.18M|            b_ref--;
  829|  7.18M|            best.len++;
  830|  7.18M|            best.backtrack++;
  831|  7.18M|        }
  832|  9.75M|        best.ref = b_ref;
  833|  9.75M|    }
  834|       |
  835|       |    // Lazy: a match two bytes longer at ip+1, or from level 4 three bytes longer
  836|       |    // at ip+2, cancels this one.
  837|  61.4M|    if (p.use_lazy && best.ref && best.len < (uint32_t)p.lazy_len_threshold &&
  ------------------
  |  Branch (837:9): [True: 42.3M, False: 19.0M]
  |  Branch (837:23): [True: 6.61M, False: 35.7M]
  |  Branch (837:35): [True: 6.39M, False: 220k]
  ------------------
  838|  6.39M|        ip + 1 < search_limit) {
  ------------------
  |  Branch (838:9): [True: 6.39M, False: 1.38k]
  ------------------
  839|  6.39M|        if (zxc_lazy_probe(src, ip + 1, iend, best.len + 2, hash_table, hash_tags, chain_table,
  ------------------
  |  Branch (839:13): [True: 1.07M, False: 5.31M]
  ------------------
  840|  6.39M|                           epoch_mark, offset_mask, use_hash5, p) ||
  841|  5.31M|            (level >= ZXC_LEVEL_BALANCED && ip + 2 < search_limit &&
  ------------------
  |  Branch (841:14): [True: 2.13M, False: 3.18M]
  |  Branch (841:45): [True: 2.13M, False: 548]
  ------------------
  842|  2.13M|             zxc_lazy_probe(src, ip + 2, iend, best.len + 3, hash_table, hash_tags, chain_table,
  ------------------
  |  Branch (842:14): [True: 71.9k, False: 2.05M]
  ------------------
  843|  2.13M|                            epoch_mark, offset_mask, use_hash5, p)))
  844|  1.15M|            best.ref = NULL;
  845|  6.39M|    }
  846|       |
  847|  61.4M|    return best;
  848|  17.1M|}
zxc_compress.c:zxc_lazy_probe:
  513|  8.52M|                                            const int use_hash5, const zxc_lz77_params_t p) {
  514|  8.52M|    if (need > (size_t)(iend - lp)) return 0;  // too close to the end to win
  ------------------
  |  Branch (514:9): [True: 16.2k, False: 8.50M]
  ------------------
  515|       |
  516|  8.50M|    const uint64_t val8 = zxc_le64(lp);
  517|  8.50M|    const uint32_t val = (uint32_t)val8;
  518|  8.50M|    const uint32_t h = zxc_hash_func(val8, use_hash5);
  519|  8.50M|    const uint32_t pos = (uint32_t)(lp - src);
  520|  8.50M|    const uint32_t gate = zxc_le32(lp + need - 4);
  521|  8.50M|    uint32_t idx = zxc_epoch_pos(hash_table[h], offset_mask, epoch_mark);
  522|       |    // A head with another tag is another string: walk past it.
  523|  8.50M|    int skip = (hash_tags[h] != zxc_hash_tag(val));
  524|       |
  525|  39.8M|    for (int att = p.lazy_attempts; idx > 0 && att > 0; att--) {
  ------------------
  |  Branch (525:37): [True: 38.8M, False: 1.03M]
  |  Branch (525:48): [True: 35.2M, False: 3.65M]
  ------------------
  526|  35.2M|        if (UNLIKELY(pos - idx > ZXC_LZ_MAX_DIST)) break;
  ------------------
  |  |  154|  35.2M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 349k, False: 34.8M]
  |  |  ------------------
  ------------------
  527|  34.8M|        const uint8_t* const ref = src + idx;
  528|       |
  529|       |        // Filtered here too: a lazy hit only cancels best.ref, so a match
  530|       |        // we could never emit would drop a legal one for nothing.
  531|  34.8M|        if (pos - idx >= p.min_offset && !skip && zxc_le32(ref + need - 4) == gate &&
  ------------------
  |  Branch (531:13): [True: 34.4M, False: 370k]
  |  Branch (531:42): [True: 34.2M, False: 292k]
  |  Branch (531:51): [True: 3.48M, False: 30.7M]
  ------------------
  532|  3.48M|            zxc_le32(ref) == val && zxc_match_reaches(lp, ref, sizeof(uint32_t), need, iend))
  ------------------
  |  Branch (532:13): [True: 3.47M, False: 4.38k]
  |  Branch (532:37): [True: 1.15M, False: 2.32M]
  ------------------
  533|  1.15M|            return 1;
  534|       |
  535|  33.7M|        const uint16_t delta = chain_table[idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  573|  33.7M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|  33.7M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  536|  33.7M|        if (UNLIKELY(delta == 0)) break;
  ------------------
  |  |  154|  33.7M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2.32M, False: 31.3M]
  |  |  ------------------
  ------------------
  537|  31.3M|        idx -= delta;
  538|  31.3M|        skip = 0;
  539|  31.3M|    }
  540|  7.35M|    return 0;
  541|  8.50M|}
zxc_compress.c:zxc_match_reaches:
  487|  3.47M|                                               const uint8_t* iend) {
  488|  7.56M|    while (from < need) {
  ------------------
  |  Branch (488:12): [True: 6.89M, False: 666k]
  ------------------
  489|  6.89M|        if (UNLIKELY((size_t)(iend - cur) - from < sizeof(uint64_t))) {
  ------------------
  |  |  154|  6.89M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.12k, False: 6.89M]
  |  |  ------------------
  ------------------
  490|  4.27k|            while (from < need && cur[from] == ref[from]) from++;
  ------------------
  |  Branch (490:20): [True: 3.46k, False: 804]
  |  Branch (490:35): [True: 3.14k, False: 321]
  ------------------
  491|  1.12k|            return from >= need;
  492|  1.12k|        }
  493|  6.89M|        const uint64_t d = zxc_le64(cur + from) ^ zxc_le64(ref + from);
  494|  6.89M|        if (d != 0) return from + (uint32_t)(zxc_ctz64(d) >> 3) >= need;
  ------------------
  |  Branch (494:13): [True: 2.81M, False: 4.08M]
  ------------------
  495|  4.08M|        from += sizeof(uint64_t);
  496|  4.08M|    }
  497|   666k|    return 1;
  498|  3.47M|}
zxc_compress.c:zxc_flush_literals:
  445|  4.33M|                                                 const uint8_t* iend) {
  446|  4.33M|    if (LIKELY(anchor + ZXC_PAD_SIZE <= iend)) {
  ------------------
  |  |  148|  4.33M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 4.32M, False: 12.3k]
  |  |  ------------------
  ------------------
  447|  4.32M|        zxc_copy32(literals + *lit_c, anchor);
  448|  4.32M|        if (UNLIKELY(ll > ZXC_PAD_SIZE))
  ------------------
  |  |  154|  4.32M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 447k, False: 3.87M]
  |  |  ------------------
  ------------------
  449|   447k|            ZXC_MEMCPY(literals + *lit_c + ZXC_PAD_SIZE, anchor + ZXC_PAD_SIZE, ll - ZXC_PAD_SIZE);
  ------------------
  |  |  170|   447k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  450|  4.32M|    } else {
  451|  12.3k|        ZXC_MEMCPY(literals + *lit_c, anchor, ll);
  ------------------
  |  |  170|  12.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  452|  12.3k|    }
  453|  4.33M|    *lit_c += ll;
  454|  4.33M|}
zxc_compress.c:zxc_emit_extra:
  234|  17.2M|                                            const uint32_t val, const uint32_t mask) {
  235|  17.2M|    if (LIKELY(val < mask)) return 1;
  ------------------
  |  |  148|  17.2M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 15.1M, False: 2.06M]
  |  |  ------------------
  ------------------
  236|  2.06M|    const size_t n = zxc_write_varint(extras + *used, val - mask);
  237|  2.06M|    if (UNLIKELY(n == 0)) return 0;
  ------------------
  |  |  154|  2.06M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.06M]
  |  |  ------------------
  ------------------
  238|  2.06M|    *used += n;
  239|  2.06M|    return 1;
  240|  2.06M|}
zxc_compress.c:zxc_write_varint:
  198|  2.06M|static ZXC_ALWAYS_INLINE size_t zxc_write_varint(uint8_t* RESTRICT dst, const uint32_t val) {
  199|       |    // Values above ZXC_MAX_VARINT_VALUE are out-of-spec and the decoder would
  200|       |    // reject them. Unreachable from the Block API, so this is defence in depth;
  201|       |    // callers must treat a return of 0 as an encoding error.
  202|  2.06M|    if (UNLIKELY(val > ZXC_MAX_VARINT_VALUE)) {
  ------------------
  |  |  154|  2.06M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.06M]
  |  |  ------------------
  ------------------
  203|      0|        return 0;
  204|      0|    }
  205|       |
  206|       |    // 1 byte: 0xxxxxxx (7 bits)
  207|  2.06M|    if (LIKELY(val < ZXC_VARINT_1B_LIMIT)) {
  ------------------
  |  |  148|  2.06M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 1.64M, False: 421k]
  |  |  ------------------
  ------------------
  208|  1.64M|        dst[0] = (uint8_t)val;
  209|  1.64M|        return 1;
  210|  1.64M|    }
  211|       |
  212|       |    // 2 bytes: 10xxxxxx xxxxxxxx (14 bits)
  213|   421k|    if (LIKELY(val < ZXC_VARINT_2B_LIMIT)) {
  ------------------
  |  |  148|   421k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 417k, False: 3.61k]
  |  |  ------------------
  ------------------
  214|   417k|        dst[0] = (uint8_t)(0x80 | (val & 0x3F));
  215|   417k|        dst[1] = (uint8_t)(val >> 6);
  216|   417k|        return 2;
  217|   417k|    }
  218|       |
  219|       |    // 3 bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> max emittable value,
  220|       |    // matching ZXC_MAX_VARINT_VALUE = ZXC_BLOCK_SIZE_MAX - 1.
  221|  3.61k|    dst[0] = (uint8_t)(0xC0 | (val & 0x1F));
  222|  3.61k|    dst[1] = (uint8_t)(val >> 5);
  223|  3.61k|    dst[2] = (uint8_t)(val >> 13);
  224|  3.61k|    return 3;
  225|   421k|}
zxc_compress.c:zxc_encode_block_spl:
 1421|  83.9k|                                size_t* RESTRICT out_sz) {
 1422|  83.9k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1423|       |
 1424|  83.9k|    const int level = ctx->compression_level;
 1425|  83.9k|    const size_t dict_sz = ctx->dict_size;
 1426|       |
 1427|  83.9k|    zxc_lz77_params_t lzp = zxc_get_lz77_params(level);
 1428|       |    // The floor is a candidate until the block itself clears it.
 1429|  83.9k|    if (lzp.min_offset > 1 && zxc_block_is_short_dist_bound(src + dict_sz, src_sz - dict_sz))
  ------------------
  |  Branch (1429:9): [True: 83.9k, False: 0]
  |  Branch (1429:31): [True: 56.6k, False: 27.3k]
  ------------------
 1430|  56.6k|        lzp.min_offset = 1;
 1431|       |
 1432|  83.9k|    ctx->epoch++;
 1433|  83.9k|    if (UNLIKELY(ctx->epoch >= ctx->max_epoch)) {
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1434|      0|        ZXC_MEMSET(ctx->hash_table, 0, ZXC_LZ_HASH_SIZE * sizeof(uint32_t));
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1435|      0|        ZXC_MEMSET(ctx->hash_tags, 0, ZXC_LZ_HASH_SIZE * sizeof(uint8_t));
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1436|      0|        ctx->epoch = 1;
 1437|      0|    }
 1438|  83.9k|    const uint32_t offset_bits = ctx->offset_bits;
 1439|  83.9k|    const uint32_t offset_mask = ctx->offset_mask;
 1440|  83.9k|    const uint32_t epoch_mark = ctx->epoch << offset_bits;
 1441|       |
 1442|  83.9k|    if (dict_sz > 0)
  ------------------
  |  Branch (1442:9): [True: 0, False: 83.9k]
  ------------------
 1443|      0|        zxc_lz_seed_dict(src, dict_sz, ctx->hash_table, ctx->hash_tags, ctx->chain_table,
 1444|      0|                         epoch_mark, offset_mask, level);
 1445|       |
 1446|  83.9k|    const uint8_t* ip = src + dict_sz;
 1447|  83.9k|    const uint8_t* iend = src + src_sz;
 1448|  83.9k|    const uint8_t* anchor = ip;
 1449|  83.9k|    const uint8_t* search_limit = iend - ZXC_LZ_SEARCH_MARGIN;
  ------------------
  |  |  717|  83.9k|#define ZXC_LZ_SEARCH_MARGIN (sizeof(uint64_t))
  ------------------
 1450|       |
 1451|  83.9k|    uint32_t* const hash_table = ctx->hash_table;
 1452|  83.9k|    uint8_t* const hash_tags = ctx->hash_tags;
 1453|  83.9k|    uint16_t* const chain_table = ctx->chain_table;
 1454|  83.9k|    uint8_t* const literals = ctx->literals;
 1455|  83.9k|    uint8_t* const buf_tokens = ctx->buf_tokens;
 1456|  83.9k|    uint16_t* const buf_offsets = ctx->buf_offsets;
 1457|  83.9k|    uint8_t* const buf_extras = ctx->buf_extras;
 1458|       |
 1459|  83.9k|    uint32_t seq_c = 0;
 1460|  83.9k|    size_t lit_c = 0;
 1461|  83.9k|    size_t extras_sz = 0;
 1462|  83.9k|    uint16_t max_offset = 0;  // Track max offset for 1-byte/2-byte mode decision
 1463|       |
 1464|       |    // Level 6+: price-based optimal parser (fills outputs and skips the
 1465|       |    // lazy loop + last_lits handling below via `goto parse_done`).
 1466|  83.9k|    if (level >= ZXC_LEVEL_DENSITY) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 83.9k]
  ------------------
 1467|      0|        const int rc = zxc_lz77_optimal_parse_spl(
 1468|      0|            ctx, src, src_sz, hash_table, hash_tags, chain_table, epoch_mark, offset_mask, level,
 1469|      0|            literals, buf_tokens, buf_offsets, buf_extras, &seq_c, &lit_c, &extras_sz, &max_offset);
 1470|      0|        if (UNLIKELY(rc != 0)) return rc;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1471|      0|        goto parse_done;
 1472|      0|    }
 1473|       |
 1474|  42.4M|    while (LIKELY(ip < search_limit)) {
  ------------------
  |  |  148|  42.4M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 42.3M, False: 83.9k]
  |  |  ------------------
  ------------------
 1475|  42.3M|        const size_t dist = (size_t)(ip - anchor);
 1476|  42.3M|        size_t step = lzp.step_base + (dist >> lzp.step_shift);
 1477|  42.3M|        if (UNLIKELY(ip + step >= search_limit)) step = 1;
  ------------------
  |  |  154|  42.3M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.76M, False: 38.6M]
  |  |  ------------------
  ------------------
 1478|       |
 1479|  42.3M|        if (LIKELY(ip + step + sizeof(uint64_t) <= iend)) {
  ------------------
  |  |  148|  42.3M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 42.3M, False: 0]
  |  |  ------------------
  ------------------
 1480|  42.3M|            const uint64_t v_next = zxc_le64(ip + step);
 1481|       |            // cppcheck-suppress unreadVariable
 1482|  42.3M|            const uint32_t h_next = zxc_hash_func(v_next, 1);
 1483|  42.3M|            ZXC_PREFETCH_READ(&hash_tags[h_next]);
  ------------------
  |  |  165|  42.3M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 1484|  42.3M|            ZXC_PREFETCH_READ(&hash_table[h_next]);
  ------------------
  |  |  165|  42.3M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 1485|  42.3M|        }
 1486|       |
 1487|  42.3M|        const zxc_match_t m =
 1488|  42.3M|            zxc_lz77_find_best_match(src, ip, iend, search_limit, anchor, hash_table, hash_tags,
 1489|  42.3M|                                     chain_table, epoch_mark, offset_mask, level, lzp,
 1490|  42.3M|                                     /*last_off=*/0U);
 1491|       |
 1492|  42.3M|        if (m.ref) {
  ------------------
  |  Branch (1492:13): [True: 5.46M, False: 36.9M]
  ------------------
 1493|  5.46M|            ip -= m.backtrack;
 1494|  5.46M|            const uint32_t ll = (uint32_t)(ip - anchor);
 1495|  5.46M|            const uint32_t ml = m.len - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  5.46M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1496|  5.46M|            const uint32_t off = (uint32_t)(ip - m.ref);
 1497|  5.46M|            const uint16_t off_biased = (uint16_t)(off - ZXC_LZ_OFFSET_BIAS);
  ------------------
  |  |  676|  5.46M|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1498|       |
 1499|  5.46M|            if (ll > 0) zxc_flush_literals(literals, &lit_c, anchor, ll, iend);
  ------------------
  |  Branch (1499:17): [True: 3.04M, False: 2.42M]
  ------------------
 1500|       |
 1501|  5.46M|            if (UNLIKELY(!zxc_spl_put_seq(buf_tokens, buf_offsets, buf_extras, &seq_c, &extras_sz,
  ------------------
  |  |  154|  5.46M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 5.46M]
  |  |  ------------------
  ------------------
 1502|  5.46M|                                          &max_offset, ll, ml, off_biased)))
 1503|      0|                return ZXC_ERROR_OVERFLOW;
 1504|       |
 1505|  5.46M|            if (m.len > 2 && level > ZXC_LEVEL_BALANCED) {
  ------------------
  |  Branch (1505:17): [True: 5.46M, False: 0]
  |  Branch (1505:30): [True: 1.25M, False: 4.20M]
  ------------------
 1506|  1.25M|                const uint8_t* match_end = ip + m.len;
 1507|  1.25M|                if (match_end < iend - 7) {
  ------------------
  |  Branch (1507:21): [True: 1.24M, False: 8.26k]
  ------------------
 1508|  1.24M|                    const uint32_t pos_u = (uint32_t)((match_end - 2) - src);
 1509|  1.24M|                    const uint64_t val_u8 = zxc_le64(match_end - 2);
 1510|  1.24M|                    const uint32_t val_u = (uint32_t)val_u8;
 1511|  1.24M|                    const uint32_t h_u = zxc_hash_func(val_u8, 1);
 1512|  1.24M|                    const uint32_t prev_idx =
 1513|  1.24M|                        zxc_epoch_pos(hash_table[h_u], offset_mask, epoch_mark);
 1514|  1.24M|                    hash_table[h_u] = epoch_mark | pos_u;
 1515|  1.24M|                    hash_tags[h_u] = zxc_hash_tag(val_u);
 1516|  1.24M|                    chain_table[pos_u & ZXC_LZ_WINDOW_MASK] = zxc_chain_delta(pos_u, prev_idx);
  ------------------
  |  |  573|  1.24M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|  1.24M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
 1517|  1.24M|                }
 1518|  1.25M|            }
 1519|       |
 1520|  5.46M|            ip += m.len;
 1521|  5.46M|            anchor = ip;
 1522|  36.9M|        } else {
 1523|  36.9M|            ip += step;
 1524|  36.9M|        }
 1525|  42.3M|    }
 1526|       |
 1527|  83.9k|    const size_t last_lits = (size_t)(iend - anchor);
 1528|  83.9k|    if (last_lits > 0) {
  ------------------
  |  Branch (1528:9): [True: 39.7k, False: 44.2k]
  ------------------
 1529|  39.7k|        ZXC_MEMCPY(literals + lit_c, anchor, last_lits);
  ------------------
  |  |  170|  39.7k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1530|  39.7k|        lit_c += last_lits;
 1531|  39.7k|    }
 1532|       |
 1533|  83.9k|parse_done:;
 1534|       |    // Per-block match splitting on the parsed block (see zxc_spl_match_split_block).
 1535|  83.9k|    seq_c = zxc_spl_match_split_block(buf_tokens, buf_offsets, buf_extras, &extras_sz,
 1536|  83.9k|                                      ctx->buf_split, ctx->buf_split_hist, seq_c, lzp.split_max);
 1537|       |    // Dictionary-table trainer hook: accumulate the REAL post-LZ literal
 1538|       |    // frequencies (see zxc_dict_train_huf). Cold path, NULL outside training.
 1539|  83.9k|    if (UNLIKELY(ctx->lit_freq_acc)) {
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1540|      0|        for (size_t i = 0; i < lit_c; i++) ctx->lit_freq_acc[literals[i]]++;
  ------------------
  |  Branch (1540:28): [True: 0, False: 0]
  ------------------
 1541|      0|    }
 1542|       |
 1543|       |    // --- RLE ANALYSIS ---
 1544|  83.9k|    size_t rle_size = 0;
 1545|  83.9k|    int enc_lit = ZXC_SECTION_ENCODING_RAW;
 1546|  83.9k|    size_t best_j = lit_c;
 1547|       |
 1548|  83.9k|    if (lit_c > 0) {
  ------------------
  |  Branch (1548:9): [True: 83.9k, False: 0]
  ------------------
 1549|  83.9k|        const uint8_t* p = literals;
 1550|  83.9k|        const uint8_t* const p_end = literals + lit_c;
 1551|  83.9k|        const uint8_t* const p_end_4 = p_end - 3;  // Safe limit for 4-byte lookahead
 1552|       |
 1553|   544k|        while (LIKELY(p < p_end)) {
  ------------------
  |  |  148|   544k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 460k, False: 83.9k]
  |  |  ------------------
  ------------------
 1554|   460k|            const uint8_t b = *p;
 1555|   460k|            const uint8_t* run_start = p++;
 1556|       |
 1557|       |            // Fast run counting with early SIMD exit
 1558|       |#if defined(ZXC_USE_AVX512)
 1559|       |            const __m512i vb = _mm512_set1_epi8((char)b);
 1560|       |            while (p <= p_end - 64) {
 1561|       |                const __m512i v = _mm512_loadu_si512((const void*)p);
 1562|       |                const __mmask64 mask = _mm512_cmpeq_epi8_mask(v, vb);
 1563|       |                if (mask != 0xFFFFFFFFFFFFFFFFULL) {
 1564|       |                    p += (size_t)zxc_ctz64(~mask);
 1565|       |                    goto _run_done;
 1566|       |                }
 1567|       |                p += 64;
 1568|       |            }
 1569|       |#elif defined(ZXC_USE_AVX2)
 1570|       |            const __m256i vb = _mm256_set1_epi8((char)b);
 1571|       |            while (p <= p_end - 32) {
 1572|       |                const __m256i v = _mm256_loadu_si256((const __m256i*)p);
 1573|       |                const uint32_t mask = (uint32_t)_mm256_movemask_epi8(_mm256_cmpeq_epi8(v, vb));
 1574|       |                if (mask != 0xFFFFFFFF) {
 1575|       |                    p += zxc_ctz32(~mask);
 1576|       |                    goto _run_done;
 1577|       |                }
 1578|       |                p += 32;
 1579|       |            }
 1580|       |#elif defined(ZXC_USE_SSE2)
 1581|       |            const __m128i vb = _mm_set1_epi8((char)b);
 1582|   682k|            while (p <= p_end - 16) {
  ------------------
  |  Branch (1582:20): [True: 635k, False: 47.3k]
  ------------------
 1583|   635k|                const __m128i v = _mm_loadu_si128((const __m128i*)p);
 1584|   635k|                const uint32_t mask = (uint32_t)_mm_movemask_epi8(_mm_cmpeq_epi8(v, vb));
 1585|   635k|                if (mask != 0xFFFFU) {
  ------------------
  |  Branch (1585:21): [True: 413k, False: 222k]
  ------------------
 1586|   413k|                    p += zxc_ctz32(~mask);
 1587|   413k|                    goto _run_done;
 1588|   413k|                }
 1589|   222k|                p += 16;
 1590|   222k|            }
 1591|       |#elif defined(ZXC_USE_NEON64)
 1592|       |            const uint8x16_t vb = vdupq_n_u8(b);
 1593|       |            while (p <= p_end - 16) {
 1594|       |                const uint8x16_t v = vld1q_u8(p);
 1595|       |                const uint8x16_t eq = vceqq_u8(v, vb);
 1596|       |                // SHRN nibble-mask: see find_best_match above for rationale.
 1597|       |                const uint64_t mask =
 1598|       |                    vget_lane_u64(vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(eq), 4)), 0);
 1599|       |                if (LIKELY(mask == ~(uint64_t)0)) {
 1600|       |                    p += 16;
 1601|       |                } else {
 1602|       |                    p += (size_t)(zxc_ctz64(~mask) >> 2);
 1603|       |                    goto _run_done;
 1604|       |                }
 1605|       |            }
 1606|       |#elif defined(ZXC_USE_NEON32)
 1607|       |            uint8x16_t vb = vdupq_n_u8(b);
 1608|       |            while (p <= p_end - 16) {
 1609|       |                uint8x16_t v = vld1q_u8(p);
 1610|       |                uint8x16_t eq = vceqq_u8(v, vb);
 1611|       |                uint8x16_t not_eq = vmvnq_u8(eq);
 1612|       |
 1613|       |                // 32-bit ARM NEON doesn't always support vgetq_lane_u64 / vreinterpretq_u64_u8 so
 1614|       |                // we treat the 128-bit vector as 4 x 32-bit lanes */
 1615|       |                const uint32x4_t neq32 = vreinterpretq_u32_u8(not_eq);
 1616|       |                const uint32_t l0 = vgetq_lane_u32(neq32, 0);
 1617|       |                const uint32_t l1 = vgetq_lane_u32(neq32, 1);
 1618|       |
 1619|       |                const uint64_t lo = ((uint64_t)l1 << 32) | l0;
 1620|       |                if (lo != 0) {
 1621|       |                    p += (size_t)(zxc_ctz64(lo) >> 3);
 1622|       |                    goto _run_done;
 1623|       |                }
 1624|       |
 1625|       |                const uint32_t h0 = vgetq_lane_u32(neq32, 2);
 1626|       |                const uint32_t h1 = vgetq_lane_u32(neq32, 3);
 1627|       |                const uint64_t hi = ((uint64_t)h1 << 32) | h0;
 1628|       |
 1629|       |                if (hi != 0) {
 1630|       |                    p += 8 + (zxc_ctz64(hi) >> 3);
 1631|       |                    goto _run_done;
 1632|       |                }
 1633|       |                p += 16;
 1634|       |            }
 1635|       |#endif
 1636|   110k|            while (p < p_end && *p == b) p++;
  ------------------
  |  Branch (1636:20): [True: 90.3k, False: 20.4k]
  |  Branch (1636:33): [True: 63.4k, False: 26.9k]
  ------------------
 1637|       |
 1638|  47.3k|#if defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || defined(ZXC_USE_NEON64) || \
 1639|  47.3k|    defined(ZXC_USE_NEON32) || defined(ZXC_USE_SSE2)
 1640|   460k|        _run_done:;
 1641|   460k|#endif
 1642|   460k|            const size_t run = (size_t)(p - run_start);
 1643|       |
 1644|   460k|            if (run >= ZXC_LIT_RLE_RUN_MIN) {
  ------------------
  |  |  550|   460k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (1644:17): [True: 202k, False: 257k]
  ------------------
 1645|       |                // RLE run: 2 bytes per ZXC_LIT_RLE_RUN_MAX values, then remainder
 1646|       |                // Branchless: full_chunks * 2 + remainder handling
 1647|   202k|                const size_t full_chunks = run / ZXC_LIT_RLE_RUN_MAX;
  ------------------
  |  |  552|   202k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  546|   202k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|   202k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  550|   202k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
 1648|   202k|                const size_t rem = run - full_chunks * ZXC_LIT_RLE_RUN_MAX;  // Avoid modulo
  ------------------
  |  |  552|   202k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  546|   202k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|   202k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  550|   202k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
 1649|   202k|                rle_size += full_chunks * 2;
 1650|       |                // Remainder: if >= 4 -> 2 bytes (RLE), else 1 + rem (literal)
 1651|   202k|                if (rem >= ZXC_LIT_RLE_RUN_MIN)
  ------------------
  |  |  550|   202k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (1651:21): [True: 202k, False: 305]
  ------------------
 1652|   202k|                    rle_size += 2;
 1653|    305|                else if (rem > 0)
  ------------------
  |  Branch (1653:26): [True: 172, False: 133]
  ------------------
 1654|    172|                    rle_size += 1 + rem;
 1655|   257k|            } else {
 1656|       |                // Literal run: scan ahead with fast SIMD lookahead
 1657|   257k|                const uint8_t* lit_start = run_start;
 1658|       |
 1659|   257k|#if defined(ZXC_RLE_WIN)
 1660|  15.1M|                while (p <= p_end_4 - ZXC_RLE_WIN) {
  ------------------
  |  |  118|  15.1M|#define ZXC_RLE_WIN 16
  ------------------
  |  Branch (1660:24): [True: 15.0M, False: 89.4k]
  ------------------
 1661|  15.0M|                    const zxc_rle_mask_t m = zxc_rle_pair_mask(p);
 1662|  15.0M|                    const zxc_rle_mask_t mask = m & (m >> ZXC_RLE_BPB) & (m >> (2 * ZXC_RLE_BPB));
  ------------------
  |  |  119|  15.0M|#define ZXC_RLE_BPB 1
  ------------------
                                  const zxc_rle_mask_t mask = m & (m >> ZXC_RLE_BPB) & (m >> (2 * ZXC_RLE_BPB));
  ------------------
  |  |  119|  15.0M|#define ZXC_RLE_BPB 1
  ------------------
 1663|  15.0M|                    if (LIKELY(mask == 0)) {
  ------------------
  |  |  148|  15.0M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 13.7M, False: 1.29M]
  |  |  ------------------
  ------------------
 1664|  13.7M|                        p += ZXC_RLE_WIN - 2;
  ------------------
  |  |  118|  13.7M|#define ZXC_RLE_WIN 16
  ------------------
 1665|  13.7M|                        continue;
 1666|  13.7M|                    }
 1667|  1.29M|                    const unsigned rpos = (unsigned)(ZXC_RLE_CTZ(mask) / ZXC_RLE_BPB);
  ------------------
  |  |  120|  1.29M|#define ZXC_RLE_CTZ(x) zxc_ctz32(x)
  ------------------
                                  const unsigned rpos = (unsigned)(ZXC_RLE_CTZ(mask) / ZXC_RLE_BPB);
  ------------------
  |  |  119|  1.29M|#define ZXC_RLE_BPB 1
  ------------------
 1668|  1.29M|                    const unsigned rpairs =
 1669|  1.29M|                        (unsigned)(ZXC_RLE_CTZ(~(m >> (rpos * ZXC_RLE_BPB))) / ZXC_RLE_BPB);
  ------------------
  |  |  120|  1.29M|#define ZXC_RLE_CTZ(x) zxc_ctz32(x)
  ------------------
                                      (unsigned)(ZXC_RLE_CTZ(~(m >> (rpos * ZXC_RLE_BPB))) / ZXC_RLE_BPB);
  ------------------
  |  |  119|  1.29M|#define ZXC_RLE_BPB 1
  ------------------
 1670|  1.29M|                    if (UNLIKELY(rpos + rpairs >= ZXC_RLE_WIN)) {
  ------------------
  |  |  154|  1.29M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 168k, False: 1.12M]
  |  |  ------------------
  ------------------
 1671|   168k|                        p += rpos;
 1672|   168k|                        goto _lit_done; /* run may extend past the window */
 1673|   168k|                    }
 1674|  1.12M|                    const size_t seg = (size_t)(p + rpos - lit_start);
 1675|  1.12M|                    rle_size += seg + (seg + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  546|  1.12M|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  ------------------
  |  |  |  |  544|  1.12M|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  ------------------
  ------------------
                                  rle_size += seg + (seg + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  548|  1.12M|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  546|  1.12M|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|  1.12M|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1676|  1.12M|                    rle_size += 2; /* run fits one chunk: full_chunks=0, rem>=4 */
 1677|  1.12M|                    p += rpos + rpairs + 1;
 1678|  1.12M|                    lit_start = p;
 1679|  1.12M|                }
 1680|       |#elif defined(ZXC_USE_NEON32)
 1681|       |                while (p <= p_end_4 - 16) {
 1682|       |                    uint8x16_t v0 = vld1q_u8(p);
 1683|       |                    uint8x16_t v1 = vld1q_u8(p + 1);
 1684|       |                    const uint8x16_t pe = vceqq_u8(v0, v1);
 1685|       |                    const uint8x16_t zv = vdupq_n_u8(0);
 1686|       |                    const uint8x16_t eq =
 1687|       |                        vandq_u8(pe, vandq_u8(vextq_u8(pe, zv, 1), vextq_u8(pe, zv, 2)));
 1688|       |
 1689|       |                    uint32x4_t eq32 = vreinterpretq_u32_u8(eq);
 1690|       |                    uint32_t l0 = vgetq_lane_u32(eq32, 0);
 1691|       |                    uint32_t l1 = vgetq_lane_u32(eq32, 1);
 1692|       |                    uint64_t lo = ((uint64_t)l1 << 32) | l0;
 1693|       |
 1694|       |                    if (lo != 0) {
 1695|       |                        p += (zxc_ctz64(lo) >> 3);
 1696|       |                        goto _lit_done;
 1697|       |                    }
 1698|       |
 1699|       |                    uint32_t h0 = vgetq_lane_u32(eq32, 2);
 1700|       |                    uint32_t h1 = vgetq_lane_u32(eq32, 3);
 1701|       |                    uint64_t hi = ((uint64_t)h1 << 32) | h0;
 1702|       |
 1703|       |                    if (hi != 0) {
 1704|       |                        p += 8 + (zxc_ctz64(hi) >> 3);
 1705|       |                        goto _lit_done;
 1706|       |                    }
 1707|       |                    p += 14;
 1708|       |                }
 1709|       |#endif
 1710|   540k|                while (p < p_end_4) {
  ------------------
  |  Branch (1710:24): [True: 462k, False: 78.6k]
  ------------------
 1711|   462k|                    if (UNLIKELY(p[0] == p[1] && p[1] == p[2] && p[2] == p[3])) break;
  ------------------
  |  |  154|   995k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.7k, False: 451k]
  |  |  |  Branch (154:42): [True: 51.6k, False: 410k]
  |  |  |  Branch (154:42): [True: 19.2k, False: 32.4k]
  |  |  |  Branch (154:42): [True: 10.7k, False: 8.50k]
  |  |  ------------------
  ------------------
 1712|   451k|                    p++;
 1713|   451k|                }
 1714|  89.4k|                if (p >= p_end_4) p = p_end;
  ------------------
  |  Branch (1714:21): [True: 78.6k, False: 10.7k]
  ------------------
 1715|       |
 1716|  89.4k|#if defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || defined(ZXC_USE_NEON64) || \
 1717|  89.4k|    defined(ZXC_USE_NEON32) || defined(ZXC_USE_SSE2)
 1718|   257k|            _lit_done:;
 1719|   257k|#endif
 1720|   257k|                const size_t lit_run = (size_t)(p - lit_start);
 1721|       |                // 1 header per ZXC_LIT_RUN_MAX bytes + all data bytes
 1722|   257k|                rle_size += lit_run + (lit_run + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  546|   257k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  ------------------
  |  |  |  |  544|   257k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  ------------------
  ------------------
                              rle_size += lit_run + (lit_run + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  548|   257k|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  546|   257k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|   257k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1723|   257k|            }
 1724|   460k|        }
 1725|       |
 1726|       |        // RLE over RAW: space-speed J comparison. The per-level premium
 1727|       |        // reproduces the historical margin exactly below ULTRA.
 1728|  83.9k|        const size_t rle_j = rle_size + ZXC_SS_TAX(lit_c, zxc_ss_prem_rle_q8(level));
  ------------------
  |  |  902|  83.9k|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
 1729|  83.9k|        if (rle_j < best_j) {
  ------------------
  |  Branch (1729:13): [True: 22.4k, False: 61.5k]
  ------------------
 1730|  22.4k|            enc_lit = ZXC_SECTION_ENCODING_RLE;
 1731|  22.4k|            best_j = rle_j;
 1732|  22.4k|        }
 1733|  83.9k|    }
 1734|       |
 1735|       |    // Level >= 6: Huffman as a third literal-encoding candidate. Histogram,
 1736|       |    // length-limited code lengths, exact PivCo section size, and switch if its
 1737|       |    // J (size + decode tax) beats the current winner's.
 1738|  83.9k|    uint8_t huf_code_len[ZXC_HUF_NUM_SYMBOLS];
 1739|  83.9k|    size_t huf_total_size = SIZE_MAX;
 1740|  83.9k|    uint32_t lit_freq[ZXC_HUF_NUM_SYMBOLS]; /* valid iff huf_total_size != SIZE_MAX */
 1741|  83.9k|    if (level >= ZXC_LEVEL_DENSITY && lit_c >= ZXC_HUF_MIN_LITERALS) {
  ------------------
  |  |  951|      0|#define ZXC_HUF_MIN_LITERALS 139
  ------------------
  |  Branch (1741:9): [True: 0, False: 83.9k]
  |  Branch (1741:39): [True: 0, False: 0]
  ------------------
 1742|      0|        uint32_t freq0[ZXC_HUF_NUM_SYMBOLS] = {0};
 1743|      0|        uint32_t freq1[ZXC_HUF_NUM_SYMBOLS] = {0};
 1744|      0|        uint32_t freq2[ZXC_HUF_NUM_SYMBOLS] = {0};
 1745|      0|        uint32_t freq3[ZXC_HUF_NUM_SYMBOLS] = {0};
 1746|      0|        {
 1747|      0|            size_t i = 0;
 1748|      0|            for (; i + 4 <= lit_c; i += 4) {
  ------------------
  |  Branch (1748:20): [True: 0, False: 0]
  ------------------
 1749|      0|                freq0[literals[i + 0]]++;
 1750|      0|                freq1[literals[i + 1]]++;
 1751|      0|                freq2[literals[i + 2]]++;
 1752|      0|                freq3[literals[i + 3]]++;
 1753|      0|            }
 1754|      0|            for (; i < lit_c; i++) freq0[literals[i]]++;
  ------------------
  |  Branch (1754:20): [True: 0, False: 0]
  ------------------
 1755|      0|        }
 1756|      0|        uint32_t* const freq = lit_freq;
 1757|      0|        for (int k = 0; k < ZXC_HUF_NUM_SYMBOLS; k++) {
  ------------------
  |  |  785|      0|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1757:25): [True: 0, False: 0]
  ------------------
 1758|      0|            freq[k] = freq0[k] + freq1[k] + freq2[k] + freq3[k];
 1759|      0|        }
 1760|       |
 1761|      0|        if (zxc_huf_build_code_lengths(freq, huf_code_len, ctx->opt_scratch,
  ------------------
  |  |   26|      0|#define zxc_huf_build_code_lengths ZXC_CAT(zxc_huf_build_code_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1761:13): [True: 0, False: 0]
  ------------------
 1762|      0|                                       zxc_huf_enc_max_code_len(level)) == ZXC_OK) {
 1763|      0|            (void)zxc_huf_nudge_code_lengths(freq, huf_code_len, ctx->opt_scratch,
 1764|      0|                                             ctx->opt_scratch_cap, zxc_huf_enc_max_code_len(level));
 1765|      0|            huf_total_size = zxc_huf_calc_size(freq, huf_code_len, 1);
  ------------------
  |  |   28|      0|#define zxc_huf_calc_size ZXC_CAT(zxc_huf_calc_size, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1766|       |            // Space-speed: the entropy candidate must beat the current winner's
 1767|       |            // J, paying its own decode tax over the copy path.
 1768|      0|            if (huf_total_size != SIZE_MAX) {
  ------------------
  |  Branch (1768:17): [True: 0, False: 0]
  ------------------
 1769|      0|                const size_t huf_j = huf_total_size + ZXC_SS_TAX(lit_c, zxc_ss_prem_huf_q8(level));
  ------------------
  |  |  902|      0|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
 1770|      0|                if (huf_j < best_j) {
  ------------------
  |  Branch (1770:21): [True: 0, False: 0]
  ------------------
 1771|      0|                    enc_lit = ZXC_SECTION_ENCODING_HUFFMAN;
 1772|      0|                    best_j = huf_j;
 1773|      0|                }
 1774|      0|            }
 1775|      0|        }
 1776|      0|    }
 1777|       |
 1778|       |    // Shared dictionary table (level >= 6, dict with a table): the HUFFMAN
 1779|       |    // bitstream minus the 128-byte header, so it stays viable far below
 1780|       |    // ZXC_HUF_MIN_LITERALS. A literal without a code drops the candidate.
 1781|  83.9k|    size_t huf_dict_total_size = SIZE_MAX;
 1782|  83.9k|    if (level >= ZXC_LEVEL_DENSITY && ctx->dict_huf_tree_ok && lit_c > 0) {
  ------------------
  |  Branch (1782:9): [True: 0, False: 83.9k]
  |  Branch (1782:39): [True: 0, False: 0]
  |  Branch (1782:64): [True: 0, False: 0]
  ------------------
 1783|       |        // The dict candidate runs on sections too small for the per-block
 1784|       |        // table, so the histogram may not have been built above.
 1785|      0|        if (huf_total_size == SIZE_MAX) {
  ------------------
  |  Branch (1785:13): [True: 0, False: 0]
  ------------------
 1786|      0|            ZXC_MEMSET(lit_freq, 0, sizeof(uint32_t) * ZXC_HUF_NUM_SYMBOLS);
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1787|      0|            for (size_t i = 0; i < lit_c; i++) lit_freq[literals[i]]++;
  ------------------
  |  Branch (1787:32): [True: 0, False: 0]
  ------------------
 1788|      0|        }
 1789|       |        // zxc_huf_calc_size returns SIZE_MAX for unencodable candidates
 1790|       |        // (a literal byte without a code in the shared table).
 1791|      0|        huf_dict_total_size =
 1792|      0|            zxc_huf_calc_size_dict(lit_freq, ctx->dict_huf->code_len, &ctx->dict_huf->tree);
  ------------------
  |  |   29|      0|#define zxc_huf_calc_size_dict ZXC_CAT(zxc_huf_calc_size_dict, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1793|      0|        if (huf_dict_total_size != SIZE_MAX) {
  ------------------
  |  Branch (1793:13): [True: 0, False: 0]
  ------------------
 1794|       |            // Same J rule against the running winner: vs the per-block Huffman
 1795|       |            // candidate the equal entropy taxes cancel (pure size comparison),
 1796|       |            // while RAW/RLE baselines keep their decode-tax edge.
 1797|      0|            const size_t huf_dict_j =
 1798|      0|                huf_dict_total_size + ZXC_SS_TAX(lit_c, zxc_ss_prem_huf_q8(level));
  ------------------
  |  |  902|      0|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
 1799|       |            // Last candidate: no need to keep best_j updated past this point.
 1800|      0|            if (huf_dict_j < best_j) enc_lit = ZXC_SECTION_ENCODING_HUFFMAN_DICT;
  ------------------
  |  Branch (1800:17): [True: 0, False: 0]
  ------------------
 1801|      0|        }
 1802|      0|    }
 1803|       |
 1804|       |    // Level-7 (ULTRA): Huffman-code the token stream with the literal codec -
 1805|       |    // tokens are a <= 256-symbol alphabet. Same J rule; the decoder picks the
 1806|       |    // path from gh.enc_tok. opt_scratch is free by now.
 1807|  83.9k|    uint8_t tok_code_len[ZXC_HUF_NUM_SYMBOLS];
 1808|  83.9k|    uint8_t enc_tok = ZXC_SECTION_ENCODING_RAW;
 1809|  83.9k|    size_t tok_huf_size = 0;
 1810|  83.9k|    uint32_t tfreq[ZXC_HUF_NUM_SYMBOLS];
 1811|  83.9k|    if (level >= ZXC_LEVEL_ULTRA && seq_c >= ZXC_HUF_MIN_LITERALS) {
  ------------------
  |  |  951|      0|#define ZXC_HUF_MIN_LITERALS 139
  ------------------
  |  Branch (1811:9): [True: 0, False: 83.9k]
  |  Branch (1811:37): [True: 0, False: 0]
  ------------------
 1812|      0|        ZXC_MEMSET(tfreq, 0, sizeof(tfreq)); /* only the ULTRA path reads tfreq */
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1813|      0|        for (uint32_t i = 0; i < seq_c; i++) tfreq[buf_tokens[i]]++;
  ------------------
  |  Branch (1813:30): [True: 0, False: 0]
  ------------------
 1814|      0|        if (zxc_huf_build_code_lengths(tfreq, tok_code_len, ctx->opt_scratch,
  ------------------
  |  |   26|      0|#define zxc_huf_build_code_lengths ZXC_CAT(zxc_huf_build_code_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1814:13): [True: 0, False: 0]
  ------------------
 1815|      0|                                       zxc_huf_enc_max_code_len(level)) == ZXC_OK) {
 1816|      0|            (void)zxc_huf_nudge_code_lengths(tfreq, tok_code_len, ctx->opt_scratch,
 1817|      0|                                             ctx->opt_scratch_cap, zxc_huf_enc_max_code_len(level));
 1818|      0|            tok_huf_size = zxc_huf_calc_size(tfreq, tok_code_len, 1);
  ------------------
  |  |   28|      0|#define zxc_huf_calc_size ZXC_CAT(zxc_huf_calc_size, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1819|       |            // Space-speed J comparison (this path is ULTRA-only): the PivCo
 1820|       |            // token section pays the same decode tax as PivCo literals.
 1821|      0|            if (tok_huf_size != SIZE_MAX &&
  ------------------
  |  Branch (1821:17): [True: 0, False: 0]
  ------------------
 1822|      0|                tok_huf_size + ZXC_SS_TAX((size_t)seq_c, zxc_ss_prem_huf_q8(level)) < (size_t)seq_c)
  ------------------
  |  |  902|      0|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
  |  Branch (1822:17): [True: 0, False: 0]
  ------------------
 1823|      0|                enc_tok = ZXC_SECTION_ENCODING_HUFFMAN;
 1824|      0|        }
 1825|      0|    }
 1826|       |
 1827|  83.9k|    zxc_block_header_t bh = {.block_type = ZXC_BLOCK_SPL};
 1828|  83.9k|    uint8_t* const p = dst + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  83.9k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1829|  83.9k|    size_t rem = dst_cap - ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  83.9k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1830|       |
 1831|  83.9k|    const int use_8bit_off = (max_offset <= 255) ? 1 : 0;
  ------------------
  |  Branch (1831:30): [True: 37.5k, False: 46.4k]
  ------------------
 1832|  83.9k|    const size_t off_stream_size = use_8bit_off ? seq_c : (seq_c * 2);
  ------------------
  |  Branch (1832:36): [True: 37.5k, False: 46.4k]
  ------------------
 1833|       |
 1834|  83.9k|    const zxc_gnr_header_t gh = {.n_sequences = seq_c,
 1835|  83.9k|                                 .n_literals = (uint32_t)lit_c,
 1836|  83.9k|                                 .enc_lit = (uint8_t)enc_lit,
 1837|  83.9k|                                 .enc_tok = enc_tok,
 1838|  83.9k|                                 .enc_mlen = 0,
 1839|  83.9k|                                 .enc_off = (uint8_t)use_8bit_off};
 1840|       |
 1841|  83.9k|    const size_t sz_lit = (enc_lit == ZXC_SECTION_ENCODING_RLE)            ? rle_size
  ------------------
  |  Branch (1841:27): [True: 22.4k, False: 61.5k]
  ------------------
 1842|  83.9k|                          : (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN)      ? huf_total_size
  ------------------
  |  Branch (1842:29): [True: 0, False: 61.5k]
  ------------------
 1843|  61.5k|                          : (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN_DICT) ? huf_dict_total_size
  ------------------
  |  Branch (1843:29): [True: 0, False: 61.5k]
  ------------------
 1844|  61.5k|                                                                           : lit_c;
 1845|  83.9k|    const size_t sz_tok = (enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? tok_huf_size : seq_c;
  ------------------
  |  Branch (1845:27): [True: 0, False: 83.9k]
  ------------------
 1846|  83.9k|    const size_t sz_off = off_stream_size;
 1847|  83.9k|    const size_t sz_ext = extras_sz;
 1848|       |
 1849|  83.9k|    const int ghs = zxc_write_spl_header_and_desc(p, rem, &gh, (uint32_t)sz_lit, (uint32_t)sz_tok);
 1850|  83.9k|    if (UNLIKELY(ghs < 0)) return ghs;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1851|       |
 1852|  83.9k|    uint8_t* p_curr = p + ghs;
 1853|  83.9k|    rem -= (size_t)ghs;
 1854|       |
 1855|  83.9k|    if (UNLIKELY(rem < sz_lit)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1856|       |
 1857|  83.9k|    if (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN) {
  ------------------
  |  Branch (1857:9): [True: 0, False: 83.9k]
  ------------------
 1858|      0|        const int written =
 1859|      0|            zxc_huf_encode_section(literals, lit_c, lit_freq, huf_code_len, p_curr, rem);
  ------------------
  |  |   30|      0|#define zxc_huf_encode_section ZXC_CAT(zxc_huf_encode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1860|      0|        if (UNLIKELY(written < 0)) return written;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1861|      0|        if (UNLIKELY((size_t)written != huf_total_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1862|      0|        p_curr += written;
 1863|  83.9k|    } else if (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN_DICT) {
  ------------------
  |  Branch (1863:16): [True: 0, False: 83.9k]
  ------------------
 1864|      0|        const int written =
 1865|      0|            zxc_huf_encode_section_dict(literals, lit_c, lit_freq, ctx->dict_huf->code_len,
  ------------------
  |  |   31|      0|#define zxc_huf_encode_section_dict ZXC_CAT(zxc_huf_encode_section_dict, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1866|      0|                                        &ctx->dict_huf->tree, ctx->dict_huf->codes, p_curr, rem);
 1867|      0|        if (UNLIKELY(written < 0)) return written;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1868|      0|        if (UNLIKELY((size_t)written != huf_dict_total_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1869|      0|        p_curr += written;
 1870|  83.9k|    } else if (enc_lit == ZXC_SECTION_ENCODING_RLE) {
  ------------------
  |  Branch (1870:16): [True: 22.4k, False: 61.5k]
  ------------------
 1871|       |        // Write RLE - optimized single-pass encoding
 1872|  22.4k|        const uint8_t* lit_ptr = literals;
 1873|  22.4k|        const uint8_t* const lit_end = literals + lit_c;
 1874|       |
 1875|  1.60M|        while (lit_ptr < lit_end) {
  ------------------
  |  Branch (1875:16): [True: 1.58M, False: 22.4k]
  ------------------
 1876|  1.58M|            uint8_t b = *lit_ptr;
 1877|  1.58M|            const uint8_t* run_start = lit_ptr++;
 1878|       |
 1879|  8.31M|            while (lit_ptr < lit_end && *lit_ptr == b) lit_ptr++;
  ------------------
  |  Branch (1879:20): [True: 8.30M, False: 5.24k]
  |  Branch (1879:41): [True: 6.73M, False: 1.57M]
  ------------------
 1880|  1.58M|            size_t run = (size_t)(lit_ptr - run_start);
 1881|       |
 1882|  1.58M|            if (run >= ZXC_LIT_RLE_RUN_MIN) {
  ------------------
  |  |  550|  1.58M|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (1882:17): [True: 812k, False: 767k]
  ------------------
 1883|       |                // RLE runs: emit 2-byte tokens (header + value)
 1884|  1.63M|                while (run >= ZXC_LIT_RLE_RUN_MIN) {
  ------------------
  |  |  550|  1.63M|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (1884:24): [True: 818k, False: 812k]
  ------------------
 1885|   818k|                    size_t chunk = (run > ZXC_LIT_RLE_RUN_MAX) ? ZXC_LIT_RLE_RUN_MAX : run;
  ------------------
  |  |  552|   818k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  546|   818k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|   818k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  550|   818k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
                                  size_t chunk = (run > ZXC_LIT_RLE_RUN_MAX) ? ZXC_LIT_RLE_RUN_MAX : run;
  ------------------
  |  |  552|  5.51k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  546|  5.51k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|  5.51k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  550|  5.51k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
  |  Branch (1885:36): [True: 5.51k, False: 812k]
  ------------------
 1886|   818k|                    *p_curr++ = (uint8_t)(ZXC_LIT_RLE_FLAG | (chunk - ZXC_LIT_RLE_RUN_MIN));
  ------------------
  |  |  544|   818k|#define ZXC_LIT_RLE_FLAG 0x80U
  ------------------
                                  *p_curr++ = (uint8_t)(ZXC_LIT_RLE_FLAG | (chunk - ZXC_LIT_RLE_RUN_MIN));
  ------------------
  |  |  550|   818k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
 1887|   818k|                    *p_curr++ = b;
 1888|   818k|                    run -= chunk;
 1889|   818k|                }
 1890|       |                // Leftover < 4 bytes: emit as literal
 1891|   812k|                if (run > 0) {
  ------------------
  |  Branch (1891:21): [True: 162, False: 812k]
  ------------------
 1892|    162|                    *p_curr++ = (uint8_t)(run - 1);
 1893|    162|                    ZXC_MEMCPY(p_curr, lit_ptr - run, run);
  ------------------
  |  |  170|    162|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1894|    162|                    p_curr += run;
 1895|    162|                }
 1896|   812k|            } else {
 1897|       |                // Literal run: scan ahead to find next RLE opportunity
 1898|   767k|                const uint8_t* lit_run_start = run_start;
 1899|       |
 1900|  60.3M|                while (lit_ptr < lit_end) {
  ------------------
  |  Branch (1900:24): [True: 60.3M, False: 18.5k]
  ------------------
 1901|  60.3M|                    if (UNLIKELY(lit_ptr + 3 < lit_end && lit_ptr[0] == lit_ptr[1] &&
  ------------------
  |  |  154|   245M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 749k, False: 59.5M]
  |  |  |  Branch (154:42): [True: 60.2M, False: 49.9k]
  |  |  |  Branch (154:42): [True: 3.27M, False: 56.9M]
  |  |  |  Branch (154:42): [True: 1.16M, False: 2.10M]
  |  |  |  Branch (154:42): [True: 749k, False: 418k]
  |  |  ------------------
  ------------------
 1902|  60.3M|                                 lit_ptr[1] == lit_ptr[2] && lit_ptr[2] == lit_ptr[3])) {
 1903|   749k|                        break;
 1904|   749k|                    }
 1905|  59.5M|                    lit_ptr++;
 1906|  59.5M|                }
 1907|       |
 1908|   767k|                size_t lit_run = (size_t)(lit_ptr - lit_run_start);
 1909|   767k|                const uint8_t* src_ptr = lit_run_start;
 1910|       |
 1911|       |                // Emit literal chunks (ZXC_LIT_RUN_MAX bytes each at most)
 1912|  1.87M|                while (lit_run > 0) {
  ------------------
  |  Branch (1912:24): [True: 1.10M, False: 767k]
  ------------------
 1913|  1.10M|                    size_t chunk = (lit_run > ZXC_LIT_RUN_MAX) ? ZXC_LIT_RUN_MAX : lit_run;
  ------------------
  |  |  548|  1.10M|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  546|  1.10M|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|  1.10M|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  size_t chunk = (lit_run > ZXC_LIT_RUN_MAX) ? ZXC_LIT_RUN_MAX : lit_run;
  ------------------
  |  |  548|   334k|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  546|   334k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  544|   334k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1913:36): [True: 334k, False: 767k]
  ------------------
 1914|  1.10M|                    *p_curr++ = (uint8_t)(chunk - 1);
 1915|  1.10M|                    ZXC_MEMCPY(p_curr, src_ptr, chunk);
  ------------------
  |  |  170|  1.10M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1916|  1.10M|                    p_curr += chunk;
 1917|  1.10M|                    src_ptr += chunk;
 1918|  1.10M|                    lit_run -= chunk;
 1919|  1.10M|                }
 1920|   767k|            }
 1921|  1.58M|        }
 1922|  61.5k|    } else {
 1923|  61.5k|        ZXC_MEMCPY(p_curr, literals, lit_c);
  ------------------
  |  |  170|  61.5k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1924|  61.5k|        p_curr += lit_c;
 1925|  61.5k|    }
 1926|  83.9k|    rem -= sz_lit;
 1927|       |
 1928|  83.9k|    if (UNLIKELY(rem < sz_tok)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1929|       |
 1930|  83.9k|    if (enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) {
  ------------------
  |  Branch (1930:9): [True: 0, False: 83.9k]
  ------------------
 1931|      0|        const int written =
 1932|      0|            zxc_huf_encode_section(buf_tokens, seq_c, tfreq, tok_code_len, p_curr, rem);
  ------------------
  |  |   30|      0|#define zxc_huf_encode_section ZXC_CAT(zxc_huf_encode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1933|      0|        if (UNLIKELY(written < 0)) return written;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1934|      0|        if (UNLIKELY((size_t)written != tok_huf_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1935|      0|        p_curr += written;
 1936|  83.9k|    } else {
 1937|  83.9k|        ZXC_MEMCPY(p_curr, buf_tokens, seq_c);
  ------------------
  |  |  170|  83.9k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1938|  83.9k|        p_curr += seq_c;
 1939|  83.9k|    }
 1940|  83.9k|    rem -= sz_tok;
 1941|       |
 1942|  83.9k|    if (UNLIKELY(rem < sz_off)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1943|       |
 1944|  83.9k|    if (use_8bit_off) {
  ------------------
  |  Branch (1944:9): [True: 37.5k, False: 46.4k]
  ------------------
 1945|       |        // Write 1-byte offsets - unroll for better throughput
 1946|  37.5k|        uint32_t i = 0;
 1947|  61.7k|        for (; i + 8 <= seq_c; i += 8) {
  ------------------
  |  Branch (1947:16): [True: 24.2k, False: 37.5k]
  ------------------
 1948|  24.2k|            p_curr[0] = (uint8_t)buf_offsets[i + 0];
 1949|  24.2k|            p_curr[1] = (uint8_t)buf_offsets[i + 1];
 1950|  24.2k|            p_curr[2] = (uint8_t)buf_offsets[i + 2];
 1951|  24.2k|            p_curr[3] = (uint8_t)buf_offsets[i + 3];
 1952|  24.2k|            p_curr[4] = (uint8_t)buf_offsets[i + 4];
 1953|  24.2k|            p_curr[5] = (uint8_t)buf_offsets[i + 5];
 1954|  24.2k|            p_curr[6] = (uint8_t)buf_offsets[i + 6];
 1955|  24.2k|            p_curr[7] = (uint8_t)buf_offsets[i + 7];
 1956|  24.2k|            p_curr += 8;
 1957|  24.2k|        }
 1958|  76.6k|        for (; i < seq_c; i++) {
  ------------------
  |  Branch (1958:16): [True: 39.0k, False: 37.5k]
  ------------------
 1959|  39.0k|            *p_curr++ = (uint8_t)buf_offsets[i];
 1960|  39.0k|        }
 1961|  46.4k|    } else {
 1962|       |        // Write 2-byte offsets in little-endian order
 1963|       |#ifdef ZXC_BIG_ENDIAN
 1964|       |        for (uint32_t i = 0; i < seq_c; i++) {
 1965|       |            zxc_store_le16(p_curr, buf_offsets[i]);
 1966|       |            p_curr += sizeof(uint16_t);
 1967|       |        }
 1968|       |#else
 1969|  46.4k|        ZXC_MEMCPY(p_curr, buf_offsets, seq_c * sizeof(uint16_t));
  ------------------
  |  |  170|  46.4k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1970|  46.4k|        p_curr += seq_c * sizeof(uint16_t);
 1971|  46.4k|#endif
 1972|  46.4k|    }
 1973|  83.9k|    rem -= sz_off;
 1974|       |
 1975|       |    // The sections behind the literals must total ZXC_BLOCK_LIT_SLACK bytes so
 1976|       |    // the decoder's literal wild-copy can overshoot. Tokens and offsets alone
 1977|       |    // clear it from 16 sequences on, so pad is 0 on any real block. It rides
 1978|       |    // inside the extras section, which the decoder sizes from the payload
 1979|       |    // residue - hence no wire field.
 1980|  83.9k|    const size_t behind_lit = sz_tok + sz_off + sz_ext;
 1981|  83.9k|    const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  345|  83.9k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
                  const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  345|  47.6k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
  |  Branch (1981:24): [True: 47.6k, False: 36.3k]
  ------------------
 1982|       |
 1983|  83.9k|    if (UNLIKELY(rem < sz_ext + pad)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1984|       |
 1985|  83.9k|    ZXC_MEMCPY(p_curr, buf_extras, extras_sz);
  ------------------
  |  |  170|  83.9k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1986|  83.9k|    p_curr += extras_sz;
 1987|       |
 1988|  83.9k|    ZXC_MEMSET(p_curr, 0, pad);
  ------------------
  |  |  175|  83.9k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1989|  83.9k|    p_curr += pad;
 1990|       |
 1991|  83.9k|    bh.comp_size = (uint32_t)(p_curr - (dst + ZXC_BLOCK_HEADER_SIZE));
  ------------------
  |  |  428|  83.9k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1992|  83.9k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 1993|  83.9k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  154|  83.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 83.9k]
  |  |  ------------------
  ------------------
 1994|       |
 1995|       |    // Checksum will be appended by the wrapper
 1996|  83.9k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + bh.comp_size;
  ------------------
  |  |  428|  83.9k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1997|  83.9k|    return ZXC_OK;
 1998|  83.9k|}
zxc_compress.c:zxc_spl_put_seq:
  263|  5.46M|                                             const uint32_t ml, const uint16_t off_biased) {
  264|  5.46M|    const uint8_t ll_code = (ll >= ZXC_TOKEN_LL_MASK) ? ZXC_TOKEN_LL_MASK : (uint8_t)ll;
  ------------------
  |  |  511|  5.46M|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|  5.46M|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
                  const uint8_t ll_code = (ll >= ZXC_TOKEN_LL_MASK) ? ZXC_TOKEN_LL_MASK : (uint8_t)ll;
  ------------------
  |  |  511|   436k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|   436k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (264:29): [True: 436k, False: 5.02M]
  ------------------
  265|  5.46M|    const uint8_t ml_code = (ml >= ZXC_TOKEN_ML_MASK) ? ZXC_TOKEN_ML_MASK : (uint8_t)ml;
  ------------------
  |  |  513|  5.46M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  5.46M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
                  const uint8_t ml_code = (ml >= ZXC_TOKEN_ML_MASK) ? ZXC_TOKEN_ML_MASK : (uint8_t)ml;
  ------------------
  |  |  513|  1.41M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  1.41M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (265:29): [True: 1.41M, False: 4.04M]
  ------------------
  266|  5.46M|    buf_tokens[*seq_c] = (uint8_t)((ll_code << ZXC_TOKEN_LIT_BITS) | ml_code);
  ------------------
  |  |  507|  5.46M|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
  267|  5.46M|    buf_offsets[*seq_c] = off_biased;
  268|  5.46M|    if (off_biased > *max_offset) *max_offset = off_biased;
  ------------------
  |  Branch (268:9): [True: 440k, False: 5.02M]
  ------------------
  269|  5.46M|    if (UNLIKELY(!zxc_emit_extra(buf_extras, extras_sz, ll, ZXC_TOKEN_LL_MASK) ||
  ------------------
  |  |  154|  10.9M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 5.46M]
  |  |  |  Branch (154:42): [True: 0, False: 5.46M]
  |  |  |  Branch (154:42): [True: 0, False: 5.46M]
  |  |  ------------------
  ------------------
  270|  5.46M|                 !zxc_emit_extra(buf_extras, extras_sz, ml, ZXC_TOKEN_ML_MASK)))
  271|      0|        return 0;
  272|  5.46M|    (*seq_c)++;
  273|  5.46M|    return 1;
  274|  5.46M|}
zxc_compress.c:zxc_spl_match_split_block:
  378|  83.9k|                                          const uint32_t n_seq, const uint8_t cap) {
  379|  83.9k|    if (cap <= ZXC_SPL_INLINE_ML_CODE || n_seq == 0) return n_seq;
  ------------------
  |  |  666|   167k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  513|  83.9k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  83.9k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 83.9k]
  |  Branch (379:42): [True: 14.5k, False: 69.4k]
  ------------------
  380|  69.4k|    uint8_t ctx_bad[1U << ZXC_SPL_MATCH_SPLIT_CTX_BITS];
  381|  69.4k|    if (!zxc_spl_match_split_analyze(tokens, n_seq, hist_buf, ctx_bad, side)) return n_seq;
  ------------------
  |  Branch (381:9): [True: 51.4k, False: 18.0k]
  ------------------
  382|       |
  383|       |    // 1. Mark the matches to split (bad context, within the cap) and drop their
  384|       |    // varints; the other extras move forward.
  385|  18.0k|    const uint8_t* const extras_end = extras + *extras_sz;
  386|  18.0k|    size_t r = 0, w = 0;
  387|  18.0k|    uint32_t extra = 0;
  388|  3.12M|    for (uint32_t i = 0; i < n_seq; i++) {
  ------------------
  |  Branch (388:26): [True: 3.10M, False: 18.0k]
  ------------------
  389|  3.10M|        const uint8_t tok = tokens[i];
  390|  3.10M|        const int bad = ctx_bad[side[i]];
  391|  3.10M|        side[i] = 0;
  392|  3.10M|        if ((tok >> ZXC_TOKEN_LIT_BITS) == ZXC_TOKEN_LL_MASK)
  ------------------
  |  |  507|  3.10M|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
                      if ((tok >> ZXC_TOKEN_LIT_BITS) == ZXC_TOKEN_LL_MASK)
  ------------------
  |  |  511|  3.10M|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|  3.10M|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (392:13): [True: 196k, False: 2.90M]
  ------------------
  393|   196k|            zxc_varint_keep(extras, &w, &r, extras_end);
  394|  3.10M|        if ((tok & ZXC_TOKEN_ML_MASK) != ZXC_TOKEN_ML_MASK) continue;
  ------------------
  |  |  513|  3.10M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  3.10M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
                      if ((tok & ZXC_TOKEN_ML_MASK) != ZXC_TOKEN_ML_MASK) continue;
  ------------------
  |  |  513|  3.10M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  3.10M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (394:13): [True: 2.58M, False: 524k]
  ------------------
  395|   524k|        const uint8_t* p = extras + r;
  396|   524k|        const uint32_t code = zxc_read_varint(&p, extras_end) + ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  513|   524k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|   524k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  397|   524k|        if (bad && code <= cap) {
  ------------------
  |  Branch (397:13): [True: 404k, False: 120k]
  |  Branch (397:20): [True: 287k, False: 117k]
  ------------------
  398|   287k|            side[i] = (uint8_t)code;
  399|   287k|            extra += zxc_spl_match_split_pieces(code) - 1;
  400|   287k|            r = (size_t)(p - extras);
  401|   287k|        } else {
  402|   237k|            zxc_extras_move(extras, &w, &r, p);
  403|   237k|        }
  404|   524k|    }
  405|  18.0k|    *extras_sz = w;
  406|  18.0k|    if (extra == 0) return n_seq;
  ------------------
  |  Branch (406:9): [True: 2.29k, False: 15.7k]
  ------------------
  407|       |
  408|       |    // 2. Expand backward. A marked sequence spans its pieces, written forward: the
  409|       |    // first keeps the literal nibble and its escape, the last takes the remainder.
  410|  15.7k|    uint32_t out = n_seq + extra;
  411|  3.02M|    for (uint32_t i = n_seq; i-- > 0;) {
  ------------------
  |  Branch (411:30): [True: 3.00M, False: 15.7k]
  ------------------
  412|  3.00M|        const uint8_t tok = tokens[i];
  413|  3.00M|        const uint16_t off = offsets[i];
  414|  3.00M|        if (side[i] == 0) {
  ------------------
  |  Branch (414:13): [True: 2.72M, False: 287k]
  ------------------
  415|  2.72M|            out--;
  416|  2.72M|            tokens[out] = tok;
  417|  2.72M|            offsets[out] = off;
  418|  2.72M|            continue;
  419|  2.72M|        }
  420|   287k|        uint32_t code = side[i];
  421|   287k|        uint8_t ll_bits = tok & (uint8_t)(ZXC_TOKEN_LL_MASK << ZXC_TOKEN_LIT_BITS);
  ------------------
  |  |  511|   287k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|   287k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
                      uint8_t ll_bits = tok & (uint8_t)(ZXC_TOKEN_LL_MASK << ZXC_TOKEN_LIT_BITS);
  ------------------
  |  |  507|   287k|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
  422|   287k|        out -= zxc_spl_match_split_pieces(code);
  423|   287k|        uint32_t k = out;
  424|   574k|        while (code > ZXC_SPL_INLINE_ML_CODE) {
  ------------------
  |  |  666|   574k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  513|   574k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|   574k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (424:16): [True: 287k, False: 287k]
  ------------------
  425|   287k|            const uint32_t p = zxc_spl_match_split_piece(code);
  426|   287k|            tokens[k] = (uint8_t)(ll_bits | p);
  427|   287k|            offsets[k++] = off;
  428|   287k|            ll_bits = 0;
  429|   287k|            code -= p + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|   287k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  430|   287k|        }
  431|   287k|        tokens[k] = (uint8_t)(ll_bits | code);
  432|   287k|        offsets[k] = off;
  433|   287k|    }
  434|  15.7k|    return n_seq + extra;
  435|  18.0k|}
zxc_compress.c:zxc_spl_match_split_analyze:
  315|  69.4k|                                       uint8_t* RESTRICT ctx_bad, uint8_t* RESTRICT side) {
  316|  69.4k|    uint32_t order = ZXC_SPL_MATCH_SPLIT_CTX_BITS;
  ------------------
  |  | 1007|  69.4k|#define ZXC_SPL_MATCH_SPLIT_CTX_BITS 8
  ------------------
  317|   471k|    while (order > 2 && (n_seq >> order) < 16) order--;
  ------------------
  |  Branch (317:12): [True: 412k, False: 59.2k]
  |  Branch (317:25): [True: 401k, False: 10.1k]
  ------------------
  318|  69.4k|    const uint32_t hmask = (1U << order) - 1U;
  319|  69.4k|    uint32_t (*const ctx_hist)[2][1U << ZXC_SPL_MATCH_SPLIT_CTX_BITS] = *hist_buf;
  320|   347k|    for (uint32_t l = 0; l < 4; l++) {
  ------------------
  |  Branch (320:26): [True: 277k, False: 69.4k]
  ------------------
  321|   277k|        ZXC_MEMSET(ctx_hist[l][0], 0, (hmask + 1) * sizeof(uint32_t));
  ------------------
  |  |  175|   277k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  322|   277k|        ZXC_MEMSET(ctx_hist[l][1], 0, (hmask + 1) * sizeof(uint32_t));
  ------------------
  |  |  175|   277k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  323|   277k|    }
  324|  69.4k|    uint32_t hist = 0, n_esc = 0;
  325|  5.53M|    for (uint32_t i = 0; i < n_seq; i++) {
  ------------------
  |  Branch (325:26): [True: 5.46M, False: 69.4k]
  ------------------
  326|  5.46M|        const uint32_t esc = (tokens[i] & ZXC_TOKEN_ML_MASK) == ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  513|  5.46M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  5.46M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
                      const uint32_t esc = (tokens[i] & ZXC_TOKEN_ML_MASK) == ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  513|  5.46M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  5.46M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  327|  5.46M|        side[i] = (uint8_t)hist;
  328|  5.46M|        ctx_hist[i & 3][esc][hist]++;
  329|  5.46M|        hist = ((hist << 1) | esc) & hmask;
  330|  5.46M|        n_esc += esc;
  331|  5.46M|    }
  332|       |    // No conditional sum here: GCC 14.2 miscompiles it for AVX-512
  333|  69.4k|    uint32_t errors = 0;
  334|   459k|    for (uint32_t c = 0; c <= hmask; c++) {
  ------------------
  |  Branch (334:26): [True: 390k, False: 69.4k]
  ------------------
  335|   390k|        uint32_t n0 = 0, n1 = 0;
  336|  1.95M|        for (uint32_t l = 0; l < 4; l++) {
  ------------------
  |  Branch (336:30): [True: 1.56M, False: 390k]
  ------------------
  337|  1.56M|            n0 += ctx_hist[l][0][c];
  338|  1.56M|            n1 += ctx_hist[l][1][c];
  339|  1.56M|        }
  340|   390k|        ctx_bad[c] = (n1 < n0);  // escape a strict minority in its context
  341|   390k|        errors += (n0 < n1) ? n0 : n1;
  ------------------
  |  Branch (341:19): [True: 117k, False: 272k]
  ------------------
  342|   390k|    }
  343|  69.4k|    return n_esc != 0 &&
  ------------------
  |  Branch (343:12): [True: 64.2k, False: 5.22k]
  ------------------
  344|  64.2k|           (uint64_t)errors * 100 >= (uint64_t)ZXC_SPL_MATCH_SPLIT_MIN_MISPREDICT_PCT * n_esc;
  ------------------
  |  | 1010|  64.2k|#define ZXC_SPL_MATCH_SPLIT_MIN_MISPREDICT_PCT 80
  ------------------
  |  Branch (344:12): [True: 18.0k, False: 46.1k]
  ------------------
  345|  69.4k|}
zxc_compress.c:zxc_varint_keep:
  284|   196k|                                              size_t* RESTRICT r, const uint8_t* end) {
  285|   196k|    const uint8_t* p = extras + *r;
  286|   196k|    (void)zxc_read_varint(&p, end);
  287|   196k|    zxc_extras_move(extras, w, r, p);
  288|   196k|}
zxc_compress.c:zxc_spl_match_split_pieces:
  291|   574k|static ZXC_ALWAYS_INLINE uint32_t zxc_spl_match_split_pieces(const uint32_t code) {
  292|   574k|    return (code + ZXC_LZ_MIN_MATCH_LEN + ZXC_SPL_MAX_INLINE_ML - 1) / ZXC_SPL_MAX_INLINE_ML;
  ------------------
  |  |  575|   574k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
                  return (code + ZXC_LZ_MIN_MATCH_LEN + ZXC_SPL_MAX_INLINE_ML - 1) / ZXC_SPL_MAX_INLINE_ML;
  ------------------
  |  |  672|   574k|#define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  666|   574k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  513|   574k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  509|   574k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  575|   574k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  ------------------
  ------------------
                  return (code + ZXC_LZ_MIN_MATCH_LEN + ZXC_SPL_MAX_INLINE_ML - 1) / ZXC_SPL_MAX_INLINE_ML;
  ------------------
  |  |  672|   574k|#define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  666|   574k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  513|   574k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  509|   574k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  575|   574k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  ------------------
  ------------------
  293|   574k|}
zxc_compress.c:zxc_extras_move:
  278|   434k|                                              size_t* RESTRICT r, const uint8_t* to) {
  279|   913k|    while (extras + *r < to) extras[(*w)++] = extras[(*r)++];
  ------------------
  |  Branch (279:12): [True: 479k, False: 434k]
  ------------------
  280|   434k|}
zxc_compress.c:zxc_spl_match_split_piece:
  297|   287k|static ZXC_ALWAYS_INLINE uint32_t zxc_spl_match_split_piece(const uint32_t code) {
  298|   287k|    const uint32_t rest = code - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|   287k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  299|   287k|    return (rest < ZXC_SPL_INLINE_ML_CODE) ? rest : ZXC_SPL_INLINE_ML_CODE;
  ------------------
  |  |  666|   287k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  513|   287k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|   287k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  return (rest < ZXC_SPL_INLINE_ML_CODE) ? rest : ZXC_SPL_INLINE_ML_CODE;
  ------------------
  |  |  666|   160k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  513|   160k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|   160k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (299:12): [True: 126k, False: 160k]
  ------------------
  300|   287k|}
zxc_compress.c:zxc_rle_pair_mask:
  122|  15.0M|static ZXC_ALWAYS_INLINE zxc_rle_mask_t zxc_rle_pair_mask(const uint8_t* p) {
  123|  15.0M|    const __m128i v0 = _mm_loadu_si128((const __m128i*)p);
  124|  15.0M|    const __m128i v1 = _mm_loadu_si128((const __m128i*)(p + 1));
  125|  15.0M|    return (uint32_t)_mm_movemask_epi8(_mm_cmpeq_epi8(v0, v1));
  126|  15.0M|}
zxc_compress.c:zxc_encode_block_raw:
 2190|  36.1k|                                size_t* RESTRICT const out_sz) {
 2191|  36.1k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE + src_sz)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  36.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 36.1k]
  |  |  ------------------
  ------------------
 2192|       |
 2193|  36.1k|    zxc_block_header_t bh;
 2194|  36.1k|    bh.block_type = ZXC_BLOCK_RAW;
 2195|  36.1k|    bh.block_flags = 0;  // Checksum flag moved to file header
 2196|  36.1k|    bh.reserved = 0;
 2197|  36.1k|    bh.comp_size = (uint32_t)src_sz;
 2198|       |
 2199|  36.1k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 2200|  36.1k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  154|  36.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 36.1k]
  |  |  ------------------
  ------------------
 2201|       |
 2202|  36.1k|    ZXC_MEMCPY(dst + ZXC_BLOCK_HEADER_SIZE, src, src_sz);
  ------------------
  |  |  170|  36.1k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2203|       |
 2204|       |    // Checksum will be appended by the wrapper
 2205|  36.1k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + src_sz;
  ------------------
  |  |  428|  36.1k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2206|  36.1k|    return ZXC_OK;
 2207|  36.1k|}

zxc_decompress_chunk_wrapper_default:
 1654|   476k|                                 const uint64_t block_index) {
 1655|   476k|    return zxc_decompress_chunk_wrapper_body(ctx, src, src_sz, dst, dst_cap, block_index, 0, 0);
 1656|   476k|}
zxc_decompress.c:zxc_decompress_chunk_wrapper_body:
 1588|   476k|    const int safe) {
 1589|   476k|    if (UNLIKELY(src_sz < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|   476k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 476k]
  |  |  ------------------
  ------------------
 1590|       |
 1591|   476k|    const uint8_t type = src[0];
 1592|   476k|    const uint32_t comp_sz = zxc_le32(src + 3);
 1593|   476k|    const int has_checksum = ctx->checksum_enabled;
 1594|       |
 1595|       |    // A block never compresses past its own content size
 1596|   476k|    if (UNLIKELY((uint64_t)comp_sz > (uint64_t)ctx->chunk_size)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  154|   476k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 476k]
  |  |  ------------------
  ------------------
 1597|       |
 1598|       |    // Check bounds: Header + Body + Checksum(if any)
 1599|   476k|    const size_t expected_sz =
 1600|   476k|        (size_t)ZXC_BLOCK_HEADER_SIZE + comp_sz + (has_checksum ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  428|   476k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                      (size_t)ZXC_BLOCK_HEADER_SIZE + comp_sz + (has_checksum ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  430|      0|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (1600:52): [True: 0, False: 476k]
  ------------------
 1601|   476k|    if (UNLIKELY(src_sz < expected_sz)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|   476k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 476k]
  |  |  ------------------
  ------------------
 1602|       |
 1603|   476k|    const uint8_t* data = src + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|   476k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1604|       |
 1605|   476k|    int decoded_sz = ZXC_ERROR_BAD_BLOCK_TYPE;
 1606|       |
 1607|   476k|    switch (type) {
 1608|   211k|        case ZXC_BLOCK_SPL:
  ------------------
  |  Branch (1608:9): [True: 211k, False: 264k]
  ------------------
 1609|   211k|            decoded_sz = safe       ? zxc_decode_block_spl_safe(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1609:26): [True: 0, False: 211k]
  ------------------
 1610|   211k|                         : has_dict ? zxc_decode_block_spl_dict(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1610:28): [True: 0, False: 211k]
  ------------------
 1611|   211k|                                    : zxc_decode_block_spl(ctx, data, comp_sz, dst, dst_cap);
 1612|   211k|            break;
 1613|   146k|        case ZXC_BLOCK_PAK:
  ------------------
  |  Branch (1613:9): [True: 146k, False: 329k]
  ------------------
 1614|   146k|            decoded_sz = safe       ? zxc_decode_block_pak_safe(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1614:26): [True: 0, False: 146k]
  ------------------
 1615|   146k|                         : has_dict ? zxc_decode_block_pak_dict(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1615:28): [True: 0, False: 146k]
  ------------------
 1616|   146k|                                    : zxc_decode_block_pak(ctx, data, comp_sz, dst, dst_cap);
 1617|   146k|            break;
 1618|   119k|        case ZXC_BLOCK_RAW:
  ------------------
  |  Branch (1618:9): [True: 119k, False: 356k]
  ------------------
 1619|       |            // For RAW blocks, comp_sz == raw_sz (uncompressed data stored as-is)
 1620|   119k|            if (UNLIKELY(comp_sz > dst_cap)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|   119k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 119k]
  |  |  ------------------
  ------------------
 1621|   119k|            ZXC_MEMCPY(dst, data, comp_sz);
  ------------------
  |  |  170|   119k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1622|   119k|            decoded_sz = (int)comp_sz;
 1623|   119k|            break;
 1624|      0|        case ZXC_BLOCK_EOF:
  ------------------
  |  Branch (1624:9): [True: 0, False: 476k]
  ------------------
 1625|       |            // EOF should be handled by the dispatcher, not here
 1626|      0|            return ZXC_ERROR_CORRUPT_DATA;
 1627|      0|        default:
  ------------------
  |  Branch (1627:9): [True: 0, False: 476k]
  ------------------
 1628|      0|            return ZXC_ERROR_BAD_BLOCK_TYPE;
 1629|   476k|    }
 1630|       |
 1631|       |    // dst_cap includes the wild-copy margin: bound the block itself
 1632|   478k|    if (UNLIKELY(decoded_sz > 0 && (size_t)decoded_sz > ctx->chunk_size))
  ------------------
  |  |  154|   954k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 168, False: 478k]
  |  |  |  Branch (154:42): [True: 476k, False: 2.40k]
  |  |  |  Branch (154:42): [True: 168, False: 476k]
  |  |  ------------------
  ------------------
 1633|    168|        return ZXC_ERROR_BAD_BLOCK_SIZE;
 1634|       |
 1635|   478k|    if (has_checksum && LIKELY(decoded_sz >= 0)) {
  ------------------
  |  |  148|      0|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1635:9): [True: 0, False: 478k]
  ------------------
 1636|      0|        const uint32_t stored = zxc_le32(data + comp_sz);
 1637|      0|        if (UNLIKELY(stored !=
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1638|      0|                     zxc_checksum(dst, (size_t)decoded_sz, block_index, ZXC_CHECKSUM_RAPIDHASH)))
 1639|      0|            return ZXC_ERROR_BAD_CHECKSUM;
 1640|      0|    }
 1641|       |
 1642|   478k|    return decoded_sz;
 1643|   478k|}
zxc_decompress.c:zxc_decode_block_spl_impl:
  796|   211k|                                                       const int has_dict, const int tok_entropy) {
  797|   211k|    zxc_gnr_header_t gh;
  798|       |
  799|       |    // Constant 0 when !has_dict, so `d_floor` folds to `dst`.
  800|   211k|    const size_t dict_size = has_dict ? ctx->dict_size : 0;
  ------------------
  |  Branch (800:30): [True: 0, False: 211k]
  ------------------
  801|   211k|    uint32_t lit_comp;
  802|   211k|    uint32_t tok_comp;
  803|       |
  804|   211k|    const int hdr_sz = zxc_read_spl_header_and_desc(src, src_size, &gh, &lit_comp, &tok_comp);
  805|   211k|    if (UNLIKELY(hdr_sz < 0)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|   211k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 211k]
  |  |  ------------------
  ------------------
  806|       |
  807|       |    // Only 0 and 1 are defined widths.
  808|   211k|    if (UNLIKELY(gh.enc_off > 1)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   211k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 34, False: 211k]
  |  |  ------------------
  ------------------
  809|       |
  810|       |    // Entropy-coded tokens (level 7): tail-call the dedicated instantiation
  811|       |    // before any section work - it restarts from the header, so only the parse
  812|       |    // above is duplicated. Flags are constant per instantiation, so exactly one
  813|       |    // call survives and t_ptr keeps a single provenance below.
  814|   211k|    if (!tok_entropy && UNLIKELY(gh.enc_tok == ZXC_SECTION_ENCODING_HUFFMAN)) {
  ------------------
  |  |  154|   209k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10, False: 209k]
  |  |  ------------------
  ------------------
  |  Branch (814:9): [True: 209k, False: 1.45k]
  ------------------
  815|     10|        if (safe) return zxc_decode_block_spl_entropy_safe(ctx, src, src_size, dst, dst_capacity);
  ------------------
  |  Branch (815:13): [True: 0, False: 10]
  ------------------
  816|     10|        if (has_dict)
  ------------------
  |  Branch (816:13): [True: 0, False: 10]
  ------------------
  817|      0|            return zxc_decode_block_spl_entropy_dict(ctx, src, src_size, dst, dst_capacity);
  818|     10|        return zxc_decode_block_spl_entropy(ctx, src, src_size, dst, dst_capacity);
  819|     10|    }
  820|       |
  821|   211k|    const uint8_t* p_data = src + (size_t)hdr_sz;
  822|   211k|    const uint8_t* p_curr = p_data;
  823|       |
  824|       |    // --- Literal Stream Setup ---
  825|   211k|    const uint8_t* l_ptr;
  826|   211k|    const uint8_t* l_end;
  827|   211k|    uint8_t* rle_buf = NULL;
  828|       |
  829|   211k|    size_t lit_stream_size = lit_comp;
  830|       |    // Decoded size of an encoded literal section (RAW ignores it).
  831|   211k|    const size_t required_size = gh.n_literals;
  832|       |
  833|   211k|    if (gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN ||
  ------------------
  |  Branch (833:9): [True: 1.35k, False: 210k]
  ------------------
  834|   210k|        gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN_DICT) {
  ------------------
  |  Branch (834:9): [True: 18.4E, False: 210k]
  ------------------
  835|      8|        if (UNLIKELY(lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  154|      8|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2, False: 6]
  |  |  ------------------
  ------------------
  836|      2|            return ZXC_ERROR_CORRUPT_DATA;
  837|      6|        if (required_size == 0) {
  ------------------
  |  Branch (837:13): [True: 0, False: 6]
  ------------------
  838|      0|            l_ptr = p_curr;
  839|      0|            l_end = p_curr;
  840|      6|        } else {
  841|      6|            if (UNLIKELY(required_size > dst_capacity || required_size > SIZE_MAX - ZXC_PAD_SIZE))
  ------------------
  |  |  154|     12|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 6]
  |  |  |  Branch (154:42): [True: 0, False: 6]
  |  |  |  Branch (154:42): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  842|      0|                return ZXC_ERROR_DST_TOO_SMALL;
  843|      6|            const int rc =
  844|      6|                (gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN)
  ------------------
  |  Branch (844:17): [True: 0, False: 6]
  ------------------
  845|      6|                    ? zxc_decode_lit_pivco(ctx, p_curr, lit_stream_size, required_size)
  846|      6|                    : zxc_decode_lit_pivco_dict(ctx, p_curr, lit_stream_size, required_size);
  847|      6|            if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|      6|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  848|      0|            l_ptr = ctx->lit_buffer;
  849|      0|            l_end = ctx->lit_buffer + required_size;
  850|      0|        }
  851|   211k|    } else if (gh.enc_lit == ZXC_SECTION_ENCODING_RLE) {
  ------------------
  |  Branch (851:16): [True: 70.3k, False: 141k]
  ------------------
  852|  70.3k|        if (required_size > 0) {
  ------------------
  |  Branch (852:13): [True: 70.3k, False: 0]
  ------------------
  853|  70.3k|            if (UNLIKELY(required_size > dst_capacity || required_size > SIZE_MAX - ZXC_PAD_SIZE))
  ------------------
  |  |  154|   140k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 102, False: 70.2k]
  |  |  |  Branch (154:42): [True: 103, False: 70.2k]
  |  |  |  Branch (154:42): [True: 0, False: 70.2k]
  |  |  ------------------
  ------------------
  854|    102|                return ZXC_ERROR_DST_TOO_SMALL;
  855|  70.2k|            const size_t alloc_size = required_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  70.2k|#define ZXC_PAD_SIZE 32
  ------------------
  856|       |
  857|       |            // lit_buffer is pre-allocated to chunk_size + ZXC_PAD_SIZE by
  858|       |            // zxc_cctx_init (mode == 0).
  859|  70.2k|            if (UNLIKELY(ctx->lit_buffer_cap < alloc_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  70.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2, False: 70.2k]
  |  |  ------------------
  ------------------
  860|       |
  861|  70.2k|            rle_buf = ctx->lit_buffer;
  862|  70.2k|            if (UNLIKELY(!rle_buf || lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  154|   140k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 88, False: 70.1k]
  |  |  |  Branch (154:42): [True: 0, False: 70.2k]
  |  |  |  Branch (154:42): [True: 88, False: 70.1k]
  |  |  ------------------
  ------------------
  863|     88|                return ZXC_ERROR_CORRUPT_DATA;
  864|       |
  865|  70.1k|            const uint8_t* r_ptr = p_curr;
  866|  70.1k|            const uint8_t* r_end = r_ptr + lit_stream_size;
  867|  70.1k|            uint8_t* w_ptr = rle_buf;
  868|  70.1k|            const uint8_t* const w_end = rle_buf + required_size;
  869|       |
  870|  6.56M|            while (r_ptr < r_end && w_ptr < w_end) {
  ------------------
  |  Branch (870:20): [True: 6.49M, False: 71.6k]
  |  Branch (870:37): [True: 6.49M, False: 18.4E]
  ------------------
  871|  6.49M|                uint8_t token = *r_ptr++;
  872|  6.49M|                if (LIKELY(!(token & ZXC_LIT_RLE_FLAG))) {
  ------------------
  |  |  148|  6.49M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 3.76M, False: 2.72M]
  |  |  ------------------
  ------------------
  873|       |                    // Raw copy (most common path): 32-byte wild copies (zxc_copy32 width)
  874|       |                    // token is 7-bit (0-127), so len is 1-128 bytes
  875|  3.76M|                    const uint32_t len = (uint32_t)token + 1;
  876|  3.76M|                    if (UNLIKELY(w_ptr + len > w_end || r_ptr + len > r_end))
  ------------------
  |  |  154|  7.52M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 188, False: 3.76M]
  |  |  |  Branch (154:42): [True: 18.4E, False: 3.76M]
  |  |  |  Branch (154:42): [True: 18.4E, False: 3.76M]
  |  |  ------------------
  ------------------
  877|    188|                        return ZXC_ERROR_CORRUPT_DATA;
  878|       |
  879|       |                    // Destination has ZXC_PAD_SIZE bytes of safe overrun space.
  880|       |                    // Source may not - check before wild copy.
  881|       |                    // Fast path: source holds a full zxc_copy32 read (most common)
  882|  3.76M|                    if (LIKELY(r_ptr + 32 <= r_end)) {
  ------------------
  |  |  148|  3.76M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 3.69M, False: 68.9k]
  |  |  ------------------
  ------------------
  883|       |                        // Single copy covers len <= 32 (most tokens)
  884|  3.69M|                        zxc_copy32(w_ptr, r_ptr);
  885|       |
  886|  3.69M|                        if (UNLIKELY(len > 32)) {
  ------------------
  |  |  154|  3.69M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.79M, False: 1.90M]
  |  |  ------------------
  ------------------
  887|       |                            // Unroll: max len=128, so max 4 copies total. The last
  888|       |                            // copy is placed to end exactly on len, overlapping the
  889|       |                            // previous one - unconditional stores beat branches here.
  890|  1.79M|                            if (len <= 64) {
  ------------------
  |  Branch (890:33): [True: 360k, False: 1.43M]
  ------------------
  891|   360k|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  892|  1.43M|                            } else if (len <= 96) {
  ------------------
  |  Branch (892:40): [True: 138k, False: 1.29M]
  ------------------
  893|   138k|                                zxc_copy32(w_ptr + 32, r_ptr + 32);
  894|   138k|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  895|  1.29M|                            } else {
  896|  1.29M|                                zxc_copy32(w_ptr + 32, r_ptr + 32);
  897|  1.29M|                                zxc_copy32(w_ptr + 64, r_ptr + 64);
  898|  1.29M|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  899|  1.29M|                            }
  900|  1.79M|                        }
  901|  3.69M|                    } else {
  902|       |                        // Near end of source: safe copy (rare cold path)
  903|  68.9k|                        ZXC_MEMCPY(w_ptr, r_ptr, len);
  ------------------
  |  |  170|  68.9k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  904|  68.9k|                    }
  905|       |
  906|  3.76M|                    w_ptr += len;
  907|  3.76M|                    r_ptr += len;
  908|  3.76M|                } else {
  909|       |                    // RLE run: fill with single byte
  910|  2.72M|                    const uint32_t len = (token & ZXC_LIT_LEN_MASK) + ZXC_LIT_RLE_RUN_MIN;
  ------------------
  |  |  546|  2.72M|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  ------------------
  |  |  |  |  544|  2.72M|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  ------------------
  ------------------
                                  const uint32_t len = (token & ZXC_LIT_LEN_MASK) + ZXC_LIT_RLE_RUN_MIN;
  ------------------
  |  |  550|  2.72M|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  911|  2.72M|                    if (UNLIKELY(w_ptr + len > w_end || r_ptr >= r_end))
  ------------------
  |  |  154|  5.47M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 136, False: 2.72M]
  |  |  |  Branch (154:42): [True: 18.4E, False: 2.74M]
  |  |  |  Branch (154:42): [True: 18.4E, False: 2.74M]
  |  |  ------------------
  ------------------
  912|    136|                        return ZXC_ERROR_CORRUPT_DATA;
  913|  2.72M|                    ZXC_MEMSET(w_ptr, *r_ptr++, len);
  ------------------
  |  |  175|  2.72M|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  914|  2.72M|                    w_ptr += len;
  915|  2.72M|                }
  916|  6.49M|            }
  917|  69.8k|            if (UNLIKELY(w_ptr != w_end || r_ptr != r_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   139k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 142, False: 69.7k]
  |  |  |  Branch (154:42): [True: 14, False: 69.8k]
  |  |  |  Branch (154:42): [True: 19, False: 69.8k]
  |  |  ------------------
  ------------------
  918|  69.7k|            l_ptr = rle_buf;
  919|  69.7k|            l_end = rle_buf + required_size;
  920|  69.7k|        } else {
  921|      0|            if (UNLIKELY(lit_stream_size != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  922|      0|            l_ptr = p_curr;
  923|      0|            l_end = p_curr;
  924|      0|        }
  925|   141k|    } else if (gh.enc_lit == ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (925:16): [True: 140k, False: 935]
  ------------------
  926|   140k|        if (UNLIKELY(lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  154|   140k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 114, False: 139k]
  |  |  ------------------
  ------------------
  927|    114|            return ZXC_ERROR_CORRUPT_DATA;
  928|   139k|        l_ptr = p_curr;
  929|   139k|        l_end = p_curr + lit_stream_size;
  930|   139k|    } else {
  931|    935|        return ZXC_ERROR_CORRUPT_DATA;
  932|    935|    }
  933|       |
  934|   209k|    p_curr += lit_stream_size;
  935|       |
  936|       |    // --- Stream Pointers & Validation ---
  937|       |    // Only the literal and token sizes are on the wire; offsets follow from the
  938|       |    // sequence count and width, and extras take the payload residue.
  939|   209k|    const size_t sz_tokens = tok_comp;
  940|   209k|    const uint64_t sz_offsets = SPL_OFF8 ? (uint64_t)gh.n_sequences : (uint64_t)gh.n_sequences * 2;
  ------------------
  |  |  553|   209k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 65.0k, False: 144k]
  |  |  ------------------
  ------------------
  941|       |
  942|   209k|    const size_t payload_avail = (size_t)(src + src_size - p_data);
  943|   209k|    const uint64_t consumed = (uint64_t)lit_stream_size + (uint64_t)sz_tokens + sz_offsets;
  944|   209k|    if (UNLIKELY(consumed > (uint64_t)payload_avail)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   209k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 217, False: 209k]
  |  |  ------------------
  ------------------
  945|   209k|    const size_t sz_extras = payload_avail - (size_t)consumed; /* slack padding included */
  946|       |
  947|       |    // RAW literals point into the caller's buffer and the wild copy overshoots,
  948|       |    // so it needs ZXC_BLOCK_LIT_SLACK readable bytes behind it. v7 staged short
  949|       |    // streams into a padded scratch here; v8 rejects instead. No underflow:
  950|       |    // lit_stream_size <= consumed <= payload_avail.
  951|   209k|    if (UNLIKELY(payload_avail - lit_stream_size < ZXC_BLOCK_LIT_SLACK))
  ------------------
  |  |  154|   209k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 6, False: 209k]
  |  |  ------------------
  ------------------
  952|      6|        return ZXC_ERROR_CORRUPT_DATA;
  953|       |
  954|       |    // Offsets/extras follow the on-disk token SECTION; sz_tokens is its size
  955|       |    // (== n_sequences when RAW, the Huffman payload size when enc_tok set).
  956|   209k|    const uint8_t* o_ptr = p_curr + sz_tokens;
  957|   209k|    const uint8_t* e_ptr = o_ptr + (size_t)sz_offsets;
  958|   209k|    const uint8_t* const e_end = e_ptr + sz_extras;
  959|       |
  960|   209k|    const uint8_t* RESTRICT t_ptr;
  961|   209k|    if (!tok_entropy) {
  ------------------
  |  Branch (961:9): [True: 209k, False: 18.4E]
  ------------------
  962|       |        // enc_tok == 2 was re-routed right after the header parse; any other
  963|       |        // value would have mis-sized the section descriptors above.
  964|   209k|        if (UNLIKELY(gh.enc_tok != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   209k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 32, False: 209k]
  |  |  ------------------
  ------------------
  965|   209k|        t_ptr = p_curr;
  966|  18.4E|    } else {
  967|  18.4E|        if (UNLIKELY(gh.enc_tok != ZXC_SECTION_ENCODING_HUFFMAN)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  18.4E|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  968|  18.4E|        const int rc = zxc_decode_tok_pivco(ctx, p_curr, sz_tokens, gh.n_sequences);
  969|  18.4E|        if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  18.4E|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  970|  18.4E|        t_ptr = ctx->tok_buffer;
  971|  18.4E|    }
  972|       |
  973|   209k|    uint8_t* d_ptr = dst;
  974|   209k|    const uint8_t* const d_end = dst + dst_capacity;
  975|       |    // Lowest address a match may reach: the dictionary prefix if any, else dst.
  976|   209k|    const uint8_t* const d_floor = dst - dict_size;
  977|       |    // 4x loop margin: four sequences without a varint, the wild-copy overshoot, 4 of safety.
  978|   209k|    const size_t d_margin_4x = 4 * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE + 4;
  ------------------
  |  |  663|   209k|#define ZXC_SPL_MAX_INLINE_OUT_PER_SEQ ((ZXC_TOKEN_LL_MASK - 1U) + ZXC_SPL_MAX_INLINE_ML) /* 33 */
  |  |  ------------------
  |  |  |  |  511|   209k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  507|   209k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_SPL_MAX_INLINE_OUT_PER_SEQ ((ZXC_TOKEN_LL_MASK - 1U) + ZXC_SPL_MAX_INLINE_ML) /* 33 */
  |  |  ------------------
  |  |  |  |  672|   209k|#define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  666|   209k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  513|   209k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  509|   209k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   209k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const size_t d_margin_4x = 4 * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE + 4;
  ------------------
  |  |  331|   209k|#define ZXC_PAD_SIZE 32
  ------------------
  979|  18.4E|    const uint8_t* const d_end_safe = (dst_capacity > d_margin_4x) ? d_end - d_margin_4x : dst;
  ------------------
  |  Branch (979:39): [True: 209k, False: 18.4E]
  ------------------
  980|       |
  981|       |    // Literal margin for the 4x loops: without a varint, ll <= 14 per sequence,
  982|       |    // so 4 * 14 = 56. Past that margin only the cold varint path checks l_ptr.
  983|   209k|    const size_t spl_sz_lit = (size_t)(l_end - l_ptr);
  984|   209k|    const size_t spl_margin_4x = 4 * (ZXC_TOKEN_LL_MASK - 1);  // 56
  ------------------
  |  |  511|   209k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|   209k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  985|   209k|    const size_t spl_margin_1x = ZXC_TOKEN_LL_MASK - 1;        // 14
  ------------------
  |  |  511|   209k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|   209k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  986|   209k|    const uint8_t* const l_end_safe_4x =
  987|   209k|        (spl_sz_lit > spl_margin_4x) ? l_end - spl_margin_4x : l_ptr;
  ------------------
  |  Branch (987:9): [True: 130k, False: 78.8k]
  ------------------
  988|   209k|    const uint8_t* const l_end_safe_1x =
  989|   209k|        (spl_sz_lit > spl_margin_1x) ? l_end - spl_margin_1x : l_ptr;
  ------------------
  |  Branch (989:9): [True: 140k, False: 69.2k]
  ------------------
  990|       |
  991|   209k|    uint32_t n_seq = gh.n_sequences;
  992|       |
  993|       |    // Offsets only need checking until the output is wider than the widest offset
  994|       |    // the format can encode (256 for 1-byte offsets, 65536 for 2-byte); past that
  995|       |    // none can reach below d_floor. A dictionary counts as already written, so a
  996|       |    // large one puts d_bounds at dst and skips the SAFE loop.
  997|   209k|    const size_t off_span = SPL_OFF8 ? (1U << 8) : (1U << 16);
  ------------------
  |  |  553|   209k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 64.7k, False: 144k]
  |  |  ------------------
  ------------------
  998|   209k|    const size_t span = (dict_size >= off_span) ? 0 : off_span - dict_size;
  ------------------
  |  Branch (998:25): [True: 0, False: 209k]
  ------------------
  999|   209k|    const uint8_t* const d_bounds = (span >= dst_capacity) ? d_end : dst + span;
  ------------------
  |  Branch (999:37): [True: 140k, False: 68.8k]
  ------------------
 1000|       |
 1001|       |    // --- SAFE Loop: offset validation until d_bounds (4x unroll) ---
 1002|   209k|    if (safe) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 209k]
  ------------------
 1003|       |        // SAFE variant: save per-batch state so overflow can rollback.
 1004|      0|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1004:16): [True: 0, False: 0]
  |  Branch (1004:30): [True: 0, False: 0]
  |  Branch (1004:52): [True: 0, False: 0]
  |  Branch (1004:77): [True: 0, False: 0]
  ------------------
 1005|      0|            const uint8_t* const t_save = t_ptr;
 1006|      0|            const uint8_t* const o_save = o_ptr;
 1007|      0|            const uint8_t* const e_save = e_ptr;
 1008|      0|            uint8_t* const d_save = d_ptr;
 1009|      0|            const uint8_t* const l_save = l_ptr;
 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  ------------------
  |  |  611|      0|    do {                                                                                           \
  |  |  612|      0|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|      0|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|      0|        uint64_t offs;                                                                             \
  |  |  615|      0|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|      0|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|      0|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|      0|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|      0|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|      0|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|      0|        } else {                                                                                   \
  |  |  621|      0|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|      0|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|      0|        }                                                                                          \
  |  |  624|      0|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|      0|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  628|      0|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|      0|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|      0|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  634|      0|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|      0|        n_seq -= 4;                                                                                \
  |  |  637|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1011|      0|            continue;
 1012|       |
 1013|      0|        rollback_safe_4x:
 1014|      0|            t_ptr = t_save;
 1015|      0|            o_ptr = o_save;
 1016|      0|            e_ptr = e_save;
 1017|      0|            d_ptr = d_save;
 1018|      0|            l_ptr = l_save;
 1019|      0|            break;
 1020|      0|        }
 1021|   209k|    } else {
 1022|  2.76M|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1022:16): [True: 2.65M, False: 115k]
  |  Branch (1022:30): [True: 2.65M, False: 18.4E]
  |  Branch (1022:52): [True: 2.56M, False: 85.8k]
  |  Branch (1022:77): [True: 2.56M, False: 8.97k]
  ------------------
 1023|  2.56M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  ------------------
  |  |  611|  2.56M|    do {                                                                                           \
  |  |  612|  2.56M|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|  2.56M|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|  2.56M|        uint64_t offs;                                                                             \
  |  |  615|  2.56M|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|  2.56M|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 24.7k, False: 2.53M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|  24.7k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|  24.7k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|  24.7k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|  24.7k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|  2.53M|        } else {                                                                                   \
  |  |  621|  2.53M|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|  2.53M|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|  2.53M|        }                                                                                          \
  |  |  624|  2.56M|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|  2.56M|    do {                                                                                        \
  |  |  |  |  570|  2.56M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  2.56M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  2.56M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 282k, False: 2.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|   282k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|   282k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|   282k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|   282k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|   282k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|   282k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   565k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 10, False: 282k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 282k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 282k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|   282k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|   282k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|   282k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|   282k|                ON_FAIL;                                                                        \
  |  |  |  |  583|   282k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  2.27M|        } else {                                                                                \
  |  |  |  |  585|  2.27M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  2.27M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  2.27M|        }                                                                                       \
  |  |  |  |  588|  2.56M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  2.56M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  2.56M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 378k, False: 2.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   378k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   378k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   378k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   378k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 378k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   378k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   378k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   378k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   378k|        }                                                                                       \
  |  |  |  |  598|  2.56M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  2.56M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  2.56M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  2.56M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  2.56M|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  2.56M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 95, False: 2.56M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  2.56M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  2.56M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  2.56M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 2.56M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  2.56M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 2.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|  2.56M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|  2.56M|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|  2.56M|                       DECODE, ON_FAIL);                                                           \
  |  |  628|  2.56M|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|  2.56M|    do {                                                                                        \
  |  |  |  |  570|  2.56M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  2.56M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  2.56M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 256k, False: 2.30M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|   256k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|   256k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|   256k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|   256k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|   256k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|   256k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   513k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 10, False: 256k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 256k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 256k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|   256k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|   256k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|   256k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|   256k|                ON_FAIL;                                                                        \
  |  |  |  |  583|   256k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  2.30M|        } else {                                                                                \
  |  |  |  |  585|  2.30M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  2.30M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  2.30M|        }                                                                                       \
  |  |  |  |  588|  2.56M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  2.56M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  2.56M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 366k, False: 2.19M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   366k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   366k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   366k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   366k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 366k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   366k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   366k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   366k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   366k|        }                                                                                       \
  |  |  |  |  598|  2.56M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  2.56M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  2.56M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  2.56M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  2.56M|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  2.56M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 100, False: 2.56M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  2.56M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  2.56M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  2.56M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 2.56M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  2.56M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 2.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|  2.56M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|  2.56M|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|  2.56M|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|  2.56M|    do {                                                                                        \
  |  |  |  |  570|  2.56M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  2.56M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  2.56M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 254k, False: 2.30M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|   254k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|   254k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|   254k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|   254k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|   254k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|   254k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   508k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 12, False: 254k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 254k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 254k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|   254k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|   254k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|   254k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|   254k|                ON_FAIL;                                                                        \
  |  |  |  |  583|   254k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  2.30M|        } else {                                                                                \
  |  |  |  |  585|  2.30M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  2.30M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  2.30M|        }                                                                                       \
  |  |  |  |  588|  2.56M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  2.56M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  2.56M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 369k, False: 2.19M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   369k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   369k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   369k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   369k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4, False: 369k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   369k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   369k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   369k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   369k|        }                                                                                       \
  |  |  |  |  598|  2.56M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  2.56M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  2.56M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  2.56M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  2.56M|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  2.56M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 79, False: 2.56M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  2.56M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  2.56M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  2.56M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 2.56M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  2.56M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 2.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|  2.56M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|  2.56M|                       DECODE, ON_FAIL);                                                           \
  |  |  634|  2.56M|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|  2.56M|    do {                                                                                        \
  |  |  |  |  570|  2.56M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  2.56M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  2.56M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 249k, False: 2.31M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|   249k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|   249k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|   249k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|   249k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|   249k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|   249k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   498k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4, False: 249k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 249k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 249k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|   249k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|   249k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|   249k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|   249k|                ON_FAIL;                                                                        \
  |  |  |  |  583|   249k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  2.31M|        } else {                                                                                \
  |  |  |  |  585|  2.31M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  2.31M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  2.31M|        }                                                                                       \
  |  |  |  |  588|  2.56M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  2.56M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  2.56M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 369k, False: 2.19M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   369k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   369k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   369k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   369k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 8, False: 369k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   369k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   369k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   369k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   369k|        }                                                                                       \
  |  |  |  |  598|  2.56M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  2.56M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  2.56M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  2.56M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  2.56M|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  2.56M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  2.56M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 74, False: 2.56M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  2.56M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  2.56M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  2.56M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 2.56M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  2.56M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 2.56M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|  2.56M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|  2.56M|        n_seq -= 4;                                                                                \
  |  |  637|  2.56M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 2.56M]
  |  |  ------------------
  ------------------
 1024|  2.56M|        }
 1025|   209k|    }
 1026|       |
 1027|       |    // --- FAST Loop: After threshold, no offset validation needed (4x unroll) ---
 1028|   209k|    if (safe) {
  ------------------
  |  Branch (1028:9): [True: 0, False: 209k]
  ------------------
 1029|      0|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1029:16): [True: 0, False: 0]
  |  Branch (1029:30): [True: 0, False: 0]
  |  Branch (1029:52): [True: 0, False: 0]
  ------------------
 1030|      0|            const uint8_t* const t_save = t_ptr;
 1031|      0|            const uint8_t* const o_save = o_ptr;
 1032|      0|            const uint8_t* const e_save = e_ptr;
 1033|      0|            uint8_t* const d_save = d_ptr;
 1034|      0|            const uint8_t* const l_save = l_ptr;
 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  ------------------
  |  |  611|      0|    do {                                                                                           \
  |  |  612|      0|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|      0|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|      0|        uint64_t offs;                                                                             \
  |  |  615|      0|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|      0|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|      0|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|      0|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|      0|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|      0|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|      0|        } else {                                                                                   \
  |  |  621|      0|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|      0|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|      0|        }                                                                                          \
  |  |  624|      0|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|      0|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  628|      0|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|      0|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|      0|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  634|      0|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|      0|        n_seq -= 4;                                                                                \
  |  |  637|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1036|      0|            continue;
 1037|       |
 1038|      0|        rollback_fast_4x:
 1039|      0|            t_ptr = t_save;
 1040|      0|            o_ptr = o_save;
 1041|      0|            e_ptr = e_save;
 1042|      0|            d_ptr = d_save;
 1043|      0|            l_ptr = l_save;
 1044|      0|            break;
 1045|      0|        }
 1046|   209k|    } else {
 1047|  1.51M|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1047:16): [True: 1.39M, False: 117k]
  |  Branch (1047:30): [True: 1.39M, False: 18.4E]
  |  Branch (1047:52): [True: 1.30M, False: 91.5k]
  ------------------
 1048|  1.30M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  ------------------
  |  |  611|  1.30M|    do {                                                                                           \
  |  |  612|  1.30M|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|  1.30M|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|  1.30M|        uint64_t offs;                                                                             \
  |  |  615|  1.30M|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|  1.30M|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 47.4k, False: 1.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|  47.4k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|  47.4k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|  47.4k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|  47.4k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|  1.25M|        } else {                                                                                   \
  |  |  621|  1.25M|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|  1.25M|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|  1.25M|        }                                                                                          \
  |  |  624|  1.30M|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|  1.30M|    do {                                                                                        \
  |  |  |  |  570|  1.30M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  1.30M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  1.30M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 93.0k, False: 1.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  93.0k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  93.0k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  93.0k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  93.0k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  93.0k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  93.0k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   186k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 8, False: 93.0k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 3, False: 93.0k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 93.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  93.0k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  93.0k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  93.0k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  93.0k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  93.0k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  1.21M|        } else {                                                                                \
  |  |  |  |  585|  1.21M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  1.21M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  1.21M|        }                                                                                       \
  |  |  |  |  588|  1.30M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  1.30M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  1.30M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 256k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   256k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   256k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   256k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   256k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 256k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   256k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   256k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   256k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   256k|        }                                                                                       \
  |  |  |  |  598|  1.30M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  1.30M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  1.30M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  1.30M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  1.30M|    do {                                 \
  |  |  |  |  |  |  |  |  538|  1.30M|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  1.30M|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  1.30M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 1.30M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  1.30M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 1.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|  1.30M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|  1.30M|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|  1.30M|                       DECODE, ON_FAIL);                                                           \
  |  |  628|  1.30M|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|  1.30M|    do {                                                                                        \
  |  |  |  |  570|  1.30M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  1.30M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  1.30M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 93.5k, False: 1.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  93.5k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  93.5k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  93.5k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  93.5k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  93.5k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  93.5k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   187k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4, False: 93.5k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 5, False: 93.5k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 93.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  93.5k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  93.5k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  93.5k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  93.5k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  93.5k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  1.21M|        } else {                                                                                \
  |  |  |  |  585|  1.21M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  1.21M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  1.21M|        }                                                                                       \
  |  |  |  |  588|  1.30M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  1.30M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  1.30M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 256k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   256k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   256k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   256k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   256k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 2, False: 256k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   256k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   256k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   256k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   256k|        }                                                                                       \
  |  |  |  |  598|  1.30M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  1.30M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  1.30M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  1.30M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  1.30M|    do {                                 \
  |  |  |  |  |  |  |  |  538|  1.30M|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  1.30M|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  1.30M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 1.30M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  1.30M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 1.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|  1.30M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|  1.30M|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|  1.30M|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|  1.30M|    do {                                                                                        \
  |  |  |  |  570|  1.30M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  1.30M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  1.30M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 93.3k, False: 1.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  93.3k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  93.3k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  93.3k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  93.3k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  93.3k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  93.3k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   186k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4, False: 93.3k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 7, False: 93.3k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 1, False: 93.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  93.3k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  93.3k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  93.3k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  93.3k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  93.3k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  1.21M|        } else {                                                                                \
  |  |  |  |  585|  1.21M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  1.21M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  1.21M|        }                                                                                       \
  |  |  |  |  588|  1.30M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  1.30M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  1.30M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 256k, False: 1.04M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   256k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   256k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   256k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   256k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 2, False: 256k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   256k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   256k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   256k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   256k|        }                                                                                       \
  |  |  |  |  598|  1.30M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  1.30M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  1.30M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  1.30M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  1.30M|    do {                                 \
  |  |  |  |  |  |  |  |  538|  1.30M|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  1.30M|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  1.30M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 1.30M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  1.30M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 1.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|  1.30M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|  1.30M|                       DECODE, ON_FAIL);                                                           \
  |  |  634|  1.30M|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|  1.30M|    do {                                                                                        \
  |  |  |  |  570|  1.30M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  1.30M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  1.30M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 94.2k, False: 1.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  94.2k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  94.2k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  94.2k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  94.2k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  94.2k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  94.2k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   188k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 6, False: 94.1k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 5, False: 94.1k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 94.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  94.2k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  94.2k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  94.2k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  94.2k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  94.2k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  1.21M|        } else {                                                                                \
  |  |  |  |  585|  1.21M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  1.21M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  1.21M|        }                                                                                       \
  |  |  |  |  588|  1.30M|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  1.30M|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  1.30M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  1.30M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 256k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|   256k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|   256k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|   256k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   256k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4, False: 256k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|   256k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|   256k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|   256k|                ON_FAIL;                                                                        \
  |  |  |  |  597|   256k|        }                                                                                       \
  |  |  |  |  598|  1.30M|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  1.30M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  1.30M|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  1.30M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  1.30M|    do {                                 \
  |  |  |  |  |  |  |  |  538|  1.30M|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  1.30M|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  1.30M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 1.30M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  1.30M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 1.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|  1.30M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|  1.30M|        n_seq -= 4;                                                                                \
  |  |  637|  1.30M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 1.30M]
  |  |  ------------------
  ------------------
 1049|  1.30M|        }
 1050|   209k|    }
 1051|       |
 1052|       |    // --- Remaining 1 sequence (Fast Path) ---
 1053|  2.47M|    while (n_seq > 0 && d_ptr < d_end_safe && l_ptr < l_end_safe_1x) {
  ------------------
  |  Branch (1053:12): [True: 2.40M, False: 68.8k]
  |  Branch (1053:25): [True: 2.40M, False: 18.4E]
  |  Branch (1053:47): [True: 2.26M, False: 140k]
  ------------------
 1054|       |        // Save pointers before reading (in case we need to fall back to Safe Path)
 1055|  2.26M|        const uint8_t* t_save = t_ptr;
 1056|  2.26M|        const uint8_t* o_save = o_ptr;
 1057|  2.26M|        const uint8_t* e_save = e_ptr;
 1058|       |
 1059|  2.26M|        uint8_t token = *t_ptr++;
 1060|  2.26M|        uint64_t ll = token >> ZXC_TOKEN_LIT_BITS;
  ------------------
  |  |  507|  2.26M|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
 1061|  2.26M|        uint64_t ml = token & ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  513|  2.26M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  2.26M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1062|  2.26M|        uint32_t offset = ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  2.26M|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1063|  2.26M|        if (SPL_OFF8) {
  ------------------
  |  |  553|  2.26M|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 269k, False: 1.99M]
  |  |  ------------------
  ------------------
 1064|   269k|            offset += *o_ptr++;  // 1-byte offset (biased)
 1065|  1.99M|        } else {
 1066|  1.99M|            offset += zxc_le16(o_ptr);  // 2-byte offset (biased)
 1067|  1.99M|            o_ptr += sizeof(uint16_t);
 1068|  1.99M|        }
 1069|       |
 1070|  2.26M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {
  ------------------
  |  |  154|  2.26M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 58.4k, False: 2.20M]
  |  |  ------------------
  ------------------
 1071|  58.4k|            ll += zxc_read_varint(&e_ptr, e_end);
 1072|  58.4k|            if (UNLIKELY(ll > (size_t)(l_end - l_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  58.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 46, False: 58.4k]
  |  |  ------------------
  ------------------
 1073|  58.4k|        }
 1074|  2.26M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) ml += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  154|  2.26M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 629k, False: 1.63M]
  |  |  ------------------
  ------------------
 1075|  2.26M|        ml += ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  2.26M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1076|       |
 1077|       |        // Check bounds before wild copies - if too close to end, fall back to Safe Path
 1078|  2.26M|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr))) {
  ------------------
  |  |  154|  2.26M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4, False: 2.26M]
  |  |  ------------------
  ------------------
 1079|      4|            t_ptr = t_save;
 1080|      4|            o_ptr = o_save;
 1081|      4|            e_ptr = e_save;
 1082|      4|            break;
 1083|      4|        }
 1084|       |
 1085|       |        // Unlike the 4x batch the copy cannot sit in the varint branch's else -
 1086|       |        // the rollback above must run first - so re-test ll instead. Exact:
 1087|       |        // the escape leaves ll >= ZXC_TOKEN_LL_MASK.
 1088|  2.26M|        if (LIKELY(ll < ZXC_TOKEN_LL_MASK)) {
  ------------------
  |  |  148|  2.26M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 2.20M, False: 57.9k]
  |  |  ------------------
  ------------------
 1089|  2.20M|            zxc_copy16(d_ptr, l_ptr);
 1090|  2.20M|        } else {
 1091|  57.9k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1092|  57.9k|        }
 1093|  2.26M|        l_ptr += ll;
 1094|  2.26M|        d_ptr += ll;
 1095|       |
 1096|  2.26M|        if (UNLIKELY(d_ptr < d_bounds && (size_t)(d_ptr - d_floor) < offset))
  ------------------
  |  |  154|  4.24M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 84, False: 2.26M]
  |  |  |  Branch (154:42): [True: 1.98M, False: 275k]
  |  |  |  Branch (154:42): [True: 84, False: 1.98M]
  |  |  ------------------
  ------------------
 1097|     84|            return ZXC_ERROR_BAD_OFFSET;
 1098|       |
 1099|       |        // The loop entry check guarantees ll + ml + ZXC_PAD_SIZE bytes of
 1100|       |        // headroom, so the wild-copy ladder (incl. overlap/fill runs) is safe.
 1101|  2.26M|        zxc_decode_copy_match_spl(d_ptr, offset, ml);
 1102|  2.26M|        d_ptr += ml;
 1103|  2.26M|        n_seq--;
 1104|  2.26M|    }
 1105|       |
 1106|       |    // --- Safe Path for Remaining Sequences ---
 1107|  1.64M|    while (n_seq > 0) {
  ------------------
  |  Branch (1107:12): [True: 1.43M, False: 208k]
  ------------------
 1108|  1.43M|        uint8_t token = *t_ptr++;
 1109|  1.43M|        uint64_t ll = token >> ZXC_TOKEN_LIT_BITS;
  ------------------
  |  |  507|  1.43M|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
 1110|  1.43M|        uint64_t ml = token & ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  513|  1.43M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  1.43M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1111|  1.43M|        uint32_t offset = ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  1.43M|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1112|  1.43M|        if (SPL_OFF8) {
  ------------------
  |  |  553|  1.43M|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 153k, False: 1.28M]
  |  |  ------------------
  ------------------
 1113|   153k|            offset += *o_ptr++;  // 1-byte offset (biased)
 1114|  1.28M|        } else {
 1115|  1.28M|            offset += zxc_le16(o_ptr);  // 2-byte offset (biased)
 1116|  1.28M|            o_ptr += sizeof(uint16_t);
 1117|  1.28M|        }
 1118|       |
 1119|  1.43M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) ll += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  154|  1.43M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 12, False: 1.43M]
  |  |  ------------------
  ------------------
 1120|  1.43M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) ml += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  154|  1.43M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 598k, False: 836k]
  |  |  ------------------
  ------------------
 1121|  1.43M|        ml += ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  1.43M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1122|       |
 1123|  1.43M|        if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  154|  2.87M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 152, False: 1.43M]
  |  |  |  Branch (154:42): [True: 18.4E, False: 1.43M]
  |  |  |  Branch (154:42): [True: 162, False: 1.43M]
  |  |  ------------------
  ------------------
 1124|    152|            return ZXC_ERROR_OVERFLOW;
 1125|  1.43M|        ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  170|  1.43M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1126|  1.43M|        l_ptr += ll;
 1127|  1.43M|        d_ptr += ll;
 1128|       |
 1129|  1.43M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  154|  1.43M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 92, False: 1.43M]
  |  |  ------------------
  ------------------
 1130|  1.43M|        const uint8_t* match_src = d_ptr - offset;
 1131|       |
 1132|  1.43M|        zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1133|  1.43M|        d_ptr += ml;
 1134|  1.43M|        n_seq--;
 1135|  1.43M|    }
 1136|       |
 1137|       |    // --- Trailing Literals ---
 1138|       |    // Copy remaining literals from source stream (literal exhaustion)
 1139|   208k|    if (UNLIKELY(l_ptr > l_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   208k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 208k]
  |  |  ------------------
  ------------------
 1140|   208k|    if (UNLIKELY(d_ptr > d_end)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|   208k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 208k]
  |  |  ------------------
  ------------------
 1141|       |
 1142|   208k|    const size_t remaining_literals = (size_t)(l_end - l_ptr);
 1143|   208k|    if (UNLIKELY(remaining_literals > (size_t)(d_end - d_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|   208k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 208k]
  |  |  ------------------
  ------------------
 1144|   208k|    ZXC_MEMCPY(d_ptr, l_ptr, remaining_literals);
  ------------------
  |  |  170|   208k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1145|   208k|    d_ptr += remaining_literals;
 1146|       |
 1147|   208k|    return (int)(d_ptr - dst);
 1148|   208k|}
zxc_decompress.c:zxc_decode_block_spl_entropy:
 1417|     10|                                                     const size_t dst_capacity) {
 1418|     10|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 0, 0, 1);
 1419|     10|}
zxc_decompress.c:zxc_decode_lit_pivco_dict:
  730|      6|                                                           const size_t required_size) {
  731|      6|    if (UNLIKELY(!ctx->dict_huf_tree_ok)) return ZXC_ERROR_DICT_REQUIRED;
  ------------------
  |  |  154|      6|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  732|      0|    const int arc = zxc_ensure_entropy_scratch(ctx);
  733|      0|    if (UNLIKELY(arc != ZXC_OK)) return arc;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  734|      0|    if (UNLIKELY(ctx->lit_buffer_cap < required_size + ZXC_PAD_SIZE ||
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  735|      0|                 ctx->pivco_scratch_cap < required_size + ZXC_PIVCO_SCRATCH_PAD))
  736|      0|        return ZXC_ERROR_DST_TOO_SMALL;
  737|      0|    return zxc_huf_decode_section_dict(payload, psize, ctx->lit_buffer, required_size,
  ------------------
  |  |   30|      0|#define zxc_huf_decode_section_dict ZXC_CAT(zxc_huf_decode_section_dict, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   23|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|      0|                                       &ctx->dict_huf->tree, ctx->pivco_scratch);
  739|      0|}
zxc_decompress.c:zxc_decode_copy_literals:
  405|  10.8M|                                                       const uint64_t ll) {
  406|  10.8M|    zxc_wild_copy32(dst, src, ll);
  407|  10.8M|}
zxc_decompress.c:zxc_wild_copy32:
  372|  20.2M|static ZXC_ALWAYS_INLINE void zxc_wild_copy32(uint8_t* dst, const uint8_t* src, const size_t len) {
  373|  20.2M|    zxc_copy32(dst, src);
  374|  20.2M|    if (UNLIKELY(len > 32)) {
  ------------------
  |  |  154|  20.2M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.85M, False: 16.4M]
  |  |  ------------------
  ------------------
  375|  3.85M|        size_t rem = len - 32;
  376|  3.85M|        dst += 32;
  377|  3.85M|        src += 32;
  378|  53.3M|        while (rem > 32) {
  ------------------
  |  Branch (378:16): [True: 49.4M, False: 3.85M]
  ------------------
  379|  49.4M|            zxc_copy32(dst, src);
  380|  49.4M|            dst += 32;
  381|  49.4M|            src += 32;
  382|  49.4M|            rem -= 32;
  383|  49.4M|        }
  384|  3.85M|        zxc_copy32(dst, src);
  385|  3.85M|    }
  386|  20.2M|}
zxc_decompress.c:zxc_decode_copy_match_spl:
  479|  17.2M|                                                        const uint64_t ml) {
  480|  17.2M|    if (LIKELY(ml <= ZXC_SPL_MAX_INLINE_ML)) {
  ------------------
  |  |  148|  17.2M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 14.2M, False: 3.01M]
  |  |  ------------------
  ------------------
  481|  14.2M|        zxc_decode_copy_match_short(d_ptr, off, ml);
  482|  14.2M|    } else {
  483|  3.01M|        zxc_decode_copy_match(d_ptr, off, ml);
  484|  3.01M|    }
  485|  17.2M|}
zxc_decompress.c:zxc_decode_copy_match_short:
  460|  14.2M|                                                          const uint32_t off, const uint64_t ml) {
  461|  14.2M|    const uint8_t* match_src = d_ptr - off;
  462|  14.2M|    if (LIKELY(off >= 32)) {
  ------------------
  |  |  148|  14.2M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 12.0M, False: 2.21M]
  |  |  ------------------
  ------------------
  463|  12.0M|        zxc_copy32(d_ptr, match_src);
  464|  12.0M|    } else if (off == 1) {
  ------------------
  |  Branch (464:16): [True: 816k, False: 1.39M]
  ------------------
  465|   816k|        zxc_decode_fill_run(d_ptr, match_src[0], ml);
  466|  1.39M|    } else {
  467|  1.39M|        zxc_decode_copy_overlap_short(d_ptr, off, ml);
  468|  1.39M|    }
  469|  14.2M|}
zxc_decompress.c:zxc_decode_fill_run:
  310|  1.65M|                                                  const uint64_t ml) {
  311|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  312|       |    const __m256i v = _mm256_set1_epi8((char)byte);
  313|       |    _mm256_storeu_si256((__m256i*)dst, v);
  314|       |    if (UNLIKELY(ml > 32)) {
  315|       |        uint8_t* p = dst;
  316|       |        const uint8_t* const last = dst + ml - 32;
  317|       |        do {
  318|       |            p += 32;
  319|       |            _mm256_storeu_si256((__m256i*)p, v);
  320|       |        } while (p < last);
  321|       |    }
  322|       |#elif defined(ZXC_USE_SSE2)
  323|       |    const __m128i v = _mm_set1_epi8((char)byte);
  324|  1.65M|    _mm_storeu_si128((__m128i*)dst, v);
  325|  1.65M|    _mm_storeu_si128((__m128i*)(dst + 16), v);
  326|  1.65M|    if (UNLIKELY(ml > 32)) {
  ------------------
  |  |  154|  1.65M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 524k, False: 1.13M]
  |  |  ------------------
  ------------------
  327|   524k|        uint8_t* p = dst;
  328|   524k|        const uint8_t* const last = dst + ml - 32;
  329|  3.18M|        do {
  330|  3.18M|            p += 32;
  331|  3.18M|            _mm_storeu_si128((__m128i*)p, v);
  332|  3.18M|            _mm_storeu_si128((__m128i*)(p + 16), v);
  333|  3.18M|        } while (p < last);
  ------------------
  |  Branch (333:18): [True: 2.66M, False: 524k]
  ------------------
  334|   524k|    }
  335|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
  336|       |    const uint8x16_t v = vdupq_n_u8(byte);
  337|       |    vst1q_u8(dst, v);
  338|       |    vst1q_u8(dst + 16, v);
  339|       |    if (UNLIKELY(ml > 32)) {
  340|       |        uint8_t* p = dst;
  341|       |        const uint8_t* const last = dst + ml - 32;
  342|       |        do {
  343|       |            p += 32;
  344|       |            vst1q_u8(p, v);
  345|       |            vst1q_u8(p + 16, v);
  346|       |        } while (p < last);
  347|       |    }
  348|       |#else
  349|       |    ZXC_MEMSET(dst, byte, ml);
  350|       |#endif
  351|  1.65M|}
zxc_decompress.c:zxc_decode_copy_overlap_short:
  239|  1.52M|                                                            const uint64_t ml) {
  240|       |#if defined(ZXC_USE_NEON64)
  241|       |    const uint8x16_t s0 = vld1q_u8(dst - off);
  242|       |    vst1q_u8(dst, vqtbl1q_u8(s0, vld1q_u8(zxc_overlap_masks32[off])));
  243|       |    if (UNLIKELY(ml > 16)) {
  244|       |        uint8x16x2_t tbl;
  245|       |        tbl.val[0] = s0;
  246|       |        tbl.val[1] = vld1q_u8(dst - off + 16);
  247|       |        vst1q_u8(dst + 16, vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off] + 16)));
  248|       |    }
  249|       |
  250|       |#elif defined(ZXC_USE_NEON32)
  251|       |    uint8x8x2_t lo_tbl;
  252|       |    lo_tbl.val[0] = vld1_u8(dst - off);
  253|       |    lo_tbl.val[1] = vld1_u8(dst - off + 8);
  254|       |    const uint8_t* const m = zxc_overlap_masks32[off];
  255|       |    vst1_u8(dst, vtbl2_u8(lo_tbl, vld1_u8(m)));
  256|       |    vst1_u8(dst + 8, vtbl2_u8(lo_tbl, vld1_u8(m + 8)));
  257|       |    if (UNLIKELY(ml > 16)) {
  258|       |        uint8x8x4_t tbl;
  259|       |        tbl.val[0] = lo_tbl.val[0];
  260|       |        tbl.val[1] = lo_tbl.val[1];
  261|       |        tbl.val[2] = vld1_u8(dst - off + 16);
  262|       |        tbl.val[3] = vld1_u8(dst - off + 24);
  263|       |        vst1_u8(dst + 16, vtbl4_u8(tbl, vld1_u8(m + 16)));
  264|       |        vst1_u8(dst + 24, vtbl4_u8(tbl, vld1_u8(m + 24)));
  265|       |    }
  266|       |
  267|       |#elif defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  268|       |    // pshufb reaches 16 bytes, so only the upper half needs two tables: shuffle
  269|       |    // both and pick per byte on bit 4 of the index.
  270|       |    const __m128i t0 = _mm_loadu_si128((const __m128i*)(dst - off));
  271|       |    _mm_storeu_si128(
  272|       |        (__m128i*)dst,
  273|       |        _mm_shuffle_epi8(t0, _mm_load_si128((const __m128i*)zxc_overlap_masks32[off])));
  274|       |    if (UNLIKELY(ml > 16)) {
  275|       |        const __m128i t1 = _mm_loadu_si128((const __m128i*)(dst - off + 16));
  276|       |        const __m128i m_hi = _mm_load_si128((const __m128i*)(zxc_overlap_masks32[off] + 16));
  277|       |        _mm_storeu_si128(
  278|       |            (__m128i*)(dst + 16),
  279|       |            _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_hi),
  280|       |                            _mm_shuffle_epi8(t1, _mm_sub_epi8(m_hi, _mm_set1_epi8(16))),
  281|       |                            _mm_slli_epi16(m_hi, 3)));
  282|       |    }
  283|       |
  284|       |#else
  285|  1.52M|    const uint8_t* src = dst - off;
  286|  1.52M|    const size_t n = (ml > 16) ? 32 : 16;
  ------------------
  |  Branch (286:22): [True: 107k, False: 1.42M]
  ------------------
  287|  1.52M|    uint32_t k = 0;
  288|  27.6M|    for (size_t i = 0; i < n; i++) {
  ------------------
  |  Branch (288:24): [True: 26.1M, False: 1.52M]
  ------------------
  289|  26.1M|        dst[i] = src[k];
  290|  26.1M|        if (++k == off) k = 0;
  ------------------
  |  Branch (290:13): [True: 1.88M, False: 24.2M]
  ------------------
  291|  26.1M|    }
  292|  1.52M|#endif
  293|  1.52M|}
zxc_decompress.c:zxc_decode_copy_match:
  433|  12.4M|                                                    const uint64_t ml) {
  434|  12.4M|    const uint8_t* match_src = d_ptr - off;
  435|  12.4M|    if (LIKELY(off >= 32)) {
  ------------------
  |  |  148|  12.4M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 9.77M, False: 2.69M]
  |  |  ------------------
  ------------------
  436|  9.77M|        zxc_wild_copy32(d_ptr, match_src, ml);
  437|  9.77M|    } else if (off == 1) {
  ------------------
  |  Branch (437:16): [True: 845k, False: 1.84M]
  ------------------
  438|   845k|        zxc_decode_fill_run(d_ptr, match_src[0], ml);
  439|  1.84M|    } else {
  440|  1.84M|        zxc_decode_copy_overlap_run32(d_ptr, off, ml);
  441|  1.84M|    }
  442|  12.4M|}
zxc_decompress.c:zxc_decode_copy_overlap_run32:
  144|  1.91M|                                                            const uint64_t ml) {
  145|  1.91M|    const size_t stride = zxc_overlap_strides32[off];
  146|  1.91M|    size_t copied = 0;
  147|       |#if defined(ZXC_USE_NEON64)
  148|       |    uint8x16x2_t tbl;
  149|       |    tbl.val[0] = vld1q_u8(dst - off);
  150|       |    tbl.val[1] = vld1q_u8(dst - off + 16);
  151|       |    const uint8x16_t pat_lo = vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off]));
  152|       |    const uint8x16_t pat_hi = vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off] + 16));
  153|       |    do {
  154|       |        vst1q_u8(dst + copied, pat_lo);
  155|       |        vst1q_u8(dst + copied + 16, pat_hi);
  156|       |        copied += stride;
  157|       |    } while (copied < ml);
  158|       |
  159|       |#elif defined(ZXC_USE_NEON32)
  160|       |    // VTBL reaches 8 bytes per lookup from a 4-register (32-byte) table, so the
  161|       |    // pattern takes four lookups instead of NEON64's two.
  162|       |    uint8x8x4_t tbl;
  163|       |    tbl.val[0] = vld1_u8(dst - off);
  164|       |    tbl.val[1] = vld1_u8(dst - off + 8);
  165|       |    tbl.val[2] = vld1_u8(dst - off + 16);
  166|       |    tbl.val[3] = vld1_u8(dst - off + 24);
  167|       |    const uint8_t* const m = zxc_overlap_masks32[off];
  168|       |    const uint8x8_t p0 = vtbl4_u8(tbl, vld1_u8(m));
  169|       |    const uint8x8_t p1 = vtbl4_u8(tbl, vld1_u8(m + 8));
  170|       |    const uint8x8_t p2 = vtbl4_u8(tbl, vld1_u8(m + 16));
  171|       |    const uint8x8_t p3 = vtbl4_u8(tbl, vld1_u8(m + 24));
  172|       |    do {
  173|       |        vst1_u8(dst + copied, p0);
  174|       |        vst1_u8(dst + copied + 8, p1);
  175|       |        vst1_u8(dst + copied + 16, p2);
  176|       |        vst1_u8(dst + copied + 24, p3);
  177|       |        copied += stride;
  178|       |    } while (copied < ml);
  179|       |
  180|       |#elif defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  181|       |    // pshufb only reaches 16 bytes per lane, so the 32-byte table is emulated:
  182|       |    // shuffle both halves, then pick per byte on bit 4 of the index.
  183|       |    const __m128i t0 = _mm_loadu_si128((const __m128i*)(dst - off));
  184|       |    const __m128i t1 = _mm_loadu_si128((const __m128i*)(dst - off + 16));
  185|       |    const __m128i sixteen = _mm_set1_epi8(16);
  186|       |    const __m128i m_lo = _mm_load_si128((const __m128i*)zxc_overlap_masks32[off]);
  187|       |    const __m128i m_hi = _mm_load_si128((const __m128i*)(zxc_overlap_masks32[off] + 16));
  188|       |    const __m128i pat_lo =
  189|       |        _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_lo),
  190|       |                        _mm_shuffle_epi8(t1, _mm_sub_epi8(m_lo, sixteen)), _mm_slli_epi16(m_lo, 3));
  191|       |    const __m128i pat_hi =
  192|       |        _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_hi),
  193|       |                        _mm_shuffle_epi8(t1, _mm_sub_epi8(m_hi, sixteen)), _mm_slli_epi16(m_hi, 3));
  194|       |    do {
  195|       |        _mm_storeu_si128((__m128i*)(dst + copied), pat_lo);
  196|       |        _mm_storeu_si128((__m128i*)(dst + copied + 16), pat_hi);
  197|       |        copied += stride;
  198|       |    } while (copied < ml);
  199|       |
  200|       |#else
  201|       |    // SSE2 (no PSHUFB) and non-SIMD tiers: build the 32-byte pattern with a
  202|       |    // wrap counter (no per-byte modulo), then store it as two 16-byte halves.
  203|  1.91M|    const uint8_t* src = dst - off;
  204|  1.91M|    uint8_t pat[32];
  205|  1.91M|    uint32_t k = 0;
  206|  62.9M|    for (size_t i = 0; i < 32; i++) {
  ------------------
  |  Branch (206:24): [True: 61.0M, False: 1.91M]
  ------------------
  207|  61.0M|        pat[i] = src[k];
  208|  61.0M|        if (++k == off) k = 0;
  ------------------
  |  Branch (208:13): [True: 4.82M, False: 56.2M]
  ------------------
  209|  61.0M|    }
  210|  5.08M|    do {
  211|  5.08M|        zxc_copy16(dst + copied, pat);
  212|  5.08M|        zxc_copy16(dst + copied + 16, pat + 16);
  213|  5.08M|        copied += stride;
  214|  5.08M|    } while (copied < ml);
  ------------------
  |  Branch (214:14): [True: 3.16M, False: 1.91M]
  ------------------
  215|  1.91M|#endif
  216|  1.91M|}
zxc_decompress.c:zxc_decode_copy_match_exact:
  504|  2.84M|                                                     const size_t off, const size_t ml) {
  505|  2.84M|    if (off >= ml) {
  ------------------
  |  Branch (505:9): [True: 2.34M, False: 507k]
  ------------------
  506|  2.34M|        ZXC_MEMCPY(d_ptr, match_src, ml);
  ------------------
  |  |  170|  2.34M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  507|  2.34M|    } else if (ml < 16) {
  ------------------
  |  Branch (507:16): [True: 47.7k, False: 459k]
  ------------------
  508|   527k|        for (size_t i = 0; i < ml; i++) d_ptr[i] = match_src[i];
  ------------------
  |  Branch (508:28): [True: 479k, False: 47.7k]
  ------------------
  509|   459k|    } else {
  510|   459k|        size_t n = off;
  511|   459k|        ZXC_MEMCPY(d_ptr, match_src, n);
  ------------------
  |  |  170|   459k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  512|  2.43M|        while (n <= ml - n) {
  ------------------
  |  Branch (512:16): [True: 1.97M, False: 459k]
  ------------------
  513|  1.97M|            ZXC_MEMCPY(d_ptr + n, d_ptr, n);
  ------------------
  |  |  170|  1.97M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  514|  1.97M|            n <<= 1;
  515|  1.97M|        }
  516|   459k|        ZXC_MEMCPY(d_ptr + n, d_ptr, ml - n);
  ------------------
  |  |  170|   459k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  517|   459k|    }
  518|  2.84M|}
zxc_decompress.c:zxc_decode_block_spl:
 1452|   211k|                                const size_t dst_capacity) {
 1453|   211k|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 0, 0, 0);
 1454|   211k|}
zxc_decompress.c:zxc_decode_block_pak_impl:
 1174|   146k|                                                       const int has_dict) {
 1175|   146k|    zxc_gnr_header_t gh;
 1176|       |
 1177|       |    // 0 when !has_dict (safe path) -> folds `d_floor` to `dst`.
 1178|   146k|    const size_t dict_size = has_dict ? ctx->dict_size : 0;
  ------------------
  |  Branch (1178:30): [True: 0, False: 146k]
  ------------------
 1179|       |
 1180|   146k|    if (UNLIKELY(zxc_read_pak_header(src, src_size, &gh) != ZXC_OK)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|   146k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 146k]
  |  |  ------------------
  ------------------
 1181|   146k|    if (UNLIKELY(gh.enc_lit != ZXC_SECTION_ENCODING_RAW || gh.enc_tok != 0))
  ------------------
  |  |  154|   291k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 22, False: 146k]
  |  |  |  Branch (154:42): [True: 299, False: 145k]
  |  |  |  Branch (154:42): [True: 18.4E, False: 145k]
  |  |  ------------------
  ------------------
 1182|     22|        return ZXC_ERROR_CORRUPT_DATA;
 1183|       |
 1184|   146k|    const uint8_t* const p_data = src + ZXC_PAK_HEADER_BINARY_SIZE;
  ------------------
  |  |  434|   146k|#define ZXC_PAK_HEADER_BINARY_SIZE 12
  ------------------
 1185|   146k|    const uint8_t* p_curr = p_data;
 1186|       |
 1187|       |    // --- Stream Pointers & Validation ---
 1188|       |    // PAK carries no section descriptors: literals are always RAW, the sequence
 1189|       |    // stream is four bytes per sequence, and extras run to the payload end.
 1190|   146k|    const size_t sz_lit = gh.n_literals;
 1191|   146k|    const uint64_t sz_seqs = (uint64_t)gh.n_sequences * sizeof(uint32_t);
 1192|       |
 1193|   146k|    const size_t payload_avail = (size_t)(src + src_size - p_data);
 1194|   146k|    const uint64_t consumed = (uint64_t)sz_lit + sz_seqs;
 1195|   146k|    if (UNLIKELY(consumed > (uint64_t)payload_avail)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   146k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 141, False: 145k]
  |  |  ------------------
  ------------------
 1196|   145k|    const size_t sz_exts = payload_avail - (size_t)consumed; /* slack padding included */
 1197|       |
 1198|       |    // PAK literals are always RAW, so the slack is always load-bearing here.
 1199|       |    // No underflow: sz_lit <= consumed <= payload_avail.
 1200|   145k|    if (UNLIKELY(payload_avail - sz_lit < ZXC_BLOCK_LIT_SLACK)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   145k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4, False: 145k]
  |  |  ------------------
  ------------------
 1201|       |
 1202|   145k|    const uint8_t* l_ptr = p_curr;
 1203|   145k|    const uint8_t* l_end = l_ptr + sz_lit;
 1204|   145k|    p_curr += sz_lit;
 1205|       |
 1206|   145k|    const uint8_t* seq_ptr = p_curr;
 1207|   145k|    const uint8_t* extras_ptr = p_curr + (size_t)sz_seqs;
 1208|   145k|    const uint8_t* const extras_end = extras_ptr + sz_exts;
 1209|       |
 1210|   145k|    uint8_t* d_ptr = dst;
 1211|   145k|    const uint8_t* const d_end = dst + dst_capacity;
 1212|       |    // Lowest address a match may reach: the dictionary prefix if any, else dst.
 1213|   145k|    const uint8_t* const d_floor = dst - dict_size;
 1214|   145k|    const uint8_t* const d_end_safe =
 1215|   145k|        (dst_capacity > ZXC_PAD_SIZE * 4) ? d_end - (ZXC_PAD_SIZE * 4) : dst;  // 128
  ------------------
  |  |  331|   145k|#define ZXC_PAD_SIZE 32
  ------------------
                      (dst_capacity > ZXC_PAD_SIZE * 4) ? d_end - (ZXC_PAD_SIZE * 4) : dst;  // 128
  ------------------
  |  |  331|   145k|#define ZXC_PAD_SIZE 32
  ------------------
  |  Branch (1215:9): [True: 145k, False: 273]
  ------------------
 1216|       |    // 4x loop margin: four sequences of inline output (ll <= 254, ml <= 254 + 5,
 1217|       |    // longer ones escape and check themselves) plus the wild-copy overshoot:
 1218|       |    // 4 x 513 + 32 = 2084, all of ZXC_DECOMPRESS_TAIL_PAD.
 1219|   145k|    const uint8_t* const d_end_fast =
 1220|   145k|        (dst_capacity > ZXC_DECOMPRESS_TAIL_PAD) ? d_end - ZXC_DECOMPRESS_TAIL_PAD : dst;
  ------------------
  |  |  361|   145k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|   145k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|   145k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|   145k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   145k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   145k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   145k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|   145k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
                      (dst_capacity > ZXC_DECOMPRESS_TAIL_PAD) ? d_end - ZXC_DECOMPRESS_TAIL_PAD : dst;
  ------------------
  |  |  361|   145k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|   145k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|   145k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|   145k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   145k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   145k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   145k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|   145k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (1220:9): [True: 145k, False: 260]
  ------------------
 1221|       |
 1222|       |    // Literal margin for the PAK loops: without a varint, ll <= 254 per sequence,
 1223|       |    // so 4 * 254 = 1016. Past that only the cold varint path checks l_ptr.
 1224|   145k|    const size_t pak_margin_4x = 4 * (ZXC_SEQ_LL_MASK - 1);  // 1016
  ------------------
  |  |  528|   145k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|   145k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
 1225|   145k|    const size_t pak_margin_1x = ZXC_SEQ_LL_MASK - 1;        // 254
  ------------------
  |  |  528|   145k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|   145k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
 1226|   145k|    const uint8_t* const l_end_safe_4x = (sz_lit > pak_margin_4x) ? l_end - pak_margin_4x : l_ptr;
  ------------------
  |  Branch (1226:42): [True: 62.2k, False: 83.6k]
  ------------------
 1227|   145k|    const uint8_t* const l_end_safe_1x = (sz_lit > pak_margin_1x) ? l_end - pak_margin_1x : l_ptr;
  ------------------
  |  Branch (1227:42): [True: 72.3k, False: 73.5k]
  ------------------
 1228|       |
 1229|   145k|    uint32_t n_seq = gh.n_sequences;
 1230|       |
 1231|       |    // Same handover as SPL, but the PAK offset is inline in the sequence word and
 1232|       |    // always 16 bits -- enc_off is not a width here, so the span is fixed.
 1233|   145k|    const size_t off_span = 1U << 16;
 1234|   145k|    const size_t span = (dict_size >= off_span) ? 0 : off_span - dict_size;
  ------------------
  |  Branch (1234:25): [True: 0, False: 145k]
  ------------------
 1235|   145k|    const uint8_t* const d_bounds = (span >= dst_capacity) ? d_end : dst + span;
  ------------------
  |  Branch (1235:37): [True: 138k, False: 7.90k]
  ------------------
 1236|       |
 1237|       |    // --- SAFE loop: validate offsets until d_bounds (4x unroll) ---
 1238|   145k|    if (safe) {
  ------------------
  |  Branch (1238:9): [True: 0, False: 145k]
  ------------------
 1239|       |        // SAFE variant: save per-batch state so an OVERFLOW can rollback and
 1240|       |        // hand over to the 1x loop / Safe Path. Wild writes already committed
 1241|       |        // are deterministically overwritten when the 1x loop replays.
 1242|      0|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1242:16): [True: 0, False: 0]
  |  Branch (1242:30): [True: 0, False: 0]
  |  Branch (1242:52): [True: 0, False: 0]
  |  Branch (1242:77): [True: 0, False: 0]
  ------------------
 1243|      0|            const uint8_t* const t_save = seq_ptr;
 1244|      0|            const uint8_t* const e_save = extras_ptr;
 1245|      0|            uint8_t* const d_save = d_ptr;
 1246|      0|            const uint8_t* const l_save = l_ptr;
 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  ------------------
  |  |  678|      0|    do {                                                                                        \
  |  |  679|      0|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|      0|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|      0|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|      0|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|      0|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|      0|        PREFETCH;                                                                               \
  |  |  685|      0|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|      0|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|      0|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|      0|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|      0|                       ON_FAIL);                                                                \
  |  |  690|      0|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|      0|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|      0|        n_seq -= 4;                                                                             \
  |  |  693|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1248|      0|            continue;
 1249|       |
 1250|      0|        rollback_safe_4x:
 1251|      0|            seq_ptr = t_save;
 1252|      0|            extras_ptr = e_save;
 1253|      0|            d_ptr = d_save;
 1254|      0|            l_ptr = l_save;
 1255|      0|            break;
 1256|      0|        }
 1257|   145k|    } else {
 1258|   968k|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1258:16): [True: 909k, False: 59.1k]
  |  Branch (1258:30): [True: 909k, False: 18.4E]
  |  Branch (1258:52): [True: 825k, False: 83.8k]
  |  Branch (1258:77): [True: 823k, False: 2.90k]
  ------------------
 1259|   823k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  ------------------
  |  |  678|   823k|    do {                                                                                        \
  |  |  679|   823k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|   823k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|   823k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|   823k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|   823k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|   823k|        PREFETCH;                                                                               \
  |  |  685|   823k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|   823k|    do {                                                                                     \
  |  |  |  |  646|   823k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   823k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   823k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   823k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   823k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   823k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   823k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   823k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   823k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   823k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   823k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   823k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   823k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 31.6k, False: 791k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  31.6k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  31.6k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  31.6k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  31.6k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  63.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 31.6k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 31.6k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 1, False: 31.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  31.6k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  31.6k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  31.6k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  31.6k|        }                                                                                    \
  |  |  |  |  658|   823k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   823k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 26.5k, False: 796k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  26.5k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  26.5k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  26.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 26.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  26.5k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  26.5k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  26.5k|        }                                                                                    \
  |  |  |  |  664|   823k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   823k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   823k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   823k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   823k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   823k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   823k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   823k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   823k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   823k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   823k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   823k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   823k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 30, False: 823k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   823k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   823k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   823k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 823k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   823k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 823k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|   823k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|   823k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|   823k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|   823k|    do {                                                                                     \
  |  |  |  |  646|   823k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   823k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   823k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   823k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   823k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   823k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   823k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   823k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   823k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   823k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   823k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   823k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   823k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 18.5k, False: 804k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  18.5k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  18.5k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  18.5k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  18.5k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  37.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 18.5k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 2, False: 18.5k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 18.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  18.5k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  18.5k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  18.5k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  18.5k|        }                                                                                    \
  |  |  |  |  658|   823k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   823k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 23.5k, False: 799k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  23.5k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  23.5k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  23.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 23.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  23.5k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  23.5k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  23.5k|        }                                                                                    \
  |  |  |  |  664|   823k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   823k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   823k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   823k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   823k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   823k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   823k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   823k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   823k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   823k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   823k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   823k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   823k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 22, False: 822k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   823k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   822k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   822k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 822k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   823k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 822k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|   823k|                       ON_FAIL);                                                                \
  |  |  690|   823k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|   822k|    do {                                                                                     \
  |  |  |  |  646|   822k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   822k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   822k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   822k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   822k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   822k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   822k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   822k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   822k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   822k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   822k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   822k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   822k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 17.0k, False: 805k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  17.0k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  17.0k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  17.0k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  17.0k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  34.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 2, False: 17.0k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 3, False: 17.0k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 17.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  17.0k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  17.0k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  17.0k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  17.0k|        }                                                                                    \
  |  |  |  |  658|   822k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   822k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 24.8k, False: 798k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  24.8k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  24.8k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  24.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 24.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  24.8k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  24.8k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  24.8k|        }                                                                                    \
  |  |  |  |  664|   822k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   822k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   822k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   822k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   822k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   822k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   822k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   822k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   822k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   822k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   822k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   822k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   822k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 8, False: 822k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   822k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   822k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   822k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 822k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   822k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 822k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|   822k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|   822k|    do {                                                                                     \
  |  |  |  |  646|   822k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   822k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   822k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   822k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   822k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   822k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   822k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   822k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   822k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   822k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   822k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   822k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   822k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 18.0k, False: 804k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  18.0k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  18.0k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  18.0k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  18.0k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  36.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 2, False: 18.0k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 1, False: 18.0k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 18.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  18.0k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  18.0k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  18.0k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  18.0k|        }                                                                                    \
  |  |  |  |  658|   822k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   822k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 24.7k, False: 798k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  24.7k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  24.7k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  24.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 24.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  24.7k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  24.7k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  24.7k|        }                                                                                    \
  |  |  |  |  664|   822k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   822k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   822k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   822k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   822k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   822k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   822k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   822k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   822k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   822k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   822k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   822k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   822k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 18, False: 822k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   822k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   822k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   822k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 822k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   822k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 822k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|   822k|        n_seq -= 4;                                                                             \
  |  |  693|   822k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 822k]
  |  |  ------------------
  ------------------
 1260|   823k|        }
 1261|   145k|    }
 1262|       |
 1263|       |    // --- SAFE Loop tail: remaining sequences with offset validation (1x) ---
 1264|  3.52M|    while (n_seq > 0 && d_ptr < d_end_safe && d_ptr < d_bounds) {
  ------------------
  |  Branch (1264:12): [True: 3.38M, False: 143k]
  |  Branch (1264:25): [True: 3.38M, False: 18.4E]
  |  Branch (1264:47): [True: 3.38M, False: 3.26k]
  ------------------
 1265|  3.38M|        uint32_t seq = zxc_le32(seq_ptr);
 1266|  3.38M|        seq_ptr += sizeof(uint32_t);
 1267|       |
 1268|  3.38M|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  534|  3.38M|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|  3.38M|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|  3.38M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1269|  3.38M|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) ll += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|  3.38M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 29.2k, False: 3.35M]
  |  |  ------------------
  ------------------
 1270|       |
 1271|  3.38M|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  536|  3.38M|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|  3.38M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  530|  3.38M|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|  3.38M|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1272|  3.38M|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  3.38M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1273|  3.38M|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|  3.38M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 292k, False: 3.09M]
  |  |  ------------------
  ------------------
 1274|       |
 1275|  3.38M|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  532|  3.38M|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|  3.38M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  3.38M|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1276|       |
 1277|       |        // Strict bounds check: sequence must fit, AND wild copies must not overshoot
 1278|       |        // Check both destination (d_ptr) and source literal stream (l_ptr)
 1279|  3.38M|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr) ||
  ------------------
  |  |  154|  6.76M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.34M, False: 2.04M]
  |  |  |  Branch (154:42): [True: 18.4E, False: 3.38M]
  |  |  |  Branch (154:42): [True: 1.30M, False: 2.08M]
  |  |  ------------------
  ------------------
 1280|  3.38M|                     ll + ZXC_PAD_SIZE > (size_t)(l_end - l_ptr))) {
 1281|       |            // Fallback to exact copy (slow but safe)
 1282|  1.34M|            if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  154|  2.68M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 108, False: 1.34M]
  |  |  |  Branch (154:42): [True: 18.4E, False: 1.34M]
  |  |  |  Branch (154:42): [True: 114, False: 1.34M]
  |  |  ------------------
  ------------------
 1283|    108|                return ZXC_ERROR_OVERFLOW;
 1284|  1.34M|            ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  170|  1.34M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1285|  1.34M|            l_ptr += ll;
 1286|  1.34M|            d_ptr += ll;
 1287|       |
 1288|  1.34M|            if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  154|  1.34M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 60, False: 1.34M]
  |  |  ------------------
  ------------------
 1289|  1.34M|            const uint8_t* match_src = d_ptr - offset;
 1290|       |
 1291|  1.34M|            zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1292|  1.34M|            d_ptr += ml;
 1293|  2.04M|        } else {
 1294|  2.04M|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1295|  2.04M|            l_ptr += ll;
 1296|  2.04M|            d_ptr += ll;
 1297|  2.04M|            DECODE_MATCH_SAFE(ml, offset, zxc_decode_copy_match);
  ------------------
  |  |  528|  2.04M|    do {                                                                              \
  |  |  529|  2.04M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  ------------------
  |  |  |  |  154|  2.04M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (154:21): [True: 43, False: 2.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  530|  2.04M|        COPY(d_ptr, off, ml);                                                         \
  |  |  531|  2.04M|        d_ptr += ml;                                                                  \
  |  |  532|  2.04M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (532:14): [Folded, False: 2.04M]
  |  |  ------------------
  ------------------
 1298|  2.04M|        }
 1299|  3.38M|        n_seq--;
 1300|  3.38M|    }
 1301|       |
 1302|       |    // --- FAST Loop: After threshold, check large margin to avoid individual bounds checks ---
 1303|   145k|    if (safe) {
  ------------------
  |  Branch (1303:9): [True: 0, False: 145k]
  ------------------
 1304|      0|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1304:16): [True: 0, False: 0]
  |  Branch (1304:30): [True: 0, False: 0]
  |  Branch (1304:52): [True: 0, False: 0]
  ------------------
 1305|      0|            const uint8_t* const t_save = seq_ptr;
 1306|      0|            const uint8_t* const e_save = extras_ptr;
 1307|      0|            uint8_t* const d_save = d_ptr;
 1308|      0|            const uint8_t* const l_save = l_ptr;
 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  ------------------
  |  |  678|      0|    do {                                                                                        \
  |  |  679|      0|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|      0|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|      0|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|      0|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|      0|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|      0|        PREFETCH;                                                                               \
  |  |  685|      0|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|      0|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|      0|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|      0|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|      0|                       ON_FAIL);                                                                \
  |  |  690|      0|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|      0|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|      0|        n_seq -= 4;                                                                             \
  |  |  693|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1310|      0|                                ZXC_PREFETCH_READ(l_ptr + ZXC_CACHE_LINE_SIZE));
 1311|      0|            continue;
 1312|       |
 1313|      0|        rollback_fast_4x:
 1314|      0|            seq_ptr = t_save;
 1315|      0|            extras_ptr = e_save;
 1316|      0|            d_ptr = d_save;
 1317|      0|            l_ptr = l_save;
 1318|      0|            break;
 1319|      0|        }
 1320|   145k|    } else {
 1321|  1.14M|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1321:16): [True: 1.00M, False: 143k]
  |  Branch (1321:30): [True: 1.00M, False: 18.4E]
  |  Branch (1321:52): [True: 998k, False: 2.18k]
  ------------------
 1322|   998k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  ------------------
  |  |  678|   998k|    do {                                                                                        \
  |  |  679|   998k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|   998k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|   998k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|   998k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|   998k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|   998k|        PREFETCH;                                                                               \
  |  |  685|   998k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|   998k|    do {                                                                                     \
  |  |  |  |  646|   998k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   998k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   998k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   998k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   998k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   998k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   998k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   998k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 12.3k, False: 985k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  12.3k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  12.3k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  12.3k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  12.3k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  24.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 2, False: 12.3k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 2, False: 12.3k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 12.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  12.3k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  12.3k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  12.3k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  12.3k|        }                                                                                    \
  |  |  |  |  658|   998k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 31.0k, False: 967k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  31.0k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  31.0k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  31.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 31.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  31.0k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  31.0k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  31.0k|        }                                                                                    \
  |  |  |  |  664|   998k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   998k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   998k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   998k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   998k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   998k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   998k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   998k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   998k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   998k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   998k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   998k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   998k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 998k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   998k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 998k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|   998k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|   998k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|   998k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|   998k|    do {                                                                                     \
  |  |  |  |  646|   998k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   998k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   998k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   998k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   998k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   998k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   998k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   998k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 12.6k, False: 985k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  12.6k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  12.6k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  12.6k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  12.6k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  25.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 12.6k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18.4E, False: 12.6k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 12.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  12.6k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  12.6k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  12.6k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  12.6k|        }                                                                                    \
  |  |  |  |  658|   998k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 31.4k, False: 966k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  31.4k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  31.4k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  31.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 31.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  31.4k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  31.4k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  31.4k|        }                                                                                    \
  |  |  |  |  664|   998k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   998k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   998k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   998k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   998k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   998k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   998k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   998k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   998k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   998k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   998k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   998k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   998k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 998k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   998k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 998k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|   998k|                       ON_FAIL);                                                                \
  |  |  690|   998k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|   998k|    do {                                                                                     \
  |  |  |  |  646|   998k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   998k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   998k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   998k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   998k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   998k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   998k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   998k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 12.5k, False: 985k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  12.5k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  12.5k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  12.5k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  12.5k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  25.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4, False: 12.5k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 4, False: 12.5k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 12.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  12.5k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  12.5k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  12.5k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  12.5k|        }                                                                                    \
  |  |  |  |  658|   998k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 30.7k, False: 967k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  30.7k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  30.7k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  30.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 30.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  30.7k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  30.7k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  30.7k|        }                                                                                    \
  |  |  |  |  664|   998k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   998k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   998k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   998k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   998k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   998k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   998k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   998k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   998k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   998k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   998k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   998k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   998k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 998k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   998k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 998k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|   998k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|   998k|    do {                                                                                     \
  |  |  |  |  646|   998k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   998k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   998k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   998k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   998k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   998k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   998k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   998k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   998k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 12.7k, False: 985k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  12.7k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  12.7k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  12.7k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  12.7k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  25.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 12.7k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 1, False: 12.7k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 12.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  12.7k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  12.7k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  12.7k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  12.7k|        }                                                                                    \
  |  |  |  |  658|   998k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   998k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 31.6k, False: 966k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  31.6k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  31.6k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  31.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 31.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  31.6k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  31.6k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  31.6k|        }                                                                                    \
  |  |  |  |  664|   998k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   998k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   998k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   998k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   998k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   998k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   998k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   998k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   998k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   998k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   998k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   998k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   998k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   998k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 998k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   998k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 998k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|   998k|        n_seq -= 4;                                                                             \
  |  |  693|   998k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 998k]
  |  |  ------------------
  ------------------
 1323|   998k|                                ZXC_PREFETCH_READ(l_ptr + ZXC_CACHE_LINE_SIZE));
 1324|   998k|        }
 1325|   145k|    }
 1326|       |
 1327|       |    // --- Remaining 1 sequence (Fast Path) ---
 1328|   244k|    while (n_seq > 0 && d_ptr < d_end_safe && l_ptr < l_end_safe_1x) {
  ------------------
  |  Branch (1328:12): [True: 101k, False: 142k]
  |  Branch (1328:25): [True: 101k, False: 0]
  |  Branch (1328:47): [True: 99.4k, False: 2.22k]
  ------------------
 1329|       |        // Save state for fallback
 1330|  99.4k|        const uint8_t* seq_save = seq_ptr;
 1331|  99.4k|        const uint8_t* ext_save = extras_ptr;
 1332|       |
 1333|  99.4k|        const uint32_t seq = zxc_le32(seq_ptr);
 1334|  99.4k|        seq_ptr += sizeof(uint32_t);
 1335|       |
 1336|  99.4k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  534|  99.4k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|  99.4k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|  99.4k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1337|  99.4k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {
  ------------------
  |  |  154|  99.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.44k, False: 98.0k]
  |  |  ------------------
  ------------------
 1338|  1.44k|            ll += zxc_read_varint(&extras_ptr, extras_end);
 1339|  1.44k|            if (UNLIKELY(ll > (size_t)(l_end - l_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  1.44k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10, False: 1.43k]
  |  |  ------------------
  ------------------
 1340|  1.44k|        }
 1341|       |
 1342|  99.4k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  536|  99.4k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|  99.4k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  530|  99.4k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|  99.4k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1343|  99.4k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  99.4k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1344|  99.4k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|  99.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4.30k, False: 95.1k]
  |  |  ------------------
  ------------------
 1345|       |
 1346|       |        // Strict bounds checks (including wild copy overrun safety)
 1347|  99.4k|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr) ||
  ------------------
  |  |  154|   198k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 505, False: 98.9k]
  |  |  |  Branch (154:42): [True: 2, False: 99.4k]
  |  |  |  Branch (154:42): [True: 503, False: 98.9k]
  |  |  ------------------
  ------------------
 1348|  99.4k|                     ll + ZXC_PAD_SIZE > (size_t)(l_end - l_ptr))) {
 1349|    505|            seq_ptr = seq_save;
 1350|    505|            extras_ptr = ext_save;
 1351|    505|            break;
 1352|    505|        }
 1353|  98.9k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  532|  98.9k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|  98.9k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  98.9k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1354|       |
 1355|  98.9k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1356|  98.9k|        l_ptr += ll;
 1357|  98.9k|        d_ptr += ll;
 1358|       |
 1359|  98.9k|        if (UNLIKELY(d_ptr < d_bounds && (size_t)(d_ptr - d_floor) < offset))
  ------------------
  |  |  154|  98.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 98.9k]
  |  |  |  Branch (154:42): [True: 0, False: 98.9k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1360|      0|            return ZXC_ERROR_BAD_OFFSET;
 1361|       |
 1362|       |        // The loop entry check guarantees ll + ml + ZXC_PAD_SIZE bytes of
 1363|       |        // headroom, so the wild-copy ladder (incl. overlap/fill runs) is safe.
 1364|  98.9k|        zxc_decode_copy_match(d_ptr, offset, ml);
 1365|  98.9k|        d_ptr += ml;
 1366|  98.9k|        n_seq--;
 1367|  98.9k|    }
 1368|       |
 1369|       |    // --- Safe Path for Remaining Sequences ---
 1370|   219k|    while (n_seq > 0) {
  ------------------
  |  Branch (1370:12): [True: 73.6k, False: 145k]
  ------------------
 1371|  73.6k|        uint32_t seq = zxc_le32(seq_ptr);
 1372|  73.6k|        seq_ptr += sizeof(uint32_t);
 1373|       |
 1374|  73.6k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  534|  73.6k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|  73.6k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|  73.6k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1375|  73.6k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) ll += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|  73.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 470, False: 73.1k]
  |  |  ------------------
  ------------------
 1376|       |
 1377|  73.6k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  536|  73.6k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|  73.6k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  530|  73.6k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|  73.6k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1378|  73.6k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  73.6k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1379|  73.6k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|  73.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 7.49k, False: 66.1k]
  |  |  ------------------
  ------------------
 1380|  73.6k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  532|  73.6k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|  73.6k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  73.6k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1381|       |
 1382|  73.6k|        if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  154|   147k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 20, False: 73.6k]
  |  |  |  Branch (154:42): [True: 2, False: 73.6k]
  |  |  |  Branch (154:42): [True: 18, False: 73.6k]
  |  |  ------------------
  ------------------
 1383|     20|            return ZXC_ERROR_OVERFLOW;
 1384|  73.6k|        ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  170|  73.6k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1385|  73.6k|        l_ptr += ll;
 1386|  73.6k|        d_ptr += ll;
 1387|       |
 1388|  73.6k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  154|  73.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 73.6k]
  |  |  ------------------
  ------------------
 1389|  73.6k|        const uint8_t* match_src = d_ptr - offset;
 1390|       |
 1391|  73.6k|        zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1392|  73.6k|        d_ptr += ml;
 1393|  73.6k|        n_seq--;
 1394|  73.6k|    }
 1395|       |
 1396|       |    // --- Trailing Literals ---
 1397|       |    // Copy remaining literals from source stream (literal exhaustion)
 1398|   145k|    if (UNLIKELY(l_ptr > l_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   145k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 145k]
  |  |  ------------------
  ------------------
 1399|   145k|    if (UNLIKELY(d_ptr > d_end)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|   145k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 145k]
  |  |  ------------------
  ------------------
 1400|       |
 1401|   145k|    const size_t remaining_literals = (size_t)(l_end - l_ptr);
 1402|   145k|    if (UNLIKELY(remaining_literals > (size_t)(d_end - d_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|   145k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 145k]
  |  |  ------------------
  ------------------
 1403|   145k|    ZXC_MEMCPY(d_ptr, l_ptr, remaining_literals);
  ------------------
  |  |  170|   145k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1404|   145k|    d_ptr += remaining_literals;
 1405|       |
 1406|   145k|    return (int)(d_ptr - dst);
 1407|   145k|}
zxc_decompress.c:zxc_decode_block_pak:
 1470|   146k|                                const size_t dst_capacity) {
 1471|   146k|    return zxc_decode_block_pak_impl(ctx, src, src_size, dst, dst_capacity, 0, 0);
 1472|   146k|}

zxc_common.c:zxc_aligned_malloc:
  113|  45.1k|static inline void* zxc_aligned_malloc(const size_t size, const size_t alignment) {
  114|       |#if defined(_WIN32)
  115|       |    return _aligned_malloc(size, alignment);
  116|       |#else
  117|  45.1k|    void* ptr = NULL;
  118|  45.1k|    if (posix_memalign(&ptr, alignment, size) != 0) return NULL;
  ------------------
  |  Branch (118:9): [True: 0, False: 45.1k]
  ------------------
  119|  45.1k|    return ptr;
  120|  45.1k|#endif
  121|  45.1k|}
zxc_common.c:zxc_aligned_free:
  124|  45.1k|static inline void zxc_aligned_free(void* ptr) {
  125|       |#if defined(_WIN32)
  126|       |    _aligned_free(ptr);
  127|       |#else
  128|  45.1k|    free(ptr);
  129|  45.1k|#endif
  130|  45.1k|}

zxc_decompress_chunk_wrapper:
  436|   475k|                                 const uint64_t block_index) {
  437|       |    // dict_size is constant for a stream; this per-block branch (outside the decode
  438|       |    // loop) routes to the dict variant only when a dictionary is active, so the
  439|       |    // no-dict path runs the dict-free chunk wrapper (identical codegen to main).
  440|   475k|    const zxc_variant_set_t* v = zxc_variants();
  441|   475k|    return (ctx->dict_size ? v->decompress_dict : v->decompress)(ctx, src, src_sz, dst, dst_cap,
  ------------------
  |  Branch (441:13): [True: 0, False: 475k]
  ------------------
  442|   475k|                                                                 block_index);
  443|   475k|}
zxc_compress_chunk_wrapper:
  467|   148k|                               const uint64_t block_index) {
  468|   148k|    return zxc_variants()->compress(ctx, src, src_sz, dst, dst_cap, block_index);
  469|   148k|}
zxc_create_cctx:
 1007|  10.6k|zxc_cctx* zxc_create_cctx(void) {
 1008|  10.6k|    zxc_cctx* const cctx = (zxc_cctx*)ZXC_CALLOC(1, sizeof(zxc_cctx));
  ------------------
  |  |   74|  10.6k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
 1009|  10.6k|    if (UNLIKELY(!cctx)) return NULL;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1010|  10.6k|    cctx->params = zxc_cparams_defaults();
 1011|  10.6k|    cctx->init_level = ZXC_LEVEL_DEFAULT;
 1012|  10.6k|    return cctx;
 1013|  10.6k|}
zxc_cparam_bounds:
 1017|  37.4k|int zxc_cparam_bounds(const zxc_cparam_t param, int64_t* min, int64_t* max) {
 1018|  37.4k|    int64_t lo, hi;
 1019|  37.4k|    switch (param) {
 1020|  10.6k|        case ZXC_C_LEVEL:
  ------------------
  |  Branch (1020:9): [True: 10.6k, False: 26.7k]
  ------------------
 1021|  10.6k|            lo = ZXC_LEVEL_FASTEST;
 1022|  10.6k|            hi = ZXC_LEVEL_ULTRA;
 1023|  10.6k|            break;
 1024|  5.41k|        case ZXC_C_BLOCK_SIZE:
  ------------------
  |  Branch (1024:9): [True: 5.41k, False: 32.0k]
  ------------------
 1025|  5.41k|            lo = ZXC_BLOCK_SIZE_MIN;
  ------------------
  |  |   73|  5.41k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  5.41k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
 1026|  5.41k|            hi = ZXC_BLOCK_SIZE_MAX;
  ------------------
  |  |   75|  5.41k|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  ------------------
  |  |  |  |   69|  5.41k|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  ------------------
  ------------------
 1027|  5.41k|            break;
 1028|      0|        case ZXC_C_THREADS:
  ------------------
  |  Branch (1028:9): [True: 0, False: 37.4k]
  ------------------
 1029|      0|            lo = 0;
 1030|      0|            hi = ZXC_MAX_THREADS;
  ------------------
  |  |  107|      0|#define ZXC_MAX_THREADS 512
  ------------------
 1031|      0|            break;
 1032|  10.6k|        case ZXC_C_CHECKSUM:
  ------------------
  |  Branch (1032:9): [True: 10.6k, False: 26.7k]
  ------------------
 1033|  21.3k|        case ZXC_C_SEEKABLE:
  ------------------
  |  Branch (1033:9): [True: 10.6k, False: 26.7k]
  ------------------
 1034|  21.3k|            lo = 0;
 1035|  21.3k|            hi = 1;
 1036|  21.3k|            break;
 1037|      0|        default:
  ------------------
  |  Branch (1037:9): [True: 0, False: 37.4k]
  ------------------
 1038|      0|            return ZXC_ERROR_BAD_PARAM;
 1039|  37.4k|    }
 1040|  37.4k|    if (min) *min = lo;
  ------------------
  |  Branch (1040:9): [True: 37.4k, False: 0]
  ------------------
 1041|  37.4k|    if (max) *max = hi;
  ------------------
  |  Branch (1041:9): [True: 37.4k, False: 0]
  ------------------
 1042|  37.4k|    return ZXC_OK;
 1043|  37.4k|}
zxc_cctx_set_param:
 1052|  37.4k|int zxc_cctx_set_param(zxc_cctx* cctx, const zxc_cparam_t param, const int64_t value) {
 1053|  37.4k|    if (UNLIKELY(!cctx)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  37.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 37.4k]
  |  |  ------------------
  ------------------
 1054|  37.4k|    int64_t lo, hi;
 1055|  37.4k|    const int rc = zxc_cparam_bounds(param, &lo, &hi);
 1056|  37.4k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  37.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 37.4k]
  |  |  ------------------
  ------------------
 1057|  37.4k|    if (value != 0 && (value < lo || value > hi)) {
  ------------------
  |  Branch (1057:9): [True: 32.3k, False: 5.09k]
  |  Branch (1057:24): [True: 0, False: 32.3k]
  |  Branch (1057:38): [True: 0, False: 32.3k]
  ------------------
 1058|      0|        if (param == ZXC_C_LEVEL) return ZXC_ERROR_BAD_LEVEL;
  ------------------
  |  Branch (1058:13): [True: 0, False: 0]
  ------------------
 1059|      0|        return param == ZXC_C_BLOCK_SIZE ? ZXC_ERROR_BAD_BLOCK_SIZE : ZXC_ERROR_BAD_PARAM;
  ------------------
  |  Branch (1059:16): [True: 0, False: 0]
  ------------------
 1060|      0|    }
 1061|       |
 1062|  37.4k|    zxc_cparams_t* const p = &cctx->params;
 1063|  37.4k|    switch (param) {
 1064|  10.6k|        case ZXC_C_LEVEL: {
  ------------------
  |  Branch (1064:9): [True: 10.6k, False: 26.7k]
  ------------------
 1065|       |            // 0 restores the default: on a static workspace, the pinned level.
 1066|  10.6k|            const int level = value != 0             ? (int)value
  ------------------
  |  Branch (1066:31): [True: 10.6k, False: 0]
  ------------------
 1067|  10.6k|                              : cctx->owns_workspace ? cctx->init_level
  ------------------
  |  Branch (1067:33): [True: 0, False: 0]
  ------------------
 1068|      0|                                                     : ZXC_LEVEL_DEFAULT;
 1069|       |            // A static workspace carved below the optimal-parser tier cannot grow into it.
 1070|  10.6k|            if (UNLIKELY(cctx->owns_workspace && level >= ZXC_LEVEL_DENSITY &&
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  |  Branch (154:42): [True: 0, False: 10.6k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1071|  10.6k|                         !cctx->inner.opt_scratch))
 1072|      0|                return ZXC_ERROR_BAD_LEVEL;
 1073|  10.6k|            p->level = level;
 1074|  10.6k|            break;
 1075|  10.6k|        }
 1076|  5.41k|        case ZXC_C_BLOCK_SIZE: {
  ------------------
  |  Branch (1076:9): [True: 5.41k, False: 32.0k]
  ------------------
 1077|  5.41k|            const size_t block_size = value != 0             ? (size_t)value
  ------------------
  |  Branch (1077:39): [True: 5.41k, False: 0]
  ------------------
 1078|  5.41k|                                      : cctx->owns_workspace ? cctx->last_block_size
  ------------------
  |  Branch (1078:41): [True: 0, False: 0]
  ------------------
 1079|      0|                                                             : ZXC_BLOCK_SIZE_DEFAULT;
  ------------------
  |  |   71|      0|#define ZXC_BLOCK_SIZE_DEFAULT (512 * 1024)
  ------------------
 1080|  5.41k|            if (UNLIKELY(!zxc_validate_block_size(block_size))) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  154|  5.41k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 5.41k]
  |  |  ------------------
  ------------------
 1081|  5.41k|            if (UNLIKELY(cctx->owns_workspace && block_size != cctx->last_block_size))
  ------------------
  |  |  154|  5.41k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 5.41k]
  |  |  |  Branch (154:42): [True: 0, False: 5.41k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1082|      0|                return ZXC_ERROR_BAD_BLOCK_SIZE;
 1083|  5.41k|            p->block_size = block_size;
 1084|  5.41k|            break;
 1085|  5.41k|        }
 1086|      0|        case ZXC_C_THREADS:
  ------------------
  |  Branch (1086:9): [True: 0, False: 37.4k]
  ------------------
 1087|      0|            p->n_threads = (int)value;
 1088|      0|            break;
 1089|  10.6k|        case ZXC_C_CHECKSUM:
  ------------------
  |  Branch (1089:9): [True: 10.6k, False: 26.7k]
  ------------------
 1090|  10.6k|            p->checksum_enabled = (int)value;
 1091|  10.6k|            break;
 1092|  10.6k|        case ZXC_C_SEEKABLE:
  ------------------
  |  Branch (1092:9): [True: 10.6k, False: 26.7k]
  ------------------
 1093|  10.6k|            p->seekable = (int)value;
 1094|  10.6k|            break;
 1095|      0|        default:
  ------------------
  |  Branch (1095:9): [True: 0, False: 37.4k]
  ------------------
 1096|      0|            return ZXC_ERROR_BAD_PARAM;  // LCOV_EXCL_LINE: bounds already refused it
 1097|  37.4k|    }
 1098|  37.4k|    return ZXC_OK;
 1099|  37.4k|}
zxc_free_cctx:
 1165|  10.6k|void zxc_free_cctx(zxc_cctx* cctx) {
 1166|  10.6k|    if (UNLIKELY(!cctx)) return;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1167|       |    // Static cctx: handle + inner buffers live inside the caller's workspace,
 1168|       |    // which we do not own. Free is a no-op; the caller owns the workspace.
 1169|  10.6k|    if (cctx->owns_workspace) return;
  ------------------
  |  Branch (1169:9): [True: 0, False: 10.6k]
  ------------------
 1170|  10.6k|    if (cctx->initialized) zxc_cctx_free(&cctx->inner);
  ------------------
  |  Branch (1170:9): [True: 10.6k, False: 0]
  ------------------
 1171|  10.6k|    ZXC_FREE(cctx->dict_copy.data);
  ------------------
  |  |   86|  10.6k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1172|  10.6k|    ZXC_FREE(cctx);
  ------------------
  |  |   86|  10.6k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1173|  10.6k|}
zxc_compress_cctx:
 1301|  10.6k|                          void* RESTRICT dst, const size_t dst_capacity) {
 1302|  10.6k|    if (UNLIKELY(!cctx || !dst || dst_capacity == 0 || (src_size > 0 && !src)))
  ------------------
  |  |  154|  85.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  |  Branch (154:42): [True: 0, False: 10.6k]
  |  |  |  Branch (154:42): [True: 0, False: 10.6k]
  |  |  |  Branch (154:42): [True: 0, False: 10.6k]
  |  |  |  Branch (154:42): [True: 10.6k, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1303|      0|        return ZXC_ERROR_NULL_INPUT;
 1304|       |
 1305|  10.6k|    const zxc_cctx_opts_t o = zxc_cparams_resolve(&cctx->params);
 1306|  10.6k|    return zxc_compress_cctx_resolved(cctx, src, src_size, dst, dst_capacity, o, &cctx->params);
 1307|  10.6k|}
zxc_dispatch.c:zxc_variants:
  335|   624k|static ZXC_ALWAYS_INLINE const zxc_variant_set_t* zxc_variants(void) {
  336|   624k|    return &zxc_variants_default;
  337|   624k|}
zxc_dispatch.c:zxc_cparams_defaults:
 1003|  10.6k|static zxc_cparams_t zxc_cparams_defaults(void) {
 1004|  10.6k|    return (zxc_cparams_t){.level = ZXC_LEVEL_DEFAULT, .block_size = ZXC_BLOCK_SIZE_DEFAULT};
  ------------------
  |  |   71|  10.6k|#define ZXC_BLOCK_SIZE_DEFAULT (512 * 1024)
  ------------------
 1005|  10.6k|}
zxc_dispatch.c:zxc_cparams_resolve:
  995|  10.6k|static zxc_cctx_opts_t zxc_cparams_resolve(const zxc_cparams_t* p) {
  996|  10.6k|    return (zxc_cctx_opts_t){.level = p->level,
  997|  10.6k|                             .checksum = p->checksum_enabled,
  998|  10.6k|                             .seekable = p->seekable,
  999|  10.6k|                             .block_size = p->block_size};
 1000|  10.6k|}
zxc_dispatch.c:zxc_compress_cctx_resolved:
 1186|  10.6k|                                          const zxc_cparams_t* opts) {
 1187|       |    // The dictionary is the context's parameter; its bytes stay caller-owned.
 1188|  10.6k|    const uint8_t* dict = opts ? (const uint8_t*)opts->dict : NULL;
  ------------------
  |  Branch (1188:27): [True: 10.6k, False: 0]
  ------------------
 1189|  10.6k|    const size_t dict_size = ZXC_OPTS_DICT_SIZE(opts);
  ------------------
  |  |  988|  10.6k|#define ZXC_OPTS_DICT_SIZE(o) (((o) && (o)->dict) ? (o)->dict_size : (size_t)0)
  |  |  ------------------
  |  |  |  Branch (988:33): [True: 10.6k, False: 0]
  |  |  |  Branch (988:40): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1190|  10.6k|    const uint8_t* dict_huf = ZXC_OPTS_DICT_HUF(opts);
  ------------------
  |  |  991|  10.6k|    (((o) && (o)->dict && (o)->dict_size > 0) ? (const uint8_t*)(o)->dict_huf : NULL)
  |  |  ------------------
  |  |  |  Branch (991:7): [True: 10.6k, False: 0]
  |  |  |  Branch (991:14): [True: 0, False: 10.6k]
  |  |  |  Branch (991:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1191|       |
 1192|       |    // The encoder sees [dict | block], so the carved chunk covers both.
 1193|  10.6k|    const size_t eff_chunk =
 1194|  10.6k|        dict_size > 0 ? zxc_block_size_ceil(dict_size + o.block_size) : o.block_size;
  ------------------
  |  Branch (1194:9): [True: 0, False: 10.6k]
  ------------------
 1195|  10.6k|    const uint32_t did =
 1196|  10.6k|        (dict && dict_size > 0) ? zxc_dict_compute_id(dict, dict_size, dict_huf) : 0;
  ------------------
  |  Branch (1196:10): [True: 0, False: 10.6k]
  |  Branch (1196:18): [True: 0, False: 0]
  ------------------
 1197|       |
 1198|       |    // Empty source: same writer as the one-shot, workspace left alone.
 1199|  10.6k|    if (UNLIKELY(src_size == 0))
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1200|      0|        return zxc_write_empty_frame((uint8_t*)dst, dst_capacity, o.block_size, o.checksum, did,
 1201|      0|                                     o.seekable);
 1202|       |
 1203|       |    // Re-init when the chunk changed, a level raise needs the optimal-parser
 1204|       |    // scratch, or a dictionary arrives on a context carved without its prefix.
 1205|  10.6k|    if (UNLIKELY(!cctx->initialized || cctx->last_block_size != eff_chunk ||
  ------------------
  |  |  154|  32.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.6k, False: 0]
  |  |  |  Branch (154:42): [True: 10.6k, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1206|  10.6k|                 (o.level >= ZXC_LEVEL_DENSITY && !cctx->inner.opt_scratch) ||
 1207|  10.6k|                 (dict_size > 0 && !cctx->inner.dict_buffer))) {
 1208|  10.6k|        if (cctx->initialized) {
  ------------------
  |  Branch (1208:13): [True: 0, False: 10.6k]
  ------------------
 1209|      0|            zxc_cctx_free(&cctx->inner);
 1210|      0|            cctx->initialized = 0;
 1211|      0|        }
 1212|       |        // LCOV_EXCL_START
 1213|  10.6k|        if (UNLIKELY(zxc_cctx_init(&cctx->inner, eff_chunk, 1, o.level, o.checksum, dict_size) !=
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1214|  10.6k|                     ZXC_OK))
 1215|      0|            return ZXC_ERROR_MEMORY;
 1216|       |        // LCOV_EXCL_STOP
 1217|  10.6k|        cctx->last_block_size = eff_chunk;
 1218|  10.6k|        cctx->initialized = 1;
 1219|  10.6k|        cctx->huf_cached = 0;
 1220|  10.6k|    } else {
 1221|       |        // Same chunk: update level + checksum without realloc.
 1222|      0|        cctx->inner.compression_level = o.level;
 1223|      0|        cctx->inner.checksum_enabled = o.checksum;
 1224|      0|    }
 1225|       |
 1226|  10.6k|    zxc_cctx_t* const ctx = &cctx->inner;
 1227|  10.6k|    ctx->dict_size = dict_size;
 1228|  10.6k|    if (UNLIKELY(zxc_ctx_sync_dict_huf(ctx, cctx->huf_cache, &cctx->huf_cached, dict_huf) !=
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1229|  10.6k|                 ZXC_OK))
 1230|      0|        return ZXC_ERROR_CORRUPT_DATA;
 1231|       |
 1232|       |    // [dict | block] input for the encoder, NULL without a dictionary.
 1233|  10.6k|    uint8_t* const dict_input = dict_size > 0 ? ctx->dict_buffer : NULL;
  ------------------
  |  Branch (1233:33): [True: 0, False: 10.6k]
  ------------------
 1234|  10.6k|    if (dict_input) ZXC_MEMCPY(dict_input, dict, dict_size);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  |  Branch (1234:9): [True: 0, False: 10.6k]
  ------------------
 1235|       |
 1236|  10.6k|    uint8_t* op = (uint8_t*)dst;
 1237|  10.6k|    const uint8_t* const op_start = op;
 1238|  10.6k|    const uint8_t* const op_end = op + dst_capacity;
 1239|  10.6k|    const uint8_t* const ip = (const uint8_t*)src;
 1240|       |
 1241|  10.6k|    const int h_val =
 1242|  10.6k|        zxc_write_file_header(op, (size_t)(op_end - op), o.block_size, o.checksum, did, o.seekable);
 1243|  10.6k|    if (UNLIKELY(h_val < 0)) return h_val;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1244|  10.6k|    op += h_val;
 1245|       |
 1246|  10.6k|    uint64_t digest = 0;
 1247|  10.6k|    size_t pos = 0;
 1248|  10.6k|    uint64_t bi = 0;
 1249|   159k|    for (; pos < src_size; bi++) {
  ------------------
  |  Branch (1249:12): [True: 148k, False: 10.6k]
  ------------------
 1250|   148k|        const size_t chunk_len = (src_size - pos > o.block_size) ? o.block_size : (src_size - pos);
  ------------------
  |  Branch (1250:34): [True: 138k, False: 10.6k]
  ------------------
 1251|   148k|        const size_t rem_cap = (size_t)(op_end - op);
 1252|       |
 1253|   148k|        int res;
 1254|   148k|        if (dict_input) {
  ------------------
  |  Branch (1254:13): [True: 0, False: 148k]
  ------------------
 1255|      0|            ZXC_MEMCPY(dict_input + dict_size, ip + pos, chunk_len);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1256|      0|            res =
 1257|      0|                zxc_compress_chunk_wrapper(ctx, dict_input, dict_size + chunk_len, op, rem_cap, bi);
 1258|   148k|        } else {
 1259|   148k|            res = zxc_compress_chunk_wrapper(ctx, ip + pos, chunk_len, op, rem_cap, bi);
 1260|   148k|        }
 1261|   148k|        if (UNLIKELY(res < 0)) return res;
  ------------------
  |  |  154|   148k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 148k]
  |  |  ------------------
  ------------------
 1262|       |
 1263|   148k|        if (o.checksum && LIKELY(res >= ZXC_BLOCK_CHECKSUM_SIZE))
  ------------------
  |  |  148|   112k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 112k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1263:13): [True: 112k, False: 36.2k]
  ------------------
 1264|   112k|            digest = zxc_digest_combine(digest, zxc_le32(op + res - ZXC_BLOCK_CHECKSUM_SIZE));
  ------------------
  |  |  430|   112k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
 1265|       |
 1266|   148k|        op += res;
 1267|   148k|        pos += chunk_len;
 1268|   148k|    }
 1269|       |    // EOF block
 1270|  10.6k|    uint8_t* const eof_at = op;
 1271|  10.6k|    const size_t rem_cap = (size_t)(op_end - op);
 1272|  10.6k|    const zxc_block_header_t eof_bh = {
 1273|  10.6k|        .block_type = ZXC_BLOCK_EOF, .block_flags = 0, .reserved = 0, .comp_size = 0};
 1274|  10.6k|    const int eof_val = zxc_write_block_header(op, rem_cap, &eof_bh);
 1275|  10.6k|    if (UNLIKELY(eof_val < 0)) return eof_val;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1276|  10.6k|    op += eof_val;
 1277|       |
 1278|       |    // Seek table between the EOF block and the footer.
 1279|  10.6k|    if (o.seekable) {
  ------------------
  |  Branch (1279:9): [True: 10.6k, False: 0]
  ------------------
 1280|  10.6k|        const int64_t st_val = zxc_write_seek_table_from_blocks(
 1281|  10.6k|            op, (size_t)(op_end - op), op_start + h_val, eof_at, bi, o.checksum);
 1282|  10.6k|        if (UNLIKELY(st_val < 0)) return st_val;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1283|  10.6k|        op += st_val;
 1284|  10.6k|    }
 1285|       |
 1286|  10.6k|    const int footer_val = zxc_write_file_footer(
 1287|  10.6k|        op, (size_t)(op_end - op), (uint64_t)(op - op_start), src_size, digest, o.checksum);
 1288|  10.6k|    if (UNLIKELY(footer_val < 0)) return footer_val;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1289|  10.6k|    op += footer_val;
 1290|       |
 1291|  10.6k|    return (int64_t)(op - op_start);
 1292|  10.6k|}
zxc_dispatch.c:zxc_write_seek_table_from_blocks:
  606|  10.6k|                                                const int checksum_enabled) {
  607|  10.6k|    const size_t total = zxc_seek_table_size(num_blocks);
  608|  10.6k|    if (UNLIKELY(total == 0)) return ZXC_ERROR_OVERFLOW;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  609|  10.6k|    if (UNLIKELY(dst_capacity < total)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  610|       |
  611|  10.6k|    const int h = zxc_seek_table_header(dst, dst_capacity, num_blocks);
  612|  10.6k|    if (UNLIKELY(h < 0)) return h;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  613|  10.6k|    uint8_t* p = dst + h;
  614|       |
  615|  10.6k|    const size_t trailer = ZXC_BLOCK_HEADER_SIZE + (checksum_enabled ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  428|  10.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                  const size_t trailer = ZXC_BLOCK_HEADER_SIZE + (checksum_enabled ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  430|  5.57k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (615:53): [True: 5.57k, False: 5.09k]
  ------------------
  616|  10.6k|    uint64_t anchor = ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  10.6k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  617|   159k|    for (uint64_t i = 0; i < num_blocks; i++) {
  ------------------
  |  Branch (617:26): [True: 148k, False: 10.6k]
  ------------------
  618|   148k|        if (i % ZXC_SEEK_GROUP == 0) {
  ------------------
  |  |  463|   148k|#define ZXC_SEEK_GROUP 64U
  ------------------
  |  Branch (618:13): [True: 12.2k, False: 136k]
  ------------------
  619|  12.2k|            zxc_store_le64(p, anchor);
  620|  12.2k|            p += ZXC_SEEK_ANCHOR_SIZE;
  ------------------
  |  |  465|  12.2k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  ------------------
  621|  12.2k|        }
  622|   148k|        const size_t left = (size_t)(blocks_end - blocks);
  623|   148k|        if (UNLIKELY(left < ZXC_BLOCK_HEADER_SIZE))
  ------------------
  |  |  154|   148k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 148k]
  |  |  ------------------
  ------------------
  624|      0|            return ZXC_ERROR_CORRUPT_DATA;                           // LCOV_EXCL_LINE
  625|   148k|        const size_t size = (size_t)zxc_le32(blocks + 3) + trailer;  // comp_size at offset 3
  626|   148k|        if (UNLIKELY(size > left)) return ZXC_ERROR_CORRUPT_DATA;    // LCOV_EXCL_LINE
  ------------------
  |  |  154|   148k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 148k]
  |  |  ------------------
  ------------------
  627|   148k|        zxc_store_le32(p, (uint32_t)size);
  628|   148k|        p += ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  467|   148k|#define ZXC_SEEK_SIZE_ENTRY 4U
  ------------------
  629|   148k|        anchor += size;
  630|   148k|        blocks += size;
  631|   148k|    }
  632|  10.6k|    if (UNLIKELY(blocks != blocks_end)) return ZXC_ERROR_CORRUPT_DATA;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  10.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  633|  10.6k|    return (int64_t)(p - dst);
  634|  10.6k|}
zxc_dispatch.c:zxc_ctx_sync_dict_huf:
  977|  10.6k|                                 int* RESTRICT cached, const uint8_t* RESTRICT dict_huf) {
  978|  10.6k|    if (dict_huf) {
  ------------------
  |  Branch (978:9): [True: 0, False: 10.6k]
  ------------------
  979|      0|        if (!*cached || memcmp(cache, dict_huf, ZXC_HUF_TABLE_SIZE) != 0) {
  ------------------
  |  |   96|      0|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
  |  Branch (979:13): [True: 0, False: 0]
  |  Branch (979:25): [True: 0, False: 0]
  ------------------
  980|      0|            *cached = 0; /* a failed attach leaves inner without a tree */
  981|      0|            if (UNLIKELY(zxc_cctx_attach_dict_huf(inner, dict_huf) != ZXC_OK))
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  982|      0|                return ZXC_ERROR_CORRUPT_DATA;
  983|      0|            ZXC_MEMCPY(cache, dict_huf, ZXC_HUF_TABLE_SIZE);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  984|      0|            *cached = 1;
  985|      0|        }
  986|  10.6k|    } else if (*cached) {
  ------------------
  |  Branch (986:16): [True: 0, False: 10.6k]
  ------------------
  987|      0|        (void)zxc_cctx_attach_dict_huf(inner, NULL);
  988|      0|        *cached = 0;
  989|      0|    }
  990|  10.6k|    return ZXC_OK;
  991|  10.6k|}

zxc_common.c:zxc_log2_u32:
 1117|  77.1k|static ZXC_ALWAYS_INLINE uint32_t zxc_log2_u32(const uint32_t v) {
 1118|       |#ifdef _MSC_VER
 1119|       |    unsigned long index;
 1120|       |    return (v == 0) ? 0 : (_BitScanReverse(&index, v) ? index : 0);
 1121|       |#else
 1122|  77.1k|    return (v == 0) ? 0 : (uint32_t)(31 - __builtin_clz(v));
  ------------------
  |  Branch (1122:12): [True: 0, False: 77.1k]
  ------------------
 1123|  77.1k|#endif
 1124|  77.1k|}
zxc_common.c:zxc_store_le32:
 1456|  1.26M|static ZXC_ALWAYS_INLINE void zxc_store_le32(void* p, const uint32_t v) {
 1457|       |#ifdef ZXC_BIG_ENDIAN
 1458|       |    const uint32_t s = ZXC_BSWAP32(v);
 1459|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1460|       |#else
 1461|  1.26M|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  1.26M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1462|  1.26M|#endif
 1463|  1.26M|}
zxc_common.c:zxc_file_header_sign:
 1525|  10.6k|static ZXC_ALWAYS_INLINE void zxc_file_header_sign(uint8_t* h) {
 1526|  10.6k|    zxc_store_le16(h + 14, 0);
 1527|  10.6k|    zxc_store_le16(h + 14, zxc_hash16(h));
 1528|  10.6k|}
zxc_common.c:zxc_store_le16:
 1438|  21.3k|static ZXC_ALWAYS_INLINE void zxc_store_le16(void* p, const uint16_t v) {
 1439|       |#ifdef ZXC_BIG_ENDIAN
 1440|       |    const uint16_t s = ZXC_BSWAP16(v);
 1441|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1442|       |#else
 1443|  21.3k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  21.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1444|  21.3k|#endif
 1445|  21.3k|}
zxc_common.c:zxc_le32:
 1356|  1.27M|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|  1.27M|    uint32_t v;
 1358|  1.27M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  1.27M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|  1.27M|    return v;
 1363|  1.27M|#endif
 1364|  1.27M|}
zxc_common.c:zxc_le16:
 1337|  21.3k|static ZXC_ALWAYS_INLINE uint16_t zxc_le16(const void* p) {
 1338|  21.3k|    uint16_t v;
 1339|  21.3k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  21.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1340|       |#ifdef ZXC_BIG_ENDIAN
 1341|       |    return ZXC_BSWAP16(v);
 1342|       |#else
 1343|  21.3k|    return v;
 1344|  21.3k|#endif
 1345|  21.3k|}
zxc_common.c:zxc_hash16:
 1514|  32.0k|static ZXC_ALWAYS_INLINE uint16_t zxc_hash16(const uint8_t* p) {
 1515|  32.0k|    const uint64_t h1 = (zxc_le64(p) ^ ZXC_HASH_MULT64) * ZXC_HASH_MULT64;
  ------------------
  |  |  755|  32.0k|#define ZXC_HASH_MULT64 0xD2D84A61D2D84A61ULL
  ------------------
                  const uint64_t h1 = (zxc_le64(p) ^ ZXC_HASH_MULT64) * ZXC_HASH_MULT64;
  ------------------
  |  |  755|  32.0k|#define ZXC_HASH_MULT64 0xD2D84A61D2D84A61ULL
  ------------------
 1516|       |
 1517|  32.0k|    return (uint16_t)(((h1 + zxc_le64(p + 8) + ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64) >> 48);
  ------------------
  |  |  749|  32.0k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
                  return (uint16_t)(((h1 + zxc_le64(p + 8) + ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64) >> 48);
  ------------------
  |  |  749|  32.0k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1518|  32.0k|}
zxc_common.c:zxc_short_input_verdict:
 2234|    808|static inline int zxc_short_input_verdict(const uint8_t* p, const size_t n) {
 2235|    808|    size_t chunk = 0;
 2236|    808|    const int rc = zxc_read_file_header(p, n < ZXC_FILE_HEADER_SIZE ? n : ZXC_FILE_HEADER_SIZE,
  ------------------
  |  |  120|    808|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
                  const int rc = zxc_read_file_header(p, n < ZXC_FILE_HEADER_SIZE ? n : ZXC_FILE_HEADER_SIZE,
  ------------------
  |  |  120|    580|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  |  Branch (2236:44): [True: 228, False: 580]
  ------------------
 2237|    808|                                        &chunk, NULL, NULL, NULL);
 2238|    808|    return rc != ZXC_OK ? rc : ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  Branch (2238:12): [True: 808, False: 0]
  ------------------
 2239|    808|}
zxc_common.c:zxc_frame_tail_len:
 2453|  22.0k|static inline size_t zxc_frame_tail_len(const uint64_t total) {
 2454|  22.0k|    const uint64_t body = total - (ZXC_FILE_HEADER_SIZE + ZXC_BLOCK_HEADER_SIZE);
  ------------------
  |  |  120|  22.0k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
                  const uint64_t body = total - (ZXC_FILE_HEADER_SIZE + ZXC_BLOCK_HEADER_SIZE);
  ------------------
  |  |  428|  22.0k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2455|  22.0k|    return body < ZXC_FOOTER_MAX_SIZE_WITH_DIGEST ? (size_t)body : ZXC_FOOTER_MAX_SIZE_WITH_DIGEST;
  ------------------
  |  | 2445|  22.0k|#define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  127|  22.0k|#define ZXC_FILE_DIGEST_SIZE 8
  |  |  ------------------
  |  |               #define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  125|  22.0k|#define ZXC_FILE_FOOTER_MAX_SIZE 17
  |  |  ------------------
  ------------------
                  return body < ZXC_FOOTER_MAX_SIZE_WITH_DIGEST ? (size_t)body : ZXC_FOOTER_MAX_SIZE_WITH_DIGEST;
  ------------------
  |  | 2445|  21.8k|#define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  127|  21.8k|#define ZXC_FILE_DIGEST_SIZE 8
  |  |  ------------------
  |  |               #define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  125|  21.8k|#define ZXC_FILE_FOOTER_MAX_SIZE 17
  |  |  ------------------
  ------------------
  |  Branch (2455:12): [True: 175, False: 21.8k]
  ------------------
 2456|  22.0k|}
zxc_common.c:zxc_footer_dsize_plausible:
 2497|  21.3k|                                                        const uint64_t comp_size) {
 2498|  21.3k|    return zxc_seek_block_count(dsize, chunk_size) <= comp_size / ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  21.3k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2499|  21.3k|}
zxc_common.c:zxc_le64:
 1419|  1.48M|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|  1.48M|    uint64_t v;
 1421|  1.48M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  1.48M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|  1.48M|    return v;
 1426|  1.48M|#endif
 1427|  1.48M|}
zxc_common.c:zxc_hash8:
 1495|  1.41M|static ZXC_ALWAYS_INLINE uint8_t zxc_hash8(const uint8_t* p) {
 1496|  1.41M|    const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  749|  1.41M|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
                  const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  749|  1.41M|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1497|       |
 1498|  1.41M|    return (uint8_t)(h >> 56);
 1499|  1.41M|}
zxc_common.c:zxc_seek_table_bytes:
  483|   396k|static ZXC_ALWAYS_INLINE uint64_t zxc_seek_table_bytes(const uint64_t nblocks) {
  484|   396k|    return zxc_seek_group_count(nblocks) * ZXC_SEEK_ANCHOR_SIZE + nblocks * ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  465|   396k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  ------------------
                  return zxc_seek_group_count(nblocks) * ZXC_SEEK_ANCHOR_SIZE + nblocks * ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  467|   396k|#define ZXC_SEEK_SIZE_ENTRY 4U
  ------------------
  485|   396k|}
zxc_common.c:zxc_seek_group_count:
  472|   396k|static ZXC_ALWAYS_INLINE uint64_t zxc_seek_group_count(const uint64_t nblocks) {
  473|   396k|    return (nblocks + ZXC_SEEK_GROUP - 1) / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   396k|#define ZXC_SEEK_GROUP 64U
  ------------------
                  return (nblocks + ZXC_SEEK_GROUP - 1) / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   396k|#define ZXC_SEEK_GROUP 64U
  ------------------
  474|   396k|}
zxc_common.c:zxc_seek_size_field:
  489|   374k|static ZXC_ALWAYS_INLINE uint32_t zxc_seek_size_field(const uint64_t table_bytes) {
  490|       |#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
  491|       |    // MSVC 19.51 ARM64 /O2 sees the table size as 4U and compiles this fold into
  492|       |    // `ror w, #30` on the low half of u, dropping the high word: tables of 4 GiB
  493|       |    // and more get a wrong field. A volatile copy hides that shape. Once per table.
  494|       |    const volatile uint64_t t = table_bytes;
  495|       |    return (uint32_t)(t ^ (t >> 32));
  496|       |#else
  497|   374k|    return (uint32_t)(table_bytes ^ (table_bytes >> 32));
  498|   374k|#endif
  499|   374k|}
zxc_common.c:zxc_seek_block_count:
 1640|   385k|                                                       const size_t block_size) {
 1641|       |    // A shift, block_size being a header power of two: no 64-bit division on 32-bit
 1642|       |    // hosts. Not (total + bs - 1) >> s, which wraps near 2^64 on a forged footer.
 1643|   385k|    if (UNLIKELY(!block_size)) return 0;
  ------------------
  |  |  154|   385k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 385k]
  |  |  ------------------
  ------------------
 1644|   385k|    const int s = zxc_ctz32((uint32_t)block_size);
 1645|   385k|    return (total_decomp >> s) + ((total_decomp & (block_size - 1)) != 0);
 1646|   385k|}
zxc_common.c:zxc_ctz32:
 1586|   385k|static ZXC_ALWAYS_INLINE int zxc_ctz32(const uint32_t x) {
 1587|   385k|    if (x == 0) return 32;
  ------------------
  |  Branch (1587:9): [True: 0, False: 385k]
  ------------------
 1588|   385k|#if defined(__GNUC__) || defined(__clang__)
 1589|   385k|    return __builtin_ctz(x);
 1590|       |#elif defined(_MSC_VER)
 1591|       |    unsigned long r;
 1592|       |    _BitScanForward(&r, x);
 1593|       |    return (int)r;
 1594|       |#else
 1595|       |    // Fallback De Bruijn (32 bits)
 1596|       |    static const int DeBruijn32[32] = {0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20,
 1597|       |                                       15, 25, 17, 4,  8,  31, 27, 13, 23, 21, 19,
 1598|       |                                       16, 7,  26, 12, 18, 6,  11, 5,  10, 9};
 1599|       |    return DeBruijn32[((uint32_t)((x & (0U - x)) * 0x077CB531U)) >> 27];
 1600|       |#endif
 1601|   385k|}
zxc_common.c:zxc_store_le64:
 1474|  5.57k|static ZXC_ALWAYS_INLINE void zxc_store_le64(void* p, const uint64_t v) {
 1475|       |#ifdef ZXC_BIG_ENDIAN
 1476|       |    const uint64_t s = ZXC_BSWAP64(v);
 1477|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1478|       |#else
 1479|  5.57k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  5.57k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1480|  5.57k|#endif
 1481|  5.57k|}
zxc_common.c:zxc_footer_layout:
 2388|  10.6k|                                                               const int checksum_enabled) {
 2389|  10.6k|    zxc_footer_layout_t l;
 2390|  10.6k|    l.skip = checksum_enabled ? (size_t)ZXC_FILE_DIGEST_SIZE : 0U;
  ------------------
  |  |  127|  5.57k|#define ZXC_FILE_DIGEST_SIZE 8
  ------------------
  |  Branch (2390:14): [True: 5.57k, False: 5.09k]
  ------------------
 2391|  10.6k|    l.nd = zxc_uint_bytes(src_size);
 2392|  10.6k|    const uint64_t base = prefix + l.skip + l.nd + 1;
 2393|  10.6k|    l.nf = 1;
 2394|  18.9k|    while (zxc_uint_bytes(base + l.nf) > l.nf) l.nf++;
  ------------------
  |  Branch (2394:12): [True: 8.32k, False: 10.6k]
  ------------------
 2395|  10.6k|    l.compressed_size = base + l.nf;
 2396|  10.6k|    l.len = l.skip + l.nd + l.nf + 1;
 2397|  10.6k|    return l;
 2398|  10.6k|}
zxc_common.c:zxc_uint_bytes:
 2365|   152k|static ZXC_ALWAYS_INLINE size_t zxc_uint_bytes(const uint64_t v) {
 2366|   152k|    size_t n = 1;
 2367|   320k|    while (n < sizeof(uint64_t) && (v >> (8 * n)) != 0) n++;
  ------------------
  |  Branch (2367:12): [True: 318k, False: 1.26k]
  |  Branch (2367:36): [True: 167k, False: 151k]
  ------------------
 2368|   152k|    return n;
 2369|   152k|}
zxc_compress.c:zxc_get_lz77_params:
 1221|   148k|static ZXC_ALWAYS_INLINE zxc_lz77_params_t zxc_get_lz77_params(const int level) {
 1222|       |    // The distance floor stops at level 5: the slow levels keep every distance.
 1223|       |    // Match splitting at levels 3-5 only: 1-2 are PAK, 6-7 keep every escape.
 1224|       |    // search_depth, sufficient_len, use_lazy, lazy_attempts, lazy_len_threshold, step_base,
 1225|       |    // step_shift, min_offset, split_max
 1226|   148k|    static const zxc_lz77_params_t table[7] = {
 1227|   148k|        {3, 16, 0, 0, 0, 4, 4, ZXC_LZ_MINDIST, 0},        // fallback
  ------------------
  |  |  697|   148k|#define ZXC_LZ_MINDIST 32
  ------------------
 1228|   148k|        {3, 16, 0, 0, 0, 4, 4, ZXC_LZ_MINDIST, 0},        // level 1
  ------------------
  |  |  697|   148k|#define ZXC_LZ_MINDIST 32
  ------------------
 1229|   148k|        {3, 18, 0, 0, 0, 3, 6, ZXC_LZ_MINDIST, 0},        // level 2
  ------------------
  |  |  697|   148k|#define ZXC_LZ_MINDIST 32
  ------------------
 1230|   148k|        {3, 16, 1, 4, 128, 1, 4, ZXC_LZ_MINDIST, 33},     // level 3
  ------------------
  |  |  697|   148k|#define ZXC_LZ_MINDIST 32
  ------------------
 1231|   148k|        {3, 18, 1, 4, 128, 1, 5, ZXC_LZ_MINDIST, 24},     // level 4
  ------------------
  |  |  697|   148k|#define ZXC_LZ_MINDIST 32
  ------------------
 1232|   148k|        {64, 256, 1, 16, 128, 1, 8, ZXC_LZ_MINDIST, 23},  // level 5
  ------------------
  |  |  697|   148k|#define ZXC_LZ_MINDIST 32
  ------------------
 1233|   148k|        {64, 256, 0, 0, 0, 1, 8, 1, 0}                    // level 6
 1234|   148k|    };
 1235|   148k|    return (level >= ZXC_LEVEL_ULTRA)
  ------------------
  |  Branch (1235:12): [True: 0, False: 148k]
  ------------------
 1236|   148k|               ? (zxc_lz77_params_t){128, 256, 0, 0, 0, 1, 8, 1, 0}
 1237|   148k|               : table[level < ZXC_LEVEL_FASTEST ? ZXC_LEVEL_FASTEST : level];
  ------------------
  |  Branch (1237:24): [True: 0, False: 148k]
  ------------------
 1238|   148k|}
zxc_compress.c:zxc_block_is_short_dist_bound:
 1379|   148k|                                                           const size_t size) {
 1380|   148k|    const size_t d_max = ZXC_LZ_MINDIST;
  ------------------
  |  |  697|   148k|#define ZXC_LZ_MINDIST 32
  ------------------
 1381|       |    // Too small to sample, and too small to gain: keep every distance.
 1382|   148k|    if (size < d_max + sizeof(uint32_t)) return 1;
  ------------------
  |  Branch (1382:9): [True: 1.37k, False: 147k]
  ------------------
 1383|       |
 1384|   147k|    size_t want = size / ZXC_LZ_MINDIST_PROBE_PER_KB;
  ------------------
  |  |  704|   147k|#define ZXC_LZ_MINDIST_PROBE_PER_KB 1024
  ------------------
 1385|   147k|    if (want < ZXC_LZ_MINDIST_PROBE_MIN) want = ZXC_LZ_MINDIST_PROBE_MIN;
  ------------------
  |  |  705|   147k|#define ZXC_LZ_MINDIST_PROBE_MIN 16
  ------------------
                  if (want < ZXC_LZ_MINDIST_PROBE_MIN) want = ZXC_LZ_MINDIST_PROBE_MIN;
  ------------------
  |  |  705|   145k|#define ZXC_LZ_MINDIST_PROBE_MIN 16
  ------------------
  |  Branch (1385:9): [True: 145k, False: 2.25k]
  ------------------
 1386|   147k|    if (want > ZXC_LZ_MINDIST_PROBE_MAX) want = ZXC_LZ_MINDIST_PROBE_MAX;
  ------------------
  |  |  706|   147k|#define ZXC_LZ_MINDIST_PROBE_MAX 64
  ------------------
                  if (want > ZXC_LZ_MINDIST_PROBE_MAX) want = ZXC_LZ_MINDIST_PROBE_MAX;
  ------------------
  |  |  706|  1.66k|#define ZXC_LZ_MINDIST_PROBE_MAX 64
  ------------------
  |  Branch (1386:9): [True: 1.66k, False: 145k]
  ------------------
 1387|   147k|    size_t stride = size / want;
 1388|   147k|    if (stride < d_max) stride = d_max;
  ------------------
  |  Branch (1388:9): [True: 3.62k, False: 143k]
  ------------------
 1389|       |
 1390|   147k|    const size_t planned = (size - sizeof(uint32_t) - d_max) / stride + 1;
 1391|   147k|    const size_t bar = (size_t)ZXC_LZ_MINDIST_MAX_SHORT_PCT * planned;
  ------------------
  |  |  714|   147k|#define ZXC_LZ_MINDIST_MAX_SHORT_PCT 20
  ------------------
 1392|       |
 1393|   147k|    size_t samples = 0;
 1394|   147k|    size_t hits = 0;
 1395|  1.29M|    for (size_t i = d_max; i + sizeof(uint32_t) <= size; i += stride) {
  ------------------
  |  Branch (1395:28): [True: 1.29M, False: 0]
  ------------------
 1396|  1.29M|        const uint32_t cur = zxc_le32(blk + i);
 1397|  1.29M|        samples++;
 1398|  30.1M|        for (size_t d = 1; d < d_max; d++) {
  ------------------
  |  Branch (1398:28): [True: 29.2M, False: 888k]
  ------------------
 1399|  29.2M|            if (zxc_le32(blk + i - d) == cur) {
  ------------------
  |  Branch (1399:17): [True: 407k, False: 28.8M]
  ------------------
 1400|   407k|                hits++;
 1401|   407k|                break;
 1402|   407k|            }
 1403|  29.2M|        }
 1404|  1.29M|        if (hits * 100U > bar) return 1;                           // can only rise
  ------------------
  |  Branch (1404:13): [True: 92.1k, False: 1.20M]
  ------------------
 1405|  1.20M|        if ((hits + (planned - samples)) * 100U <= bar) return 0;  // out of reach
  ------------------
  |  Branch (1405:13): [True: 55.2k, False: 1.14M]
  ------------------
 1406|  1.20M|    }
 1407|      0|    return hits * 100U > bar;
 1408|   147k|}
zxc_compress.c:zxc_le32:
 1356|   189M|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|   189M|    uint32_t v;
 1358|   189M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|   189M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|   189M|    return v;
 1363|   189M|#endif
 1364|   189M|}
zxc_compress.c:zxc_le64:
 1419|   204M|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|   204M|    uint64_t v;
 1421|   204M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|   204M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|   204M|    return v;
 1426|   204M|#endif
 1427|   204M|}
zxc_compress.c:zxc_ctz64:
 1612|  16.9M|static ZXC_ALWAYS_INLINE int zxc_ctz64(const uint64_t x) {
 1613|  16.9M|    if (x == 0) return 64;
  ------------------
  |  Branch (1613:9): [True: 0, False: 16.9M]
  ------------------
 1614|  16.9M|#if defined(__GNUC__) || defined(__clang__)
 1615|  16.9M|    return __builtin_ctzll(x);
 1616|       |#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64))
 1617|       |    unsigned long r;
 1618|       |    _BitScanForward64(&r, x);
 1619|       |    return (int)r;
 1620|       |#elif defined(_MSC_VER)
 1621|       |    // Use two 32-bit scans to avoid fragile 64-bit De Bruijn multiplication.
 1622|       |    unsigned long r;
 1623|       |    const uint32_t lo = (uint32_t)x;
 1624|       |    if (_BitScanForward(&r, lo)) return (int)r;
 1625|       |    _BitScanForward(&r, (uint32_t)(x >> 32));
 1626|       |    return 32 + (int)r;
 1627|       |#else
 1628|       |    // Fallback De Bruijn for non-GCC/non-MSVC compilers
 1629|       |    static const int Debruijn64[64] = {
 1630|       |        0,  1,  48, 2,  57, 49, 28, 3,  61, 58, 50, 42, 38, 29, 17, 4,  62, 55, 59, 36, 53, 51,
 1631|       |        43, 22, 45, 39, 33, 30, 24, 18, 12, 5,  63, 47, 56, 27, 60, 41, 37, 16, 54, 35, 52, 21,
 1632|       |        44, 32, 23, 11, 46, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9,  13, 8,  7,  6};
 1633|       |    return Debruijn64[((x & (0ULL - x)) * 0x03F79D71B4CA8B09ULL) >> 58];
 1634|       |#endif
 1635|  16.9M|}
zxc_compress.c:zxc_ctz32:
 1586|  3.57M|static ZXC_ALWAYS_INLINE int zxc_ctz32(const uint32_t x) {
 1587|  3.57M|    if (x == 0) return 32;
  ------------------
  |  Branch (1587:9): [True: 0, False: 3.57M]
  ------------------
 1588|  3.57M|#if defined(__GNUC__) || defined(__clang__)
 1589|  3.57M|    return __builtin_ctz(x);
 1590|       |#elif defined(_MSC_VER)
 1591|       |    unsigned long r;
 1592|       |    _BitScanForward(&r, x);
 1593|       |    return (int)r;
 1594|       |#else
 1595|       |    // Fallback De Bruijn (32 bits)
 1596|       |    static const int DeBruijn32[32] = {0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20,
 1597|       |                                       15, 25, 17, 4,  8,  31, 27, 13, 23, 21, 19,
 1598|       |                                       16, 7,  26, 12, 18, 6,  11, 5,  10, 9};
 1599|       |    return DeBruijn32[((uint32_t)((x & (0U - x)) * 0x077CB531U)) >> 27];
 1600|       |#endif
 1601|  3.57M|}
zxc_compress.c:zxc_copy32:
 1558|  4.32M|static ZXC_ALWAYS_INLINE void zxc_copy32(void* dst, const void* src) {
 1559|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
 1560|       |    // AVX2/AVX512: Single 256-bit (32 byte) unaligned load/store
 1561|       |    _mm256_storeu_si256((__m256i*)dst, _mm256_loadu_si256((const __m256i*)src));
 1562|       |#elif defined(ZXC_USE_SSE2)
 1563|       |    const __m128i a = _mm_loadu_si128((const __m128i*)src);
 1564|  4.32M|    const __m128i b = _mm_loadu_si128((const __m128i*)((const uint8_t*)src + 16));
 1565|  4.32M|    _mm_storeu_si128((__m128i*)dst, a);
 1566|  4.32M|    _mm_storeu_si128((__m128i*)((uint8_t*)dst + 16), b);
 1567|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1568|       |    const uint8x16_t a = vld1q_u8((const uint8_t*)src);
 1569|       |    const uint8x16_t b = vld1q_u8((const uint8_t*)src + 16);
 1570|       |    vst1q_u8((uint8_t*)dst, a);
 1571|       |    vst1q_u8((uint8_t*)dst + 16, b);
 1572|       |#else
 1573|       |    ZXC_MEMCPY(dst, src, 32);
 1574|       |#endif
 1575|  4.32M|}
zxc_compress.c:zxc_read_varint:
  619|   721k|static ZXC_ALWAYS_INLINE uint32_t zxc_read_varint(const uint8_t** ptr, const uint8_t* end) {
  620|   721k|    const uint8_t* p = *ptr;
  621|   721k|    if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  154|   721k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 721k]
  |  |  ------------------
  ------------------
                  if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|      0|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|      0|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  622|       |
  623|   721k|    const uint32_t b0 = p[0];
  624|       |
  625|       |    // 1 Byte: 0xxxxxxx (7 bits) -> val < 128 (2^7)
  626|   721k|    if (LIKELY(b0 < 0x80)) {
  ------------------
  |  |  148|   721k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 677k, False: 44.0k]
  |  |  ------------------
  ------------------
  627|   677k|        *ptr = p + 1;
  628|   677k|        return b0;
  629|   677k|    }
  630|       |
  631|       |    // 2 Bytes: 10xxxxxx xxxxxxxx (14 bits) -> val < 16384 (2^14)
  632|  44.0k|    if (LIKELY(b0 < 0xC0)) {
  ------------------
  |  |  148|  44.0k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 43.8k, False: 197]
  |  |  ------------------
  ------------------
  633|  43.8k|        if (UNLIKELY(p + 1 >= end)) {
  ------------------
  |  |  154|  43.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 43.8k]
  |  |  ------------------
  ------------------
  634|      0|            *ptr = end;
  635|      0|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|      0|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|      0|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|      0|        }
  637|  43.8k|        *ptr = p + 2;
  638|  43.8k|        return (b0 & 0x3F) | ((uint32_t)p[1] << 6);
  639|  43.8k|    }
  640|       |
  641|       |    // 3 Bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> val < 2^21. The longest
  642|       |    // a legitimate varint can be: values are (ll - MASK) or (ml - MASK), always
  643|       |    // strictly below block_size_max = 2^21.
  644|    197|    if (LIKELY(b0 < 0xE0)) {
  ------------------
  |  |  148|    197|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 197, False: 0]
  |  |  ------------------
  ------------------
  645|    197|        if (UNLIKELY(p + 2 >= end)) {
  ------------------
  |  |  154|    197|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 197]
  |  |  ------------------
  ------------------
  646|      0|            *ptr = end;
  647|      0|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|      0|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|      0|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  648|      0|        }
  649|    197|        *ptr = p + 3;
  650|    197|        return (b0 & 0x1F) | ((uint32_t)p[1] << 5) | ((uint32_t)p[2] << 13);
  651|    197|    }
  652|       |
  653|       |    // extra encoding: out-of-spec for the current format, reject.
  654|      0|    *ptr = end;
  655|      0|    return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|      0|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|      0|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|    197|}
zxc_compress.c:zxc_ss_prem_rle_q8:
  917|  83.9k|static inline int zxc_ss_prem_rle_q8(const int level) {
  918|  83.9k|    return (level >= ZXC_LEVEL_DENSITY) ? 1 : (256 >> ZXC_RLE_MARGIN_SHIFT);
  ------------------
  |  |  844|  83.9k|#define ZXC_RLE_MARGIN_SHIFT 5
  ------------------
  |  Branch (918:12): [True: 0, False: 83.9k]
  ------------------
  919|  83.9k|}
zxc_compress.c:zxc_store_le32:
 1456|   112k|static ZXC_ALWAYS_INLINE void zxc_store_le32(void* p, const uint32_t v) {
 1457|       |#ifdef ZXC_BIG_ENDIAN
 1458|       |    const uint32_t s = ZXC_BSWAP32(v);
 1459|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1460|       |#else
 1461|   112k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|   112k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1462|   112k|#endif
 1463|   112k|}
zxc_compress.c:zxc_checksum:
 1672|   112k|                                               const uint64_t seed, const uint8_t hash_method) {
 1673|   112k|    (void)hash_method; /* single algorithm for now; extend when adding more */
 1674|   112k|    const uint64_t hash = rapidhash_withSeed(input, len, seed);
 1675|       |
 1676|       |    return (uint32_t)(hash ^ (hash >> (sizeof(uint32_t) * CHAR_BIT)));
 1677|   112k|}
zxc_decompress.c:zxc_le32:
 1356|  15.1M|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|  15.1M|    uint32_t v;
 1358|  15.1M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  15.1M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|  15.1M|    return v;
 1363|  15.1M|#endif
 1364|  15.1M|}
zxc_decompress.c:zxc_copy32:
 1558|  92.7M|static ZXC_ALWAYS_INLINE void zxc_copy32(void* dst, const void* src) {
 1559|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
 1560|       |    // AVX2/AVX512: Single 256-bit (32 byte) unaligned load/store
 1561|       |    _mm256_storeu_si256((__m256i*)dst, _mm256_loadu_si256((const __m256i*)src));
 1562|       |#elif defined(ZXC_USE_SSE2)
 1563|       |    const __m128i a = _mm_loadu_si128((const __m128i*)src);
 1564|  92.7M|    const __m128i b = _mm_loadu_si128((const __m128i*)((const uint8_t*)src + 16));
 1565|  92.7M|    _mm_storeu_si128((__m128i*)dst, a);
 1566|  92.7M|    _mm_storeu_si128((__m128i*)((uint8_t*)dst + 16), b);
 1567|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1568|       |    const uint8x16_t a = vld1q_u8((const uint8_t*)src);
 1569|       |    const uint8x16_t b = vld1q_u8((const uint8_t*)src + 16);
 1570|       |    vst1q_u8((uint8_t*)dst, a);
 1571|       |    vst1q_u8((uint8_t*)dst + 16, b);
 1572|       |#else
 1573|       |    ZXC_MEMCPY(dst, src, 32);
 1574|       |#endif
 1575|  92.7M|}
zxc_decompress.c:zxc_le64:
 1419|  3.77M|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|  3.77M|    uint64_t v;
 1421|  3.77M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  3.77M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|  3.77M|    return v;
 1426|  3.77M|#endif
 1427|  3.77M|}
zxc_decompress.c:zxc_read_varint:
  619|  5.84M|static ZXC_ALWAYS_INLINE uint32_t zxc_read_varint(const uint8_t** ptr, const uint8_t* end) {
  620|  5.84M|    const uint8_t* p = *ptr;
  621|  5.84M|    if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  154|  5.84M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 40, False: 5.84M]
  |  |  ------------------
  ------------------
                  if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|     40|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|     40|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|     40|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  622|       |
  623|  5.84M|    const uint32_t b0 = p[0];
  624|       |
  625|       |    // 1 Byte: 0xxxxxxx (7 bits) -> val < 128 (2^7)
  626|  5.84M|    if (LIKELY(b0 < 0x80)) {
  ------------------
  |  |  148|  5.84M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 4.46M, False: 1.37M]
  |  |  ------------------
  ------------------
  627|  4.46M|        *ptr = p + 1;
  628|  4.46M|        return b0;
  629|  4.46M|    }
  630|       |
  631|       |    // 2 Bytes: 10xxxxxx xxxxxxxx (14 bits) -> val < 16384 (2^14)
  632|  1.38M|    if (LIKELY(b0 < 0xC0)) {
  ------------------
  |  |  148|  1.37M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 1.38M, False: 18.4E]
  |  |  ------------------
  ------------------
  633|  1.38M|        if (UNLIKELY(p + 1 >= end)) {
  ------------------
  |  |  154|  1.38M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 1.38M]
  |  |  ------------------
  ------------------
  634|      0|            *ptr = end;
  635|      0|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|      0|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|      0|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      0|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|      0|        }
  637|  1.38M|        *ptr = p + 2;
  638|  1.38M|        return (b0 & 0x3F) | ((uint32_t)p[1] << 6);
  639|  1.38M|    }
  640|       |
  641|       |    // 3 Bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> val < 2^21. The longest
  642|       |    // a legitimate varint can be: values are (ll - MASK) or (ml - MASK), always
  643|       |    // strictly below block_size_max = 2^21.
  644|  18.4E|    if (LIKELY(b0 < 0xE0)) {
  ------------------
  |  |  148|  18.4E|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 13.0k, False: 18.4E]
  |  |  ------------------
  ------------------
  645|  13.0k|        if (UNLIKELY(p + 2 >= end)) {
  ------------------
  |  |  154|  13.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2, False: 13.0k]
  |  |  ------------------
  ------------------
  646|      2|            *ptr = end;
  647|      2|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|      2|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|      2|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|      2|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  648|      2|        }
  649|  13.0k|        *ptr = p + 3;
  650|  13.0k|        return (b0 & 0x1F) | ((uint32_t)p[1] << 5) | ((uint32_t)p[2] << 13);
  651|  13.0k|    }
  652|       |
  653|       |    // extra encoding: out-of-spec for the current format, reject.
  654|  18.4E|    *ptr = end;
  655|  18.4E|    return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|  18.4E|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|  18.4E|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  18.4E|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|  18.4E|}
zxc_decompress.c:zxc_copy16:
 1539|  25.8M|static ZXC_ALWAYS_INLINE void zxc_copy16(void* dst, const void* src) {
 1540|  25.8M|#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512) || defined(ZXC_USE_SSE2)
 1541|       |    // x86 SSE2/AVX2/AVX512: Single 128-bit unaligned load/store
 1542|  25.8M|    _mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src));
 1543|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1544|       |    vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));
 1545|       |#else
 1546|       |    ZXC_MEMCPY(dst, src, 16);
 1547|       |#endif
 1548|  25.8M|}
zxc_decompress.c:zxc_le16:
 1337|  3.23M|static ZXC_ALWAYS_INLINE uint16_t zxc_le16(const void* p) {
 1338|  3.23M|    uint16_t v;
 1339|  3.23M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  3.23M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1340|       |#ifdef ZXC_BIG_ENDIAN
 1341|       |    return ZXC_BSWAP16(v);
 1342|       |#else
 1343|  3.23M|    return v;
 1344|  3.23M|#endif
 1345|  3.23M|}
zxc_dispatch.c:zxc_le32:
 1356|   261k|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|   261k|    uint32_t v;
 1358|   261k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|   261k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|   261k|    return v;
 1363|   261k|#endif
 1364|   261k|}
zxc_dispatch.c:zxc_validate_block_size:
 1150|  5.41k|static ZXC_ALWAYS_INLINE int zxc_validate_block_size(const size_t bs) {
 1151|  5.41k|    return bs >= ZXC_BLOCK_SIZE_MIN && bs <= ZXC_BLOCK_SIZE_MAX && (bs & (bs - 1)) == 0;
  ------------------
  |  |   73|  10.8k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  5.41k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
                  return bs >= ZXC_BLOCK_SIZE_MIN && bs <= ZXC_BLOCK_SIZE_MAX && (bs & (bs - 1)) == 0;
  ------------------
  |  |   75|  10.8k|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  ------------------
  |  |  |  |   69|  5.41k|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  ------------------
  ------------------
  |  Branch (1151:12): [True: 5.41k, False: 0]
  |  Branch (1151:40): [True: 5.41k, False: 0]
  |  Branch (1151:68): [True: 5.41k, False: 0]
  ------------------
 1152|  5.41k|}
zxc_dispatch.c:zxc_digest_combine:
 1692|   112k|                                                     const uint32_t block_checksum) {
 1693|   112k|    const uint64_t a = acc ^ ((uint64_t)block_checksum + 1U) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  749|   112k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1694|   112k|    const uint64_t b = ZXC_HASH_XORSHIFT64;
  ------------------
  |  |  751|   112k|#define ZXC_HASH_XORSHIFT64 0x2545F4914F6CDD1DULL
  ------------------
 1695|   112k|#if defined(__SIZEOF_INT128__)
 1696|   112k|    const __uint128_t r = (__uint128_t)a * b;
 1697|   112k|    return (uint64_t)r ^ (uint64_t)(r >> 64);
 1698|       |#else
 1699|       |    const uint64_t alo = (uint32_t)a, ahi = a >> 32, blo = (uint32_t)b, bhi = b >> 32;
 1700|       |    const uint64_t lolo = alo * blo, lohi = alo * bhi, hilo = ahi * blo, hihi = ahi * bhi;
 1701|       |    const uint64_t cross = (lolo >> 32) + (uint32_t)lohi + (uint32_t)hilo;
 1702|       |    const uint64_t hi = hihi + (lohi >> 32) + (hilo >> 32) + (cross >> 32);
 1703|       |    const uint64_t lo = (cross << 32) | (uint32_t)lolo;
 1704|       |    return lo ^ hi;
 1705|       |#endif
 1706|   112k|}
zxc_dispatch.c:zxc_store_le64:
 1474|  12.2k|static ZXC_ALWAYS_INLINE void zxc_store_le64(void* p, const uint64_t v) {
 1475|       |#ifdef ZXC_BIG_ENDIAN
 1476|       |    const uint64_t s = ZXC_BSWAP64(v);
 1477|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1478|       |#else
 1479|  12.2k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  12.2k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1480|  12.2k|#endif
 1481|  12.2k|}
zxc_dispatch.c:zxc_store_le32:
 1456|   148k|static ZXC_ALWAYS_INLINE void zxc_store_le32(void* p, const uint32_t v) {
 1457|       |#ifdef ZXC_BIG_ENDIAN
 1458|       |    const uint32_t s = ZXC_BSWAP32(v);
 1459|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1460|       |#else
 1461|   148k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|   148k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1462|   148k|#endif
 1463|   148k|}
zxc_seekable.c:zxc_seek_block_count:
 1640|  21.3k|                                                       const size_t block_size) {
 1641|       |    // A shift, block_size being a header power of two: no 64-bit division on 32-bit
 1642|       |    // hosts. Not (total + bs - 1) >> s, which wraps near 2^64 on a forged footer.
 1643|  21.3k|    if (UNLIKELY(!block_size)) return 0;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
 1644|  21.3k|    const int s = zxc_ctz32((uint32_t)block_size);
 1645|  21.3k|    return (total_decomp >> s) + ((total_decomp & (block_size - 1)) != 0);
 1646|  21.3k|}
zxc_seekable.c:zxc_ctz32:
 1586|   123k|static ZXC_ALWAYS_INLINE int zxc_ctz32(const uint32_t x) {
 1587|   123k|    if (x == 0) return 32;
  ------------------
  |  Branch (1587:9): [True: 0, False: 123k]
  ------------------
 1588|   123k|#if defined(__GNUC__) || defined(__clang__)
 1589|   123k|    return __builtin_ctz(x);
 1590|       |#elif defined(_MSC_VER)
 1591|       |    unsigned long r;
 1592|       |    _BitScanForward(&r, x);
 1593|       |    return (int)r;
 1594|       |#else
 1595|       |    // Fallback De Bruijn (32 bits)
 1596|       |    static const int DeBruijn32[32] = {0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20,
 1597|       |                                       15, 25, 17, 4,  8,  31, 27, 13, 23, 21, 19,
 1598|       |                                       16, 7,  26, 12, 18, 6,  11, 5,  10, 9};
 1599|       |    return DeBruijn32[((uint32_t)((x & (0U - x)) * 0x077CB531U)) >> 27];
 1600|       |#endif
 1601|   123k|}
zxc_seekable.c:zxc_seek_table_bytes:
  483|  21.3k|static ZXC_ALWAYS_INLINE uint64_t zxc_seek_table_bytes(const uint64_t nblocks) {
  484|  21.3k|    return zxc_seek_group_count(nblocks) * ZXC_SEEK_ANCHOR_SIZE + nblocks * ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  465|  21.3k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  ------------------
                  return zxc_seek_group_count(nblocks) * ZXC_SEEK_ANCHOR_SIZE + nblocks * ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  467|  21.3k|#define ZXC_SEEK_SIZE_ENTRY 4U
  ------------------
  485|  21.3k|}
zxc_seekable.c:zxc_seek_group_count:
  472|   364k|static ZXC_ALWAYS_INLINE uint64_t zxc_seek_group_count(const uint64_t nblocks) {
  473|   364k|    return (nblocks + ZXC_SEEK_GROUP - 1) / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   364k|#define ZXC_SEEK_GROUP 64U
  ------------------
                  return (nblocks + ZXC_SEEK_GROUP - 1) / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   364k|#define ZXC_SEEK_GROUP 64U
  ------------------
  474|   364k|}
zxc_seekable.c:zxc_seek_group_len:
  477|   690k|static ZXC_ALWAYS_INLINE uint32_t zxc_seek_group_len(const uint64_t nblocks, const uint64_t g) {
  478|   690k|    const uint64_t left = nblocks - g * ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   690k|#define ZXC_SEEK_GROUP 64U
  ------------------
  479|   690k|    return left < ZXC_SEEK_GROUP ? (uint32_t)left : ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   690k|#define ZXC_SEEK_GROUP 64U
  ------------------
                  return left < ZXC_SEEK_GROUP ? (uint32_t)left : ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   449k|#define ZXC_SEEK_GROUP 64U
  ------------------
  |  Branch (479:12): [True: 241k, False: 449k]
  ------------------
  480|   690k|}
zxc_seekable.c:zxc_le64:
 1419|   345k|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|   345k|    uint64_t v;
 1421|   345k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|   345k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|   345k|    return v;
 1426|   345k|#endif
 1427|   345k|}
zxc_seekable.c:zxc_le32:
 1356|  16.2M|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|  16.2M|    uint32_t v;
 1358|  16.2M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  16.2M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|  16.2M|    return v;
 1363|  16.2M|#endif
 1364|  16.2M|}

zxc_seekable_open:
  409|  32.0k|zxc_seekable* zxc_seekable_open(const void* src, const size_t src_size) {
  410|  32.0k|    if (UNLIKELY(!src || src_size == 0)) return NULL;
  ------------------
  |  |  154|  64.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 32.0k]
  |  |  |  Branch (154:42): [True: 0, False: 32.0k]
  |  |  |  Branch (154:42): [True: 0, False: 32.0k]
  |  |  ------------------
  ------------------
  411|  32.0k|    const zxc_seek_source_t source = {(const uint8_t*)src, NULL, (uint64_t)src_size};
  412|  32.0k|    return zxc_seekable_parse(&source);
  413|  32.0k|}
zxc_seekable_get_num_blocks:
  435|  21.3k|uint64_t zxc_seekable_get_num_blocks(const zxc_seekable* s) { return s ? s->num_blocks : 0; }
  ------------------
  |  Branch (435:70): [True: 10.6k, False: 10.6k]
  ------------------
zxc_seekable_get_decompressed_size:
  440|  21.3k|uint64_t zxc_seekable_get_decompressed_size(const zxc_seekable* s) {
  441|  21.3k|    return s ? s->total_decomp : 0;
  ------------------
  |  Branch (441:12): [True: 10.6k, False: 10.6k]
  ------------------
  442|  21.3k|}
zxc_seekable_get_block_comp_size:
  447|   308k|uint32_t zxc_seekable_get_block_comp_size(const zxc_seekable* s, const uint64_t block_idx) {
  448|   308k|    if (UNLIKELY(!s || block_idx >= s->num_blocks)) return 0;
  ------------------
  |  |  154|   616k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.6k, False: 297k]
  |  |  |  Branch (154:42): [True: 0, False: 308k]
  |  |  |  Branch (154:42): [True: 10.6k, False: 297k]
  |  |  ------------------
  ------------------
  449|   297k|    const zxc_seek_frame_t* const f = zxc_seek_frame_of_block(s, block_idx);
  450|   297k|    uint64_t start = 0;
  451|   297k|    uint32_t size = 0;
  452|   297k|    uint8_t raw[ZXC_SEEK_TAIL_HDRS + ZXC_SEEK_GROUP_BYTES];
  453|   297k|    if (UNLIKELY(zxc_seek_load_spans(s, f, block_idx - f->block_base, 1, &start, &size, raw) !=
  ------------------
  |  |  154|   297k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 297k]
  |  |  ------------------
  ------------------
  454|   297k|                 ZXC_OK))
  455|      0|        return 0;
  456|   297k|    return size;
  457|   297k|}
zxc_seekable_get_block_decomp_size:
  478|   159k|uint32_t zxc_seekable_get_block_decomp_size(const zxc_seekable* s, const uint64_t block_idx) {
  479|   159k|    if (UNLIKELY(!s || block_idx >= s->num_blocks)) return 0;
  ------------------
  |  |  154|   318k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.6k, False: 148k]
  |  |  |  Branch (154:42): [True: 0, False: 159k]
  |  |  |  Branch (154:42): [True: 10.6k, False: 148k]
  |  |  ------------------
  ------------------
  480|   148k|    const zxc_seek_frame_t* const f = zxc_seek_frame_of_block(s, block_idx);
  481|   148k|    return zxc_seek_decomp_size(f->block_size, f->total_decomp, block_idx - f->block_base);
  482|   159k|}
zxc_seekable_decompress_range:
  572|  59.5k|                                      const uint64_t offset, const size_t len) {
  573|  59.5k|    if (UNLIKELY(len == 0)) return 0;
  ------------------
  |  |  154|  59.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.6k, False: 48.8k]
  |  |  ------------------
  ------------------
  574|  48.8k|    if (UNLIKELY(!s || !dst)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  97.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 48.8k]
  |  |  |  Branch (154:42): [True: 0, False: 48.8k]
  |  |  |  Branch (154:42): [True: 0, False: 48.8k]
  |  |  ------------------
  ------------------
  575|  48.8k|    if (UNLIKELY(dst_capacity < len)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  48.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 48.8k]
  |  |  ------------------
  ------------------
  576|  48.8k|    if (UNLIKELY(offset > s->total_decomp || len > s->total_decomp - offset))
  ------------------
  |  |  154|  97.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.6k, False: 38.2k]
  |  |  |  Branch (154:42): [True: 0, False: 48.8k]
  |  |  |  Branch (154:42): [True: 10.6k, False: 38.2k]
  |  |  ------------------
  ------------------
  577|  10.6k|        return ZXC_ERROR_SRC_TOO_SMALL;
  578|       |
  579|       |    // Initialize decompression context on first use.
  580|  38.2k|    if (!s->dctx_initialized) {
  ------------------
  |  Branch (580:9): [True: 21.3k, False: 16.8k]
  ------------------
  581|  21.3k|        if (UNLIKELY(zxc_cctx_init(&s->dctx, (size_t)s->max_block_size, 0, 0, 0,
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  582|  21.3k|                                   s->max_dict_size) != ZXC_OK))
  583|      0|            return ZXC_ERROR_MEMORY;  // LCOV_EXCL_LINE
  584|  21.3k|        s->dctx_initialized = 1;
  585|  21.3k|        s->dctx_dict = NULL;
  586|  21.3k|    }
  587|       |
  588|  38.2k|    const uint64_t blk_start = zxc_seek_block_of_offset(s, offset);
  589|  38.2k|    const uint64_t blk_end = zxc_seek_block_of_offset(s, offset + len - 1);
  590|  38.2k|    const zxc_seek_frame_t* f = zxc_seek_frame_of_block(s, blk_start);
  591|       |
  592|  38.2k|    uint8_t* out = (uint8_t*)dst;
  593|  38.2k|    size_t remaining = len;
  594|       |
  595|       |    // One slice, and one read, per table group of a frame.
  596|  38.2k|    uint64_t starts[ZXC_SEEK_GROUP] = {0};
  597|  38.2k|    uint32_t sizes[ZXC_SEEK_GROUP] = {0};
  598|  38.2k|    uint8_t raw[ZXC_SEEK_TAIL_HDRS + ZXC_SEEK_GROUP_BYTES];
  599|  38.2k|    uint64_t bi = blk_start;
  600|  72.1k|    while (bi <= blk_end) {
  ------------------
  |  Branch (600:12): [True: 40.9k, False: 31.2k]
  ------------------
  601|  40.9k|        while (bi >= f->block_base + f->num_blocks) f++;  // past this frame, empty ones too
  ------------------
  |  Branch (601:16): [True: 0, False: 40.9k]
  ------------------
  602|  40.9k|        const uint64_t local = bi - f->block_base;
  603|  40.9k|        const uint64_t left = blk_end - bi + 1;
  604|  40.9k|        const uint64_t in_frame = f->num_blocks - local;
  605|  40.9k|        const uint32_t to_group_end = ZXC_SEEK_GROUP - (uint32_t)(local % ZXC_SEEK_GROUP);
  ------------------
  |  |  463|  40.9k|#define ZXC_SEEK_GROUP 64U
  ------------------
                      const uint32_t to_group_end = ZXC_SEEK_GROUP - (uint32_t)(local % ZXC_SEEK_GROUP);
  ------------------
  |  |  463|  40.9k|#define ZXC_SEEK_GROUP 64U
  ------------------
  606|  40.9k|        uint32_t n = left < to_group_end ? (uint32_t)left : to_group_end;
  ------------------
  |  Branch (606:22): [True: 37.8k, False: 3.06k]
  ------------------
  607|  40.9k|        if (in_frame < n) n = (uint32_t)in_frame;
  ------------------
  |  Branch (607:13): [True: 0, False: 40.9k]
  ------------------
  608|  40.9k|        const int span_res = zxc_seek_load_spans(s, f, local, n, starts, sizes, raw);
  609|  40.9k|        if (UNLIKELY(span_res < 0)) return span_res;
  ------------------
  |  |  154|  40.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 40.9k]
  |  |  ------------------
  ------------------
  610|       |
  611|       |        // A reader's block scratch, sized to the slice's largest block, not entry_max.
  612|  40.9k|        if (!s->src) {
  ------------------
  |  Branch (612:13): [True: 0, False: 40.9k]
  ------------------
  613|      0|            uint64_t need = 0;
  614|      0|            for (uint32_t k = 0; k < n; k++)
  ------------------
  |  Branch (614:34): [True: 0, False: 0]
  ------------------
  615|      0|                if (sizes[k] > need) need = sizes[k];
  ------------------
  |  Branch (615:21): [True: 0, False: 0]
  ------------------
  616|      0|            need += ZXC_PAD_SIZE;
  ------------------
  |  |  331|      0|#define ZXC_PAD_SIZE 32
  ------------------
  617|      0|            if (s->read_buf_cap < need) {
  ------------------
  |  Branch (617:17): [True: 0, False: 0]
  ------------------
  618|      0|                uint8_t* const nb = (uint8_t*)ZXC_REALLOC(s->read_buf, (size_t)need);
  ------------------
  |  |   80|      0|#define ZXC_REALLOC(ptr, size) realloc(ptr, size)
  ------------------
  619|      0|                if (UNLIKELY(!nb)) return ZXC_ERROR_MEMORY;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  620|      0|                s->read_buf = nb;
  621|      0|                s->read_buf_cap = (size_t)need;
  622|      0|            }
  623|      0|        }
  624|       |
  625|       |        // The frame's geometry and dictionary: the context is sized for the largest.
  626|  40.9k|        const int dict_res = zxc_seek_use_dict(s, &s->dctx, &s->dctx_dict, f);
  627|  40.9k|        if (UNLIKELY(dict_res != ZXC_OK)) return dict_res;
  ------------------
  |  |  154|  40.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 40.9k]
  |  |  ------------------
  ------------------
  628|  40.9k|        s->dctx.chunk_size = f->block_size;
  629|  40.9k|        s->dctx.checksum_enabled = f->has_checksums && s->verify_checksums;
  ------------------
  |  Branch (629:36): [True: 21.6k, False: 19.2k]
  |  Branch (629:56): [True: 0, False: 21.6k]
  ------------------
  630|  40.9k|        const size_t work_sz = (size_t)f->block_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  361|  40.9k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  40.9k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  40.9k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  40.9k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  40.9k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  40.9k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  40.9k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|  40.9k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  631|       |
  632|   305k|        for (uint32_t k = 0; k < n; k++, bi++) {
  ------------------
  |  Branch (632:30): [True: 271k, False: 33.9k]
  ------------------
  633|   271k|            const uint64_t lb = local + k;  // position in the frame: the checksum seed
  634|   271k|            const uint8_t* blk = NULL;
  635|   271k|            const int read_res = zxc_seek_read_block(s, starts[k], sizes[k], f->has_checksums,
  636|   271k|                                                     s->read_buf, s->read_buf_cap, &blk);
  637|   271k|            if (UNLIKELY(read_res < 0)) return read_res;
  ------------------
  |  |  154|   271k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.96k, False: 267k]
  |  |  ------------------
  ------------------
  638|       |
  639|       |            // The wanted part of the block
  640|   267k|            const uint32_t dec_sz = zxc_seek_decomp_size(f->block_size, f->total_decomp, lb);
  641|   267k|            const uint64_t blk_decomp_start = f->decomp_base + lb * f->block_size;
  642|   267k|            const size_t skip =
  643|   267k|                (offset > blk_decomp_start) ? (size_t)(offset - blk_decomp_start) : 0;
  ------------------
  |  Branch (643:17): [True: 10.6k, False: 256k]
  ------------------
  644|   267k|            const size_t avail = (size_t)dec_sz - skip;
  645|   267k|            const size_t copy = (avail < remaining) ? avail : remaining;
  ------------------
  |  Branch (645:33): [True: 233k, False: 33.7k]
  ------------------
  646|       |
  647|       |            // A whole block decodes in place if the fast decoder's margin stays in
  648|       |            // the range (the next blocks overwrite it); otherwise aside, behind the
  649|       |            // dict prefix if any, then copied.
  650|   267k|            const int direct =
  651|   267k|                !s->dctx.dict_size && skip == 0 && remaining - copy >= ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  361|   256k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|   256k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|   256k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|   256k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   256k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   256k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   256k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|   256k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (651:17): [True: 267k, False: 0]
  |  Branch (651:39): [True: 256k, False: 10.6k]
  |  Branch (651:52): [True: 227k, False: 29.3k]
  ------------------
  652|   267k|            uint8_t* const aside =
  653|   267k|                s->dctx.dict_buffer ? s->dctx.dict_buffer + s->dctx.dict_size : s->dctx.work_buf;
  ------------------
  |  Branch (653:17): [True: 0, False: 267k]
  ------------------
  654|   267k|            uint8_t* const dec_dst = direct ? out : aside;
  ------------------
  |  Branch (654:38): [True: 227k, False: 39.9k]
  ------------------
  655|   267k|            const size_t dec_cap = direct ? (size_t)dec_sz + ZXC_DECOMPRESS_TAIL_PAD : work_sz;
  ------------------
  |  |  361|   227k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|   227k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|   227k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|   227k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   227k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   227k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   227k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|   227k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (655:36): [True: 227k, False: 39.9k]
  ------------------
  656|   267k|            const int dec_res =
  657|   267k|                zxc_decompress_chunk_wrapper(&s->dctx, blk, (size_t)read_res, dec_dst, dec_cap, lb);
  658|   267k|            if (UNLIKELY(dec_res < 0)) return zxc_seek_decode_error(dec_res);
  ------------------
  |  |  154|   267k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2.16k, False: 264k]
  |  |  ------------------
  ------------------
  659|   264k|            if (UNLIKELY((uint32_t)dec_res != dec_sz)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   264k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 791, False: 264k]
  |  |  ------------------
  ------------------
  660|       |
  661|   264k|            if (!direct) ZXC_MEMCPY(out, aside + skip, copy);
  ------------------
  |  |  170|  37.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  |  Branch (661:17): [True: 37.3k, False: 226k]
  ------------------
  662|   264k|            out += copy;
  663|   264k|            remaining -= copy;
  664|   264k|        }
  665|  40.9k|    }
  666|       |
  667|  31.2k|    if (UNLIKELY(remaining != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  31.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 31.2k]
  |  |  ------------------
  ------------------
  668|  31.2k|    return (int64_t)len;
  669|  31.2k|}
zxc_seekable_decompress_range_mt:
  832|  12.6k|                                         const uint64_t offset, const size_t len, int n_threads) {
  833|  12.6k|    if (UNLIKELY(len == 0)) return 0;
  ------------------
  |  |  154|  12.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 12.6k]
  |  |  ------------------
  ------------------
  834|  12.6k|    if (UNLIKELY(!s || !dst)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  25.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 12.6k]
  |  |  |  Branch (154:42): [True: 0, False: 12.6k]
  |  |  |  Branch (154:42): [True: 0, False: 12.6k]
  |  |  ------------------
  ------------------
  835|  12.6k|    if (UNLIKELY(dst_capacity < len)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  12.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 12.6k]
  |  |  ------------------
  ------------------
  836|  12.6k|    if (UNLIKELY(offset > s->total_decomp || len > s->total_decomp - offset))
  ------------------
  |  |  154|  25.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 12.6k]
  |  |  |  Branch (154:42): [True: 0, False: 12.6k]
  |  |  |  Branch (154:42): [True: 0, False: 12.6k]
  |  |  ------------------
  ------------------
  837|      0|        return ZXC_ERROR_SRC_TOO_SMALL;
  838|       |
  839|  12.6k|    const uint64_t blk_start = zxc_seek_block_of_offset(s, offset);
  840|  12.6k|    const uint64_t blk_end = zxc_seek_block_of_offset(s, offset + len - 1);
  841|  12.6k|    const uint64_t jobs_64 = blk_end - blk_start + 1;
  842|       |
  843|       |    // Auto-detect thread count (0 = use all available cores)
  844|  12.6k|    if (n_threads == 0) n_threads = zxc_num_procs();
  ------------------
  |  Branch (844:9): [True: 0, False: 12.6k]
  ------------------
  845|       |
  846|       |    // Fallback to single-threaded path for trivial cases, and for a range holding
  847|       |    // more blocks than one job table can index (4 G blocks is 16 TiB of dst).
  848|  12.6k|    if (n_threads <= 1 || jobs_64 <= 1 || jobs_64 > UINT32_MAX) {
  ------------------
  |  Branch (848:9): [True: 0, False: 12.6k]
  |  Branch (848:27): [True: 8.23k, False: 4.43k]
  |  Branch (848:43): [True: 0, False: 4.43k]
  ------------------
  849|  8.23k|        return zxc_seekable_decompress_range(s, dst, dst_capacity, offset, len);
  850|  8.23k|    }
  851|  4.43k|    const uint32_t num_jobs = (uint32_t)jobs_64;
  852|       |
  853|       |    // About ZXC_MT_BATCH_BYTES of output per batch, less if that would idle
  854|       |    // threads; no more threads than batches (two or more: batch <= ceil(jobs/2)).
  855|  4.43k|    if (n_threads > ZXC_MAX_THREADS) n_threads = ZXC_MAX_THREADS;
  ------------------
  |  |  107|  4.43k|#define ZXC_MAX_THREADS 512
  ------------------
                  if (n_threads > ZXC_MAX_THREADS) n_threads = ZXC_MAX_THREADS;
  ------------------
  |  |  107|      0|#define ZXC_MAX_THREADS 512
  ------------------
  |  Branch (855:9): [True: 0, False: 4.43k]
  ------------------
  856|  4.43k|    const uint32_t share = (num_jobs - 1) / (uint32_t)n_threads + 1;
  857|  4.43k|    uint32_t batch = s->max_block_size < ZXC_MT_BATCH_BYTES
  ------------------
  |  |  367|  4.43k|#define ZXC_MT_BATCH_BYTES ((size_t)256 * 1024)
  ------------------
  |  Branch (857:22): [True: 3.60k, False: 826]
  ------------------
  858|  4.43k|                         ? (uint32_t)(ZXC_MT_BATCH_BYTES / s->max_block_size)
  ------------------
  |  |  367|  3.60k|#define ZXC_MT_BATCH_BYTES ((size_t)256 * 1024)
  ------------------
  859|  4.43k|                         : 1;
  860|  4.43k|    if (batch > share) batch = share;
  ------------------
  |  Branch (860:9): [True: 3.08k, False: 1.35k]
  ------------------
  861|  4.43k|    if (UNLIKELY(batch == 0)) batch = 1;
  ------------------
  |  |  154|  4.43k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 4.43k]
  |  |  ------------------
  ------------------
  862|  4.43k|    const uint32_t num_batches = num_jobs / batch + (num_jobs % batch != 0);
  863|  4.43k|    if ((uint32_t)n_threads > num_batches) n_threads = (int)num_batches;
  ------------------
  |  Branch (863:9): [True: 692, False: 3.74k]
  ------------------
  864|       |
  865|  4.43k|    zxc_seek_mt_job_t* const jobs =
  866|  4.43k|        (zxc_seek_mt_job_t*)ZXC_CALLOC(num_jobs, sizeof(zxc_seek_mt_job_t));
  ------------------
  |  |   74|  4.43k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
  867|  4.43k|    uint64_t* const starts = (uint64_t*)ZXC_CALLOC(num_jobs, sizeof(uint64_t));
  ------------------
  |  |   74|  4.43k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
  868|  4.43k|    uint32_t* const sizes = (uint32_t*)ZXC_CALLOC(num_jobs, sizeof(uint32_t));
  ------------------
  |  |   74|  4.43k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
  869|  4.43k|    if (UNLIKELY(!jobs || !starts || !sizes)) {
  ------------------
  |  |  154|  17.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 4.43k]
  |  |  |  Branch (154:42): [True: 0, False: 4.43k]
  |  |  |  Branch (154:42): [True: 0, False: 4.43k]
  |  |  |  Branch (154:42): [True: 0, False: 4.43k]
  |  |  ------------------
  ------------------
  870|       |        // LCOV_EXCL_START
  871|      0|        ZXC_FREE(jobs);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  872|      0|        ZXC_FREE(starts);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  873|      0|        ZXC_FREE(sizes);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  874|      0|        return ZXC_ERROR_MEMORY;
  875|       |        // LCOV_EXCL_STOP
  876|      0|    }
  877|       |
  878|       |    // Plan jobs frame by frame, each frame's table groups in one read.
  879|  4.43k|    const zxc_seek_frame_t* f = zxc_seek_frame_of_block(s, blk_start);
  880|  4.43k|    size_t out_off = 0;
  881|  4.43k|    size_t remaining = len;
  882|  4.43k|    uint32_t max_csz = 0;
  883|  4.43k|    int plan_res = ZXC_OK;
  884|  8.86k|    for (uint32_t i = 0; i < num_jobs && plan_res == ZXC_OK;) {
  ------------------
  |  Branch (884:26): [True: 4.43k, False: 4.43k]
  |  Branch (884:42): [True: 4.43k, False: 0]
  ------------------
  885|  4.43k|        const uint64_t bi = blk_start + i;
  886|  4.43k|        while (bi >= f->block_base + f->num_blocks) f++;  // past this frame, empty ones too
  ------------------
  |  Branch (886:16): [True: 0, False: 4.43k]
  ------------------
  887|  4.43k|        const uint64_t local = bi - f->block_base;
  888|  4.43k|        const uint64_t in_frame = f->num_blocks - local;
  889|  4.43k|        const uint32_t n = in_frame < num_jobs - i ? (uint32_t)in_frame : num_jobs - i;
  ------------------
  |  Branch (889:28): [True: 0, False: 4.43k]
  ------------------
  890|  4.43k|        uint8_t* const raw = (uint8_t*)ZXC_MALLOC(zxc_seek_spans_raw_max(local, n));
  ------------------
  |  |   68|  4.43k|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  891|  4.43k|        plan_res = raw ? zxc_seek_load_spans(s, f, local, n, starts + i, sizes + i, raw)
  ------------------
  |  Branch (891:20): [True: 4.43k, False: 0]
  ------------------
  892|  4.43k|                       : ZXC_ERROR_MEMORY;  // LCOV_EXCL_LINE
  893|  4.43k|        ZXC_FREE(raw);
  ------------------
  |  |   86|  4.43k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  894|   235k|        for (uint32_t k = 0; k < n && plan_res == ZXC_OK; k++, i++) {
  ------------------
  |  Branch (894:30): [True: 231k, False: 4.43k]
  |  Branch (894:39): [True: 231k, False: 0]
  ------------------
  895|   231k|            const uint64_t lb = local + k;
  896|   231k|            const uint64_t blk_decomp_start = f->decomp_base + lb * f->block_size;
  897|   231k|            const size_t skip =
  898|   231k|                (offset > blk_decomp_start) ? (size_t)(offset - blk_decomp_start) : 0;
  ------------------
  |  Branch (898:17): [True: 0, False: 231k]
  ------------------
  899|   231k|            const uint32_t blk_decomp_sz = zxc_seek_decomp_size(f->block_size, f->total_decomp, lb);
  900|   231k|            const size_t avail = blk_decomp_sz - skip;
  901|   231k|            const size_t copy = (avail < remaining) ? avail : remaining;
  ------------------
  |  Branch (901:33): [True: 226k, False: 4.43k]
  ------------------
  902|       |
  903|   231k|            jobs[i].block_idx = lb;
  904|   231k|            jobs[i].off = starts[i];
  905|   231k|            jobs[i].csz = sizes[i];
  906|   231k|            jobs[i].block_size = f->block_size;
  907|   231k|            jobs[i].frame = f;
  908|   231k|            jobs[i].decomp_sz = blk_decomp_sz;
  909|   231k|            jobs[i].has_cs = f->has_checksums;
  910|   231k|            jobs[i].dst_off = out_off;
  911|   231k|            jobs[i].skip = skip;
  912|   231k|            jobs[i].copy_len = copy;
  913|       |            // Negative until done: a job nobody took reports itself.
  914|   231k|            jobs[i].result = ZXC_ERROR_MEMORY;
  915|   231k|            if (sizes[i] > max_csz) max_csz = sizes[i];
  ------------------
  |  Branch (915:17): [True: 10.4k, False: 220k]
  ------------------
  916|       |
  917|   231k|            out_off += copy;
  918|   231k|            remaining -= copy;
  919|   231k|        }
  920|  4.43k|    }
  921|  4.43k|    ZXC_FREE(starts);
  ------------------
  |  |   86|  4.43k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  922|  4.43k|    ZXC_FREE(sizes);
  ------------------
  |  |   86|  4.43k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  923|  4.43k|    if (UNLIKELY(plan_res != ZXC_OK)) {
  ------------------
  |  |  154|  4.43k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 4.43k]
  |  |  ------------------
  ------------------
  924|      0|        ZXC_FREE(jobs);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  925|      0|        return plan_res;
  926|      0|    }
  927|       |
  928|       |    // Launch one persistent worker per thread
  929|  4.43k|    pthread_t* const threads = (pthread_t*)ZXC_MALLOC((size_t)n_threads * sizeof(pthread_t));
  ------------------
  |  |   68|  4.43k|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  930|  4.43k|    if (UNLIKELY(!threads)) {
  ------------------
  |  |  154|  4.43k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 4.43k]
  |  |  ------------------
  ------------------
  931|       |        // LCOV_EXCL_START
  932|      0|        ZXC_FREE(jobs);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  933|      0|        return ZXC_ERROR_MEMORY;
  934|       |        // LCOV_EXCL_STOP
  935|      0|    }
  936|       |
  937|  4.43k|    zxc_seek_mt_shared_t sh;
  938|  4.43k|    sh.s = s;
  939|  4.43k|    sh.jobs = jobs;
  940|  4.43k|    sh.dst_base = (uint8_t*)dst;
  941|  4.43k|    sh.num_jobs = num_jobs;
  942|  4.43k|    sh.batch = batch;
  943|  4.43k|    sh.max_csz = max_csz;
  944|  4.43k|    sh.next = 0;
  945|  4.43k|    sh.failed = 0;
  946|  4.43k|    pthread_mutex_init(&sh.lock, NULL);
  947|       |
  948|  4.43k|    int launched = 0;
  949|  17.5k|    for (int t = 0; t < n_threads; t++) {
  ------------------
  |  Branch (949:21): [True: 13.1k, False: 4.43k]
  ------------------
  950|       |        // A failed start leaves its jobs to the others; with none, all stay negative.
  951|  13.1k|        if (UNLIKELY(pthread_create(&threads[launched], NULL, zxc_seek_mt_worker, &sh) != 0))
  ------------------
  |  |  154|  13.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 13.1k]
  |  |  ------------------
  ------------------
  952|      0|            continue;  // LCOV_EXCL_LINE
  953|  13.1k|        launched++;
  954|  13.1k|    }
  955|       |
  956|       |    // Join phase
  957|  17.5k|    for (int t = 0; t < launched; t++) pthread_join(threads[t], NULL);
  ------------------
  |  Branch (957:21): [True: 13.1k, False: 4.43k]
  ------------------
  958|       |
  959|  4.43k|    pthread_mutex_destroy(&sh.lock);
  960|  4.43k|    ZXC_FREE(threads);
  ------------------
  |  |   86|  4.43k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  961|       |
  962|       |    // Report the first error in job order, if any.
  963|  4.43k|    int64_t result = (int64_t)len;
  964|   211k|    for (uint32_t i = 0; i < num_jobs; i++) {
  ------------------
  |  Branch (964:26): [True: 207k, False: 3.66k]
  ------------------
  965|   207k|        if (jobs[i].result < 0) {
  ------------------
  |  Branch (965:13): [True: 767, False: 206k]
  ------------------
  966|    767|            result = (int64_t)jobs[i].result;
  967|    767|            break;
  968|    767|        }
  969|   207k|    }
  970|       |
  971|  4.43k|    ZXC_FREE(jobs);
  ------------------
  |  |   86|  4.43k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  972|  4.43k|    return result;
  973|  4.43k|}
zxc_seekable_free:
  981|  21.3k|void zxc_seekable_free(zxc_seekable* s) {
  982|  21.3k|    if (UNLIKELY(!s)) return;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  983|  21.3k|    if (s->dctx_initialized) zxc_cctx_free(&s->dctx);
  ------------------
  |  Branch (983:9): [True: 21.3k, False: 0]
  ------------------
  984|  21.3k|    ZXC_FREE(s->frames);
  ------------------
  |  |   86|  21.3k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  985|  21.3k|    for (size_t i = 0; i < s->num_dicts; i++) ZXC_FREE(s->dicts[i].data);
  ------------------
  |  |   86|  21.3k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  |  Branch (985:24): [True: 0, False: 21.3k]
  ------------------
  986|  21.3k|    ZXC_FREE(s->dicts);
  ------------------
  |  |   86|  21.3k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  987|  21.3k|    ZXC_FREE(s->read_buf);
  ------------------
  |  |   86|  21.3k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  988|  21.3k|    ZXC_FREE(s->owned_reader_ctx);
  ------------------
  |  |   86|  21.3k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  989|  21.3k|    ZXC_FREE(s);
  ------------------
  |  |   86|  21.3k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  990|  21.3k|}
zxc_seekable.c:zxc_seekable_parse:
  224|  32.0k|static zxc_seekable* zxc_seekable_parse(const zxc_seek_source_t* source) {
  225|  32.0k|    zxc_seek_source_t src = *source;
  226|  32.0k|    zxc_seek_frame_t* frames = NULL;
  227|  32.0k|    size_t n = 0;
  228|  32.0k|    size_t cap = 0;
  229|  32.0k|    uint64_t end = src.size;
  230|  32.0k|    do {
  231|  32.0k|        if (UNLIKELY(n == ZXC_SEEK_MAX_FRAMES)) goto fail;
  ------------------
  |  |  154|  32.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 32.0k]
  |  |  ------------------
  ------------------
  232|  32.0k|        if (n == cap) {
  ------------------
  |  Branch (232:13): [True: 32.0k, False: 0]
  ------------------
  233|  32.0k|            cap = cap ? 2 * cap : 4;
  ------------------
  |  Branch (233:19): [True: 0, False: 32.0k]
  ------------------
  234|  32.0k|            zxc_seek_frame_t* const grown =
  235|  32.0k|                (zxc_seek_frame_t*)ZXC_REALLOC(frames, cap * sizeof(*frames));
  ------------------
  |  |   80|  32.0k|#define ZXC_REALLOC(ptr, size) realloc(ptr, size)
  ------------------
  236|  32.0k|            if (UNLIKELY(!grown)) goto fail;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  32.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 32.0k]
  |  |  ------------------
  ------------------
  237|  32.0k|            frames = grown;
  238|  32.0k|        }
  239|  32.0k|        if (UNLIKELY(!zxc_seek_parse_frame(&src, end, &frames[n]))) goto fail;
  ------------------
  |  |  154|  32.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.6k, False: 21.3k]
  |  |  ------------------
  ------------------
  240|       |        // The last frame's EOF/SEK headers (a plain archive's only frame) now: a
  241|       |        // lying seek flag fails the open.
  242|  21.3k|        if (n == 0) {
  ------------------
  |  Branch (242:13): [True: 21.3k, False: 0]
  ------------------
  243|  21.3k|            uint8_t hdrs[ZXC_SEEK_TAIL_HDRS];
  244|  21.3k|            const zxc_seek_frame_t* const f = &frames[0];
  245|  21.3k|            if (UNLIKELY(zxc_seek_source_read(&src, hdrs, sizeof(hdrs),
  ------------------
  |  |  154|  85.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  246|  21.3k|                                              f->table_off - ZXC_SEEK_TAIL_HDRS) != ZXC_OK ||
  247|  21.3k|                         zxc_check_eof_header(hdrs) != ZXC_OK ||
  248|  21.3k|                         zxc_check_seek_header(hdrs + ZXC_BLOCK_HEADER_SIZE, ZXC_BLOCK_HEADER_SIZE,
  249|  21.3k|                                               f->total_decomp, f->block_size, NULL) != ZXC_OK))
  250|      0|                goto fail;
  251|  21.3k|        }
  252|  21.3k|        end = frames[n++].base;
  253|  21.3k|    } while (end > 0);
  ------------------
  |  Branch (253:14): [True: 0, False: 21.3k]
  ------------------
  254|       |
  255|       |    // Walked back: archive order, then running bytes and blocks.
  256|  21.3k|    uint64_t decomp = 0;
  257|  21.3k|    uint64_t blocks = 0;
  258|  21.3k|    uint32_t max_block_size = 0;
  259|  21.3k|    for (size_t i = 0; i < n / 2; i++) {
  ------------------
  |  Branch (259:24): [True: 0, False: 21.3k]
  ------------------
  260|      0|        const zxc_seek_frame_t t = frames[i];
  261|      0|        frames[i] = frames[n - 1 - i];
  262|      0|        frames[n - 1 - i] = t;
  263|      0|    }
  264|  42.6k|    for (size_t i = 0; i < n; i++) {
  ------------------
  |  Branch (264:24): [True: 21.3k, False: 21.3k]
  ------------------
  265|  21.3k|        zxc_seek_frame_t* const f = &frames[i];
  266|  21.3k|        if (UNLIKELY(f->total_decomp > UINT64_MAX - decomp)) goto fail;
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  267|  21.3k|        f->decomp_base = decomp;
  268|  21.3k|        f->block_base = blocks;
  269|  21.3k|        decomp += f->total_decomp;
  270|  21.3k|        blocks += f->num_blocks;  // no wrap: each frame holds at least 8 bytes per block
  271|  21.3k|        if (f->block_size > max_block_size) max_block_size = f->block_size;
  ------------------
  |  Branch (271:13): [True: 21.3k, False: 0]
  ------------------
  272|  21.3k|    }
  273|       |
  274|  21.3k|    zxc_seekable* const s = (zxc_seekable*)ZXC_CALLOC(1, sizeof(zxc_seekable));
  ------------------
  |  |   74|  21.3k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
  275|  21.3k|    if (UNLIKELY(!s)) goto fail;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  276|  21.3k|    if (src.rdr) s->reader = *src.rdr;
  ------------------
  |  Branch (276:9): [True: 0, False: 21.3k]
  ------------------
  277|  21.3k|    s->src = src.data;
  278|  21.3k|    s->src_size = src.size;
  279|  21.3k|    s->frames = frames;
  280|  21.3k|    s->num_frames = n;
  281|  21.3k|    s->num_blocks = blocks;
  282|  21.3k|    s->total_decomp = decomp;
  283|  21.3k|    s->max_block_size = max_block_size;
  284|  21.3k|    s->verify_checksums = 0; /* opt-in, see zxc_seekable_set_checksum */
  285|  21.3k|    return s;
  286|       |
  287|  10.6k|fail:
  288|  10.6k|    ZXC_FREE(frames);
  ------------------
  |  |   86|  10.6k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  289|       |    return NULL;
  290|  21.3k|}
zxc_seekable.c:zxc_seek_parse_frame:
  178|  32.0k|static int zxc_seek_parse_frame(zxc_seek_source_t* src, const uint64_t end, zxc_seek_frame_t* f) {
  179|  32.0k|    const zxc_scan_src_t scan = {zxc_seek_scan_read, NULL, src, end};
  180|  32.0k|    zxc_frame_info_t fi;
  181|  32.0k|    uint64_t start = 0;
  182|  32.0k|    size_t footer_len = 0;
  183|  32.0k|    if (UNLIKELY(zxc_scan_frame(&scan, end, &start, &fi, &footer_len) != ZXC_OK ||
  ------------------
  |  |  154|  53.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 10.6k, False: 21.3k]
  |  |  |  Branch (154:42): [True: 10.6k, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  184|  32.0k|                 !fi.has_seek_table))
  185|  10.6k|        return 0;
  186|  21.3k|    const uint64_t frame = end - start;
  187|  21.3k|    const uint32_t block_size = (uint32_t)fi.block_size;
  188|  21.3k|    const uint64_t num_blocks = zxc_seek_block_count(fi.decompressed_size, block_size);
  189|       |
  190|       |    // Layout: [header 16][data blocks][EOF 8][SEK block][footer], in 64 bits:
  191|       |    // the SEK header's field only holds the table size modulo 2^32.
  192|  21.3k|    const uint64_t seek_block_total = ZXC_BLOCK_HEADER_SIZE + zxc_seek_table_bytes(num_blocks);
  ------------------
  |  |  428|  21.3k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  193|  21.3k|    if (UNLIKELY(seek_block_total + footer_len >
  ------------------
  |  |  154|  21.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  194|  21.3k|                 frame - ZXC_FILE_HEADER_SIZE - ZXC_BLOCK_HEADER_SIZE))
  195|      0|        return 0;
  196|  21.3k|    const uint64_t eof_off = frame - footer_len - seek_block_total - ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  21.3k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  197|       |
  198|       |    // Geometry only, no table read: num_blocks blocks of [header, entry_max] bytes
  199|       |    // must fit the data area. Groups are checked on access.
  200|  21.3k|    const uint64_t entry_max = (uint64_t)ZXC_BLOCK_HEADER_SIZE + block_size +
  ------------------
  |  |  428|  21.3k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  201|  21.3k|                               (fi.has_checksum ? ZXC_BLOCK_CHECKSUM_SIZE : 0U);
  ------------------
  |  |  430|  11.1k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (201:33): [True: 11.1k, False: 10.1k]
  ------------------
  202|  21.3k|    const uint64_t data_area = eof_off - ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  21.3k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  203|  21.3k|    const uint64_t min_span = num_blocks * ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  21.3k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  204|  21.3k|    const uint64_t max_span =
  205|  21.3k|        num_blocks > UINT64_MAX / entry_max ? UINT64_MAX : num_blocks * entry_max;
  ------------------
  |  Branch (205:9): [True: 0, False: 21.3k]
  ------------------
  206|  21.3k|    if (UNLIKELY(data_area < min_span || data_area > max_span)) return 0;
  ------------------
  |  |  154|  42.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  |  Branch (154:42): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  207|       |
  208|  21.3k|    f->base = start;
  209|  21.3k|    f->num_blocks = num_blocks;
  210|  21.3k|    f->total_decomp = fi.decompressed_size;
  211|  21.3k|    f->table_off = start + eof_off + 2 * ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  21.3k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  212|  21.3k|    f->eof_off = eof_off;
  213|  21.3k|    f->entry_max = entry_max;
  214|  21.3k|    f->block_size = block_size;
  215|  21.3k|    f->has_checksums = fi.has_checksum;
  216|  21.3k|    f->dict_id = fi.dict_id;
  217|  21.3k|    return 1;
  218|  21.3k|}
zxc_seekable.c:zxc_seek_scan_read:
  164|  54.0k|                              const size_t len) {
  165|  54.0k|    return zxc_seek_source_read((const zxc_seek_source_t*)scan->ctx, dst, len, off);
  166|  54.0k|}
zxc_seekable.c:zxc_seek_source_read:
  141|   545k|                                const uint64_t off) {
  142|   545k|    if (UNLIKELY(off > src->size || (uint64_t)len > src->size - off))
  ------------------
  |  |  154|  1.09M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 545k]
  |  |  |  Branch (154:42): [True: 0, False: 545k]
  |  |  |  Branch (154:42): [True: 0, False: 545k]
  |  |  ------------------
  ------------------
  143|      0|        return ZXC_ERROR_SRC_TOO_SMALL;
  144|   545k|    if (src->data) {
  ------------------
  |  Branch (144:9): [True: 545k, False: 0]
  ------------------
  145|   545k|        ZXC_MEMCPY(dst, src->data + off, len);
  ------------------
  |  |  170|   545k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  146|   545k|        return ZXC_OK;
  147|   545k|    }
  148|      0|    const int64_t r = src->rdr->read_at(src->rdr->ctx, dst, len, off);
  149|       |    // A code outside int would truncate, possibly to ZXC_OK.
  150|      0|    if (UNLIKELY(r != (int64_t)len)) return (r < 0 && r >= INT_MIN) ? (int)r : ZXC_ERROR_IO;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (150:46): [True: 0, False: 0]
  |  Branch (150:55): [True: 0, False: 0]
  ------------------
  151|      0|    return ZXC_OK;
  152|      0|}
zxc_seekable.c:zxc_seek_frame_of_block:
  293|   488k|static const zxc_seek_frame_t* zxc_seek_frame_of_block(const zxc_seekable* s, const uint64_t idx) {
  294|   488k|    size_t lo = 0;
  295|   488k|    size_t hi = s->num_frames;
  296|   977k|    while (lo < hi) {  // the first frame starting past idx; the one before holds it
  ------------------
  |  Branch (296:12): [True: 488k, False: 488k]
  ------------------
  297|   488k|        const size_t mid = lo + (hi - lo) / 2;
  298|   488k|        if (s->frames[mid].block_base <= idx)
  ------------------
  |  Branch (298:13): [True: 488k, False: 0]
  ------------------
  299|   488k|            lo = mid + 1;
  300|      0|        else
  301|      0|            hi = mid;
  302|   488k|    }
  303|   488k|    return &s->frames[lo - 1];
  304|   488k|}
zxc_seekable.c:zxc_seek_load_spans:
  351|   342k|                               uint32_t* RESTRICT sizes, uint8_t* RESTRICT raw) {
  352|   342k|    const uint64_t last_group = zxc_seek_group_count(f->num_blocks) - 1;
  353|   342k|    const uint64_t g0 = first / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   342k|#define ZXC_SEEK_GROUP 64U
  ------------------
  354|   342k|    const uint64_t g1 = (first + n - 1) / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|   342k|#define ZXC_SEEK_GROUP 64U
  ------------------
  355|       |
  356|   342k|    size_t need = 0;
  357|   688k|    for (uint64_t g = g0; g <= g1; g++)
  ------------------
  |  Branch (357:27): [True: 345k, False: 342k]
  ------------------
  358|   345k|        need += ZXC_SEEK_ANCHOR_SIZE +
  ------------------
  |  |  465|   345k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  ------------------
  359|   345k|                (size_t)zxc_seek_group_len(f->num_blocks, g) * ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  467|   345k|#define ZXC_SEEK_SIZE_ENTRY 4U
  ------------------
  360|       |    // The EOF/SEK headers, checked on each access rather than kept as state; read
  361|       |    // with group 0 when it is wanted.
  362|   342k|    const zxc_seek_source_t src = zxc_seek_source_of(s);
  363|   342k|    const uint64_t at = f->table_off + g0 * ZXC_SEEK_GROUP_BYTES;
  ------------------
  |  |  469|   342k|#define ZXC_SEEK_GROUP_BYTES (ZXC_SEEK_ANCHOR_SIZE + ZXC_SEEK_GROUP * ZXC_SEEK_SIZE_ENTRY)
  |  |  ------------------
  |  |  |  |  465|   342k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  |  |  ------------------
  |  |               #define ZXC_SEEK_GROUP_BYTES (ZXC_SEEK_ANCHOR_SIZE + ZXC_SEEK_GROUP * ZXC_SEEK_SIZE_ENTRY)
  |  |  ------------------
  |  |  |  |  463|   342k|#define ZXC_SEEK_GROUP 64U
  |  |  ------------------
  |  |               #define ZXC_SEEK_GROUP_BYTES (ZXC_SEEK_ANCHOR_SIZE + ZXC_SEEK_GROUP * ZXC_SEEK_SIZE_ENTRY)
  |  |  ------------------
  |  |  |  |  467|   342k|#define ZXC_SEEK_SIZE_ENTRY 4U
  |  |  ------------------
  ------------------
  364|   342k|    int rc = g0 == 0 ? zxc_seek_source_read(&src, raw, ZXC_SEEK_TAIL_HDRS + need,
  ------------------
  |  |   73|   215k|#define ZXC_SEEK_TAIL_HDRS (2 * ZXC_BLOCK_HEADER_SIZE)
  |  |  ------------------
  |  |  |  |  428|   215k|#define ZXC_BLOCK_HEADER_SIZE 8
  |  |  ------------------
  ------------------
  |  Branch (364:14): [True: 215k, False: 127k]
  ------------------
  365|   215k|                                            at - ZXC_SEEK_TAIL_HDRS)
  ------------------
  |  |   73|   215k|#define ZXC_SEEK_TAIL_HDRS (2 * ZXC_BLOCK_HEADER_SIZE)
  |  |  ------------------
  |  |  |  |  428|   215k|#define ZXC_BLOCK_HEADER_SIZE 8
  |  |  ------------------
  ------------------
  366|   342k|                     : zxc_seek_source_read(&src, raw, ZXC_SEEK_TAIL_HDRS,
  ------------------
  |  |   73|   127k|#define ZXC_SEEK_TAIL_HDRS (2 * ZXC_BLOCK_HEADER_SIZE)
  |  |  ------------------
  |  |  |  |  428|   127k|#define ZXC_BLOCK_HEADER_SIZE 8
  |  |  ------------------
  ------------------
  367|   127k|                                            f->table_off - ZXC_SEEK_TAIL_HDRS);
  ------------------
  |  |   73|   127k|#define ZXC_SEEK_TAIL_HDRS (2 * ZXC_BLOCK_HEADER_SIZE)
  |  |  ------------------
  |  |  |  |  428|   127k|#define ZXC_BLOCK_HEADER_SIZE 8
  |  |  ------------------
  ------------------
  368|   342k|    if (rc == ZXC_OK && g0 != 0)
  ------------------
  |  Branch (368:9): [True: 342k, False: 0]
  |  Branch (368:25): [True: 127k, False: 215k]
  ------------------
  369|   127k|        rc = zxc_seek_source_read(&src, raw + ZXC_SEEK_TAIL_HDRS, need, at);
  ------------------
  |  |   73|   127k|#define ZXC_SEEK_TAIL_HDRS (2 * ZXC_BLOCK_HEADER_SIZE)
  |  |  ------------------
  |  |  |  |  428|   127k|#define ZXC_BLOCK_HEADER_SIZE 8
  |  |  ------------------
  ------------------
  370|   342k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|   342k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 342k]
  |  |  ------------------
  ------------------
  371|   342k|    if (UNLIKELY(zxc_check_eof_header(raw) != ZXC_OK ||
  ------------------
  |  |  154|   685k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 342k]
  |  |  |  Branch (154:42): [True: 0, False: 342k]
  |  |  |  Branch (154:42): [True: 0, False: 342k]
  |  |  ------------------
  ------------------
  372|   342k|                 zxc_check_seek_header(raw + ZXC_BLOCK_HEADER_SIZE, ZXC_BLOCK_HEADER_SIZE,
  373|   342k|                                       f->total_decomp, f->block_size, NULL) != ZXC_OK))
  374|      0|        return ZXC_ERROR_CORRUPT_DATA;
  375|       |
  376|   342k|    const uint8_t* p = raw + ZXC_SEEK_TAIL_HDRS;
  ------------------
  |  |   73|   342k|#define ZXC_SEEK_TAIL_HDRS (2 * ZXC_BLOCK_HEADER_SIZE)
  |  |  ------------------
  |  |  |  |  428|   342k|#define ZXC_BLOCK_HEADER_SIZE 8
  |  |  ------------------
  ------------------
  377|   688k|    for (uint64_t g = g0; g <= g1; g++) {
  ------------------
  |  Branch (377:27): [True: 345k, False: 342k]
  ------------------
  378|   345k|        uint64_t pos = zxc_le64(p);
  379|   345k|        p += ZXC_SEEK_ANCHOR_SIZE;
  ------------------
  |  |  465|   345k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  ------------------
  380|   345k|        if (UNLIKELY(g == 0 ? pos != ZXC_FILE_HEADER_SIZE
  ------------------
  |  |  154|   950k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 345k]
  |  |  |  Branch (154:42): [True: 0, False: 129k]
  |  |  |  Branch (154:42): [True: 0, False: 129k]
  |  |  |  Branch (154:42): [True: 215k, False: 129k]
  |  |  ------------------
  ------------------
  381|   345k|                            : pos < ZXC_FILE_HEADER_SIZE || pos > f->eof_off))
  382|      0|            return ZXC_ERROR_CORRUPT_DATA;
  383|       |
  384|   345k|        const uint32_t cnt = zxc_seek_group_len(f->num_blocks, g);
  385|  16.6M|        for (uint32_t k = 0; k < cnt; k++, p += ZXC_SEEK_SIZE_ENTRY) {
  ------------------
  |  |  467|  16.2M|#define ZXC_SEEK_SIZE_ENTRY 4U
  ------------------
  |  Branch (385:30): [True: 16.2M, False: 345k]
  ------------------
  386|  16.2M|            const uint32_t sz = zxc_le32(p);
  387|  16.2M|            if (UNLIKELY(sz < ZXC_BLOCK_HEADER_SIZE || sz > f->entry_max))
  ------------------
  |  |  154|  32.5M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 16.2M]
  |  |  |  Branch (154:42): [True: 0, False: 16.2M]
  |  |  |  Branch (154:42): [True: 0, False: 16.2M]
  |  |  ------------------
  ------------------
  388|      0|                return ZXC_ERROR_CORRUPT_DATA;
  389|  16.2M|            const uint64_t idx = g * ZXC_SEEK_GROUP + k;
  ------------------
  |  |  463|  16.2M|#define ZXC_SEEK_GROUP 64U
  ------------------
  390|  16.2M|            if (idx >= first && idx < first + n) {
  ------------------
  |  Branch (390:17): [True: 8.54M, False: 7.74M]
  |  Branch (390:33): [True: 812k, False: 7.73M]
  ------------------
  391|   812k|                starts[idx - first] = f->base + pos;
  392|   812k|                sizes[idx - first] = sz;
  393|   812k|            }
  394|  16.2M|            pos += sz;  // no wrap: at most ZXC_SEEK_GROUP sizes of at most entry_max
  395|  16.2M|        }
  396|       |        // Within the data area; the last group, exactly on the EOF block.
  397|   345k|        if (UNLIKELY(pos > f->eof_off || (g == last_group && pos != f->eof_off)))
  ------------------
  |  |  154|  1.17M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 345k]
  |  |  |  Branch (154:42): [True: 136k, False: 209k]
  |  |  |  Branch (154:42): [True: 0, False: 136k]
  |  |  |  Branch (154:42): [True: 0, False: 345k]
  |  |  ------------------
  ------------------
  398|      0|            return ZXC_ERROR_CORRUPT_DATA;
  399|   345k|    }
  400|   342k|    return ZXC_OK;
  401|   342k|}
zxc_seekable.c:zxc_seek_source_of:
  157|   342k|static zxc_seek_source_t zxc_seek_source_of(const zxc_seekable* s) {
  158|   342k|    const zxc_seek_source_t src = {s->src, s->src ? NULL : &s->reader, s->src_size};
  ------------------
  |  Branch (158:44): [True: 342k, False: 0]
  ------------------
  159|   342k|    return src;
  160|   342k|}
zxc_seekable.c:zxc_seek_decomp_size:
  471|   647k|                                     const uint64_t idx) {
  472|   647k|    const uint64_t start = idx * (uint64_t)block_size;
  473|   647k|    const uint64_t remaining = total_decomp - start;
  474|   647k|    return (remaining >= (uint64_t)block_size) ? block_size : (uint32_t)remaining;
  ------------------
  |  Branch (474:12): [True: 601k, False: 46.0k]
  ------------------
  475|   647k|}
zxc_seekable.c:zxc_seek_block_of_offset:
  307|   101k|static uint64_t zxc_seek_block_of_offset(const zxc_seekable* s, const uint64_t offset) {
  308|   101k|    size_t lo = 0;
  309|   101k|    size_t hi = s->num_frames;
  310|   203k|    while (lo < hi) {
  ------------------
  |  Branch (310:12): [True: 101k, False: 101k]
  ------------------
  311|   101k|        const size_t mid = lo + (hi - lo) / 2;
  312|   101k|        if (s->frames[mid].decomp_base <= offset)
  ------------------
  |  Branch (312:13): [True: 101k, False: 0]
  ------------------
  313|   101k|            lo = mid + 1;
  314|      0|        else
  315|      0|            hi = mid;
  316|   101k|    }
  317|   101k|    const zxc_seek_frame_t* const f = &s->frames[lo - 1];
  318|   101k|    return f->block_base + ((offset - f->decomp_base) >> zxc_ctz32(f->block_size));
  319|   101k|}
zxc_seekable.c:zxc_seek_use_dict:
  495|   249k|                             const zxc_seek_frame_t* f) {
  496|   249k|    const zxc_seek_dict_t* d = NULL;
  497|   249k|    for (size_t i = 0; f->dict_id && i < s->num_dicts && !d; i++)
  ------------------
  |  Branch (497:24): [True: 0, False: 249k]
  |  Branch (497:38): [True: 0, False: 0]
  |  Branch (497:58): [True: 0, False: 0]
  ------------------
  498|      0|        if (s->dicts[i].id == f->dict_id) d = &s->dicts[i];
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|   249k|    if (UNLIKELY(f->dict_id && !d)) return ZXC_ERROR_DICT_REQUIRED;
  ------------------
  |  |  154|   249k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 249k]
  |  |  |  Branch (154:42): [True: 0, False: 249k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  500|   249k|    if (d != *held) {
  ------------------
  |  Branch (500:9): [True: 0, False: 249k]
  ------------------
  501|      0|        if (d) ZXC_MEMCPY(ctx->dict_buffer, d->data, d->size);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|        if (UNLIKELY(zxc_cctx_attach_dict_huf(ctx, d && d->has_huf ? d->huf : NULL) != ZXC_OK))
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  503|      0|            return ZXC_ERROR_CORRUPT_DATA;  // LCOV_EXCL_LINE
  504|      0|        *held = d;
  505|      0|    }
  506|   249k|    ctx->dict_size = d ? d->size : 0;
  ------------------
  |  Branch (506:22): [True: 0, False: 249k]
  ------------------
  507|   249k|    return ZXC_OK;
  508|   249k|}
zxc_seekable.c:zxc_seek_read_block:
  540|   476k|                               const uint8_t** blk) {
  541|   476k|    if (s->src) {
  ------------------
  |  Branch (541:9): [True: 476k, False: 18.4E]
  ------------------
  542|   476k|        if (UNLIKELY(off > s->src_size || (uint64_t)csz > s->src_size - off))
  ------------------
  |  |  154|   953k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 476k]
  |  |  |  Branch (154:42): [True: 18.4E, False: 476k]
  |  |  |  Branch (154:42): [True: 18.4E, False: 476k]
  |  |  ------------------
  ------------------
  543|      0|            return ZXC_ERROR_SRC_TOO_SMALL;
  544|   476k|        *blk = s->src + off;
  545|  18.4E|    } else {
  546|  18.4E|        if (UNLIKELY(csz > buf_cap)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  18.4E|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  547|  18.4E|        const zxc_seek_source_t src = zxc_seek_source_of(s);
  548|  18.4E|        const int rc = zxc_seek_source_read(&src, buf, csz, off);
  549|  18.4E|        if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  18.4E|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.4E]
  |  |  ------------------
  ------------------
  550|  18.4E|        *blk = buf;
  551|  18.4E|    }
  552|       |
  553|   476k|    zxc_block_header_t bh;
  554|   476k|    const int hdr_res = zxc_read_block_header(*blk, csz, &bh);
  555|   476k|    if (UNLIKELY(hdr_res != ZXC_OK)) return hdr_res;
  ------------------
  |  |  154|   476k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4.23k, False: 472k]
  |  |  ------------------
  ------------------
  556|   472k|    const uint64_t on_disk =
  557|   472k|        (uint64_t)ZXC_BLOCK_HEADER_SIZE + bh.comp_size + (has_cs ? ZXC_BLOCK_CHECKSUM_SIZE : 0U);
  ------------------
  |  |  428|   472k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                      (uint64_t)ZXC_BLOCK_HEADER_SIZE + bh.comp_size + (has_cs ? ZXC_BLOCK_CHECKSUM_SIZE : 0U);
  ------------------
  |  |  430|   355k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (557:59): [True: 355k, False: 116k]
  ------------------
  558|   472k|    if (UNLIKELY(on_disk != csz)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   472k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 472k]
  |  |  ------------------
  ------------------
  559|   472k|    return (int)csz;
  560|   472k|}
zxc_seekable.c:zxc_seek_decode_error:
  512|  2.57k|static int zxc_seek_decode_error(const int res) {
  513|  2.57k|    return (res == ZXC_ERROR_DST_TOO_SMALL || res == ZXC_ERROR_OVERFLOW) ? ZXC_ERROR_CORRUPT_DATA
  ------------------
  |  Branch (513:13): [True: 104, False: 2.47k]
  |  Branch (513:47): [True: 424, False: 2.04k]
  ------------------
  514|  2.57k|                                                                         : res;
  515|  2.57k|}
zxc_seekable.c:zxc_seek_spans_raw_max:
  323|  4.43k|static size_t zxc_seek_spans_raw_max(const uint64_t first, const uint32_t n) {
  324|  4.43k|    const uint64_t groups = (first + n - 1) / ZXC_SEEK_GROUP - first / ZXC_SEEK_GROUP + 1;
  ------------------
  |  |  463|  4.43k|#define ZXC_SEEK_GROUP 64U
  ------------------
                  const uint64_t groups = (first + n - 1) / ZXC_SEEK_GROUP - first / ZXC_SEEK_GROUP + 1;
  ------------------
  |  |  463|  4.43k|#define ZXC_SEEK_GROUP 64U
  ------------------
  325|  4.43k|    return ZXC_SEEK_TAIL_HDRS + (size_t)groups * ZXC_SEEK_GROUP_BYTES;
  ------------------
  |  |   73|  4.43k|#define ZXC_SEEK_TAIL_HDRS (2 * ZXC_BLOCK_HEADER_SIZE)
  |  |  ------------------
  |  |  |  |  428|  4.43k|#define ZXC_BLOCK_HEADER_SIZE 8
  |  |  ------------------
  ------------------
                  return ZXC_SEEK_TAIL_HDRS + (size_t)groups * ZXC_SEEK_GROUP_BYTES;
  ------------------
  |  |  469|  4.43k|#define ZXC_SEEK_GROUP_BYTES (ZXC_SEEK_ANCHOR_SIZE + ZXC_SEEK_GROUP * ZXC_SEEK_SIZE_ENTRY)
  |  |  ------------------
  |  |  |  |  465|  4.43k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  |  |  ------------------
  |  |               #define ZXC_SEEK_GROUP_BYTES (ZXC_SEEK_ANCHOR_SIZE + ZXC_SEEK_GROUP * ZXC_SEEK_SIZE_ENTRY)
  |  |  ------------------
  |  |  |  |  463|  4.43k|#define ZXC_SEEK_GROUP 64U
  |  |  ------------------
  |  |               #define ZXC_SEEK_GROUP_BYTES (ZXC_SEEK_ANCHOR_SIZE + ZXC_SEEK_GROUP * ZXC_SEEK_SIZE_ENTRY)
  |  |  ------------------
  |  |  |  |  467|  4.43k|#define ZXC_SEEK_SIZE_ENTRY 4U
  |  |  ------------------
  ------------------
  326|  4.43k|}
zxc_seekable.c:zxc_seek_mt_worker:
  775|  13.1k|static void* zxc_seek_mt_worker(void* arg) {
  776|  13.1k|    zxc_seek_mt_shared_t* const sh = (zxc_seek_mt_shared_t*)arg;
  777|  13.1k|    const zxc_seekable* const s = sh->s;
  778|       |
  779|       |    // Thread-local decompression context (mode=0 for decompress-only)
  780|  13.1k|    zxc_cctx_t dctx;
  781|  13.1k|    if (UNLIKELY(zxc_cctx_init(&dctx, (size_t)s->max_block_size, 0, 0, 0, s->max_dict_size) !=
  ------------------
  |  |  154|  13.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 13.1k]
  |  |  ------------------
  ------------------
  782|  13.1k|                 ZXC_OK))
  783|      0|        return NULL;  // LCOV_EXCL_LINE
  784|  13.1k|    const zxc_seek_dict_t* held = NULL;
  785|       |
  786|       |    // Block scratch, for a reader only.
  787|  13.1k|    const size_t read_cap = (size_t)sh->max_csz + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  13.1k|#define ZXC_PAD_SIZE 32
  ------------------
  788|  13.1k|    uint8_t* read_buf = NULL;
  789|  13.1k|    if (!s->src) {
  ------------------
  |  Branch (789:9): [True: 0, False: 13.1k]
  ------------------
  790|      0|        read_buf = (uint8_t*)ZXC_MALLOC(read_cap);
  ------------------
  |  |   68|      0|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  791|      0|        if (UNLIKELY(!read_buf)) {
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  792|       |            // LCOV_EXCL_START
  793|      0|            zxc_cctx_free(&dctx);
  794|      0|            return NULL;
  795|       |            // LCOV_EXCL_STOP
  796|      0|        }
  797|      0|    }
  798|       |
  799|  13.1k|    int rc = ZXC_OK;
  800|  25.7k|    while (rc == ZXC_OK) {
  ------------------
  |  Branch (800:12): [True: 24.9k, False: 784]
  ------------------
  801|  24.9k|        pthread_mutex_lock(&sh->lock);
  802|  24.9k|        const uint32_t first = sh->failed ? sh->num_jobs : sh->next;
  ------------------
  |  Branch (802:32): [True: 1.68k, False: 23.2k]
  ------------------
  803|  24.9k|        const uint32_t last = sh->num_jobs - first > sh->batch ? first + sh->batch : sh->num_jobs;
  ------------------
  |  Branch (803:31): [True: 8.69k, False: 16.2k]
  ------------------
  804|  24.9k|        sh->next = last;
  805|  24.9k|        pthread_mutex_unlock(&sh->lock);
  806|  24.9k|        if (first == last) break;
  ------------------
  |  Branch (806:13): [True: 12.3k, False: 12.5k]
  ------------------
  807|       |
  808|   216k|        for (uint32_t i = first; i < last && rc == ZXC_OK; i++)
  ------------------
  |  Branch (808:34): [True: 203k, False: 12.3k]
  |  Branch (808:46): [True: 203k, False: 206]
  ------------------
  809|   203k|            rc = zxc_seek_mt_job(sh, &sh->jobs[i], &dctx, &held, read_buf, read_cap);
  810|  12.5k|    }
  811|  13.1k|    if (UNLIKELY(rc != ZXC_OK)) {
  ------------------
  |  |  154|  13.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 784, False: 12.3k]
  |  |  ------------------
  ------------------
  812|    784|        pthread_mutex_lock(&sh->lock);
  813|    784|        sh->failed = 1;
  814|    784|        pthread_mutex_unlock(&sh->lock);
  815|    784|    }
  816|       |
  817|  13.1k|    ZXC_FREE(read_buf);
  ------------------
  |  |   86|  13.1k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  818|  13.1k|    zxc_cctx_free(&dctx);
  819|       |    return NULL;
  820|  13.1k|}
zxc_seekable.c:zxc_seek_mt_job:
  736|   204k|                           const zxc_seek_dict_t** held, uint8_t* read_buf, const size_t read_cap) {
  737|   204k|    const zxc_seekable* const s = sh->s;
  738|       |
  739|   204k|    const uint8_t* blk = NULL;
  740|   204k|    const int read_res =
  741|   204k|        zxc_seek_read_block(s, job->off, job->csz, job->has_cs, read_buf, read_cap, &blk);
  742|   204k|    if (UNLIKELY(read_res < 0)) return job->result = read_res;
  ------------------
  |  |  154|   204k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 268, False: 203k]
  |  |  ------------------
  ------------------
  743|       |
  744|   203k|    const int dict_res = zxc_seek_use_dict(s, dctx, held, job->frame);
  745|   203k|    if (UNLIKELY(dict_res != ZXC_OK)) return job->result = dict_res;
  ------------------
  |  |  154|   203k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 203k]
  |  |  ------------------
  ------------------
  746|   203k|    dctx->chunk_size = job->block_size;
  747|   203k|    dctx->checksum_enabled = job->has_cs && s->verify_checksums;
  ------------------
  |  Branch (747:30): [True: 155k, False: 48.5k]
  |  Branch (747:45): [True: 0, False: 155k]
  ------------------
  748|       |
  749|       |    // Behind the dict prefix, if any, for back-references into it.
  750|   203k|    uint8_t* const dec_dst =
  751|   203k|        dctx->dict_buffer ? dctx->dict_buffer + dctx->dict_size : dctx->work_buf;
  ------------------
  |  Branch (751:9): [True: 0, False: 203k]
  ------------------
  752|   203k|    const int dec_res = zxc_decompress_chunk_wrapper(
  753|   203k|        dctx, blk, (size_t)read_res, dec_dst, (size_t)job->block_size + ZXC_DECOMPRESS_TAIL_PAD,
  ------------------
  |  |  361|   203k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|   203k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|   203k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|   203k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   203k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   203k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   203k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|   203k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  754|   203k|        job->block_idx);
  755|   203k|    if (UNLIKELY(dec_res < 0)) return job->result = zxc_seek_decode_error(dec_res);
  ------------------
  |  |  154|   203k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 414, False: 203k]
  |  |  ------------------
  ------------------
  756|   203k|    if (UNLIKELY((uint32_t)dec_res != job->decomp_sz)) return job->result = ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|   203k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 102, False: 203k]
  |  |  ------------------
  ------------------
  757|       |
  758|   203k|    ZXC_MEMCPY(sh->dst_base + job->dst_off, dec_dst + job->skip, job->copy_len);
  ------------------
  |  |  170|   203k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  759|   203k|    return job->result = ZXC_OK;
  760|   203k|}

LLVMFuzzerTestOneInput:
   29|  10.6k|int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   30|  10.6k|    if (size < 2) return 0;
  ------------------
  |  Branch (30:9): [True: 1, False: 10.6k]
  ------------------
   31|       |
   32|       |    /* Save original input for phase 7 (raw parser fuzzing) */
   33|  10.6k|    const uint8_t* const raw_data = data;
   34|  10.6k|    const size_t raw_size = size;
   35|       |
   36|       |    /* Use first byte as level, second as flags */
   37|  10.6k|    const int level = (data[0] % 5) + 1;
   38|  10.6k|    const int use_checksum = data[1] & 1;
   39|  10.6k|    const int use_mt = data[1] & 2;
   40|  10.6k|    const int small_blocks = data[1] & 0x40; /* many blocks: in place, several batches */
   41|  10.6k|    data += 2;
   42|  10.6k|    size -= 2;
   43|       |
   44|  10.6k|    if (size == 0 || size > FUZZ_SEEKABLE_MAX_INPUT) return 0;
  ------------------
  |  |   27|  10.6k|#define FUZZ_SEEKABLE_MAX_INPUT (4 << 20) /* 4 MiB */
  ------------------
  |  Branch (44:9): [True: 1, False: 10.6k]
  |  Branch (44:22): [True: 0, False: 10.6k]
  ------------------
   45|       |
   46|       |    /* Persistent buffers - reused across iterations to reduce allocator pressure */
   47|  10.6k|    static uint8_t* comp_buf = NULL;
   48|  10.6k|    static size_t comp_cap = 0;
   49|  10.6k|    static uint8_t* decomp_buf = NULL;
   50|  10.6k|    static size_t decomp_cap = 0;
   51|       |
   52|       |    /* ------------------------------------------------------------------ */
   53|       |    /* Phase 1: Compress with seekable=1                                  */
   54|       |    /* ------------------------------------------------------------------ */
   55|  10.6k|    const size_t bound = zxc_compress_bound(size);
   56|  10.6k|    if (bound == 0) return 0;
  ------------------
  |  Branch (56:9): [True: 0, False: 10.6k]
  ------------------
   57|  10.6k|    if (bound > comp_cap) {
  ------------------
  |  Branch (57:9): [True: 5.63k, False: 5.03k]
  ------------------
   58|  5.63k|        void* new_buf = realloc(comp_buf, bound);
   59|  5.63k|        if (!new_buf) return 0;
  ------------------
  |  Branch (59:13): [True: 0, False: 5.63k]
  ------------------
   60|  5.63k|        comp_buf = (uint8_t*)new_buf;
   61|  5.63k|        comp_cap = bound;
   62|  5.63k|    }
   63|       |
   64|  10.6k|    zxc_cctx* const cctx = zxc_create_cctx();
   65|  10.6k|    if (!cctx) return 0;
  ------------------
  |  Branch (65:9): [True: 0, False: 10.6k]
  ------------------
   66|  10.6k|    int64_t csize = -1;
   67|  10.6k|    if (zxc_cctx_set_param(cctx, ZXC_C_LEVEL, level) == ZXC_OK &&
  ------------------
  |  Branch (67:9): [True: 10.6k, False: 0]
  ------------------
   68|  10.6k|        zxc_cctx_set_param(cctx, ZXC_C_CHECKSUM, use_checksum) == ZXC_OK &&
  ------------------
  |  Branch (68:9): [True: 10.6k, False: 0]
  ------------------
   69|  10.6k|        zxc_cctx_set_param(cctx, ZXC_C_SEEKABLE, 1) == ZXC_OK &&
  ------------------
  |  Branch (69:9): [True: 10.6k, False: 0]
  ------------------
   70|  10.6k|        (!small_blocks || zxc_cctx_set_param(cctx, ZXC_C_BLOCK_SIZE, 4096) == ZXC_OK)) {
  ------------------
  |  Branch (70:10): [True: 5.25k, False: 5.41k]
  |  Branch (70:27): [True: 5.41k, False: 0]
  ------------------
   71|  10.6k|        csize = zxc_compress_cctx(cctx, data, size, comp_buf, bound);
   72|  10.6k|    }
   73|  10.6k|    zxc_free_cctx(cctx);
   74|  10.6k|    if (csize < 0) return 0;
  ------------------
  |  Branch (74:9): [True: 0, False: 10.6k]
  ------------------
   75|       |
   76|       |    /* ------------------------------------------------------------------ */
   77|       |    /* Phase 2: Open seekable handle                                       */
   78|       |    /* ------------------------------------------------------------------ */
   79|  10.6k|    zxc_seekable* s = zxc_seekable_open(comp_buf, (size_t)csize);
   80|  10.6k|    if (!s) return 0;
  ------------------
  |  Branch (80:9): [True: 0, False: 10.6k]
  ------------------
   81|       |
   82|       |    /* ------------------------------------------------------------------ */
   83|       |    /* Phase 3: Exercise metadata getters                                 */
   84|       |    /* ------------------------------------------------------------------ */
   85|  10.6k|    const uint64_t num_blocks = zxc_seekable_get_num_blocks(s);
   86|  10.6k|    const uint64_t total_decomp = zxc_seekable_get_decompressed_size(s);
   87|  10.6k|    assert(total_decomp == size);
  ------------------
  |  Branch (87:5): [True: 0, False: 10.6k]
  |  Branch (87:5): [True: 10.6k, False: 0]
  ------------------
   88|       |
   89|   159k|    for (uint64_t i = 0; i < num_blocks; i++) {
  ------------------
  |  Branch (89:26): [True: 148k, False: 10.6k]
  ------------------
   90|   148k|        const uint32_t csz = zxc_seekable_get_block_comp_size(s, i);
   91|   148k|        const uint32_t dsz = zxc_seekable_get_block_decomp_size(s, i);
   92|   148k|        assert(csz > 0);
  ------------------
  |  Branch (92:9): [True: 0, False: 148k]
  |  Branch (92:9): [True: 148k, False: 0]
  ------------------
   93|   148k|        assert(dsz > 0);
  ------------------
  |  Branch (93:9): [True: 0, False: 148k]
  |  Branch (93:9): [True: 148k, False: 0]
  ------------------
   94|   148k|        (void)csz;
   95|   148k|        (void)dsz;
   96|   148k|    }
   97|       |    /* Out-of-range access should return 0 */
   98|  10.6k|    assert(zxc_seekable_get_block_comp_size(s, num_blocks) == 0);
  ------------------
  |  Branch (98:5): [True: 0, False: 10.6k]
  |  Branch (98:5): [True: 10.6k, False: 0]
  ------------------
   99|  10.6k|    assert(zxc_seekable_get_block_decomp_size(s, num_blocks) == 0);
  ------------------
  |  Branch (99:5): [True: 0, False: 10.6k]
  |  Branch (99:5): [True: 10.6k, False: 0]
  ------------------
  100|       |
  101|       |    /* ------------------------------------------------------------------ */
  102|       |    /* Phase 4: Full decompression via seekable range                     */
  103|       |    /* ------------------------------------------------------------------ */
  104|  10.6k|    if (size > decomp_cap) {
  ------------------
  |  Branch (104:9): [True: 5.63k, False: 5.03k]
  ------------------
  105|  5.63k|        void* new_buf = realloc(decomp_buf, size);
  106|  5.63k|        if (!new_buf) {
  ------------------
  |  Branch (106:13): [True: 0, False: 5.63k]
  ------------------
  107|      0|            zxc_seekable_free(s);
  108|      0|            return 0;
  109|      0|        }
  110|  5.63k|        decomp_buf = (uint8_t*)new_buf;
  111|  5.63k|        decomp_cap = size;
  112|  5.63k|    }
  113|       |
  114|  10.6k|    int64_t dec_result;
  115|  10.6k|    if (use_mt && size > 4096) {
  ------------------
  |  Branch (115:9): [True: 5.23k, False: 5.43k]
  |  Branch (115:19): [True: 2.00k, False: 3.23k]
  ------------------
  116|  2.00k|        dec_result = zxc_seekable_decompress_range_mt(s, decomp_buf, size, 0, size, 2);
  117|  8.66k|    } else {
  118|  8.66k|        dec_result = zxc_seekable_decompress_range(s, decomp_buf, size, 0, size);
  119|  8.66k|    }
  120|  10.6k|    assert(dec_result == (int64_t)size);
  ------------------
  |  Branch (120:5): [True: 0, False: 10.6k]
  |  Branch (120:5): [True: 10.6k, False: 0]
  ------------------
  121|  10.6k|    (void)dec_result;
  122|  10.6k|    assert(memcmp(data, decomp_buf, size) == 0);
  ------------------
  |  Branch (122:5): [True: 0, False: 10.6k]
  |  Branch (122:5): [True: 10.6k, False: 0]
  ------------------
  123|       |
  124|       |    /* ------------------------------------------------------------------ */
  125|       |    /* Phase 5: Partial range decompression (sub-block extraction)        */
  126|       |    /* ------------------------------------------------------------------ */
  127|  10.6k|    if (size >= 4) {
  ------------------
  |  Branch (127:9): [True: 10.6k, False: 22]
  ------------------
  128|       |        /* Extract a range from the middle */
  129|  10.6k|        const size_t off = size / 4;
  130|  10.6k|        const size_t len = size / 2;
  131|  10.6k|        dec_result = zxc_seekable_decompress_range(s, decomp_buf, len, off, len);
  132|  10.6k|        assert(dec_result == (int64_t)len);
  ------------------
  |  Branch (132:9): [True: 0, False: 10.6k]
  |  Branch (132:9): [True: 10.6k, False: 0]
  ------------------
  133|  10.6k|        assert(memcmp(data + off, decomp_buf, len) == 0);
  ------------------
  |  Branch (133:9): [True: 0, False: 10.6k]
  |  Branch (133:9): [True: 10.6k, False: 0]
  ------------------
  134|  10.6k|    }
  135|       |
  136|       |    /* ------------------------------------------------------------------ */
  137|       |    /* Phase 6: Edge cases                                                */
  138|       |    /* ------------------------------------------------------------------ */
  139|       |    /* Zero-length read */
  140|  10.6k|    dec_result = zxc_seekable_decompress_range(s, decomp_buf, size, 0, 0);
  141|  10.6k|    assert(dec_result == 0);
  ------------------
  |  Branch (141:5): [True: 0, False: 10.6k]
  |  Branch (141:5): [True: 10.6k, False: 0]
  ------------------
  142|       |
  143|       |    /* Out-of-bounds read */
  144|  10.6k|    dec_result = zxc_seekable_decompress_range(s, decomp_buf, size, total_decomp, 1);
  145|  10.6k|    assert(dec_result < 0);
  ------------------
  |  Branch (145:5): [True: 0, False: 10.6k]
  |  Branch (145:5): [True: 10.6k, False: 0]
  ------------------
  146|       |
  147|       |    /* NULL handle */
  148|  10.6k|    assert(zxc_seekable_get_num_blocks(NULL) == 0);
  ------------------
  |  Branch (148:5): [True: 0, False: 10.6k]
  |  Branch (148:5): [True: 10.6k, False: 0]
  ------------------
  149|  10.6k|    assert(zxc_seekable_get_decompressed_size(NULL) == 0);
  ------------------
  |  Branch (149:5): [True: 0, False: 10.6k]
  |  Branch (149:5): [True: 10.6k, False: 0]
  ------------------
  150|       |
  151|       |    /* ------------------------------------------------------------------ */
  152|       |    /* Phase 8: Corrupted blocks, decoded into an exact buffer            */
  153|       |    /* ------------------------------------------------------------------ */
  154|       |    /* Bytes flipped inside the blocks, the seek table and footer intact so that it
  155|       |     * opens: no decode may write past len. */
  156|  10.6k|    size_t blocks_end = ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  10.6k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  157|   159k|    for (uint64_t i = 0; i < num_blocks; i++) blocks_end += zxc_seekable_get_block_comp_size(s, i);
  ------------------
  |  Branch (157:26): [True: 148k, False: 10.6k]
  ------------------
  158|  10.6k|    if (blocks_end > ZXC_FILE_HEADER_SIZE && blocks_end <= (size_t)csize) {
  ------------------
  |  |  120|  21.3k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  |  Branch (158:9): [True: 10.6k, False: 0]
  |  Branch (158:46): [True: 10.6k, False: 0]
  ------------------
  159|  10.6k|        uint8_t* const bad = (uint8_t*)malloc((size_t)csize);
  160|  10.6k|        uint8_t* const out = (uint8_t*)malloc(size);
  161|  10.6k|        if (bad && out) {
  ------------------
  |  Branch (161:13): [True: 10.6k, False: 0]
  |  Branch (161:20): [True: 10.6k, False: 0]
  ------------------
  162|  10.6k|            memcpy(bad, comp_buf, (size_t)csize);
  163|  10.6k|            const size_t span = blocks_end - ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  10.6k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  164|  10.6k|            const int flips = 1 + ((raw_data[1] >> 2) & 3);
  165|  36.4k|            for (int k = 0; k < flips; k++) {
  ------------------
  |  Branch (165:29): [True: 25.8k, False: 10.6k]
  ------------------
  166|  25.8k|                const uint8_t a = data[(size_t)k % size], b = data[(size_t)(k * 7 + 3) % size];
  167|  25.8k|                bad[ZXC_FILE_HEADER_SIZE + ((size_t)a * 257 + b) * 2654435761U % span] ^=
  ------------------
  |  |  120|  25.8k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  168|  25.8k|                    (uint8_t)(1U << (b & 7));
  169|  25.8k|            }
  170|  10.6k|            zxc_seekable* const sc = zxc_seekable_open(bad, (size_t)csize);
  171|  10.6k|            if (sc) {
  ------------------
  |  Branch (171:17): [True: 10.6k, False: 0]
  ------------------
  172|  10.6k|                zxc_seekable_decompress_range_mt(sc, out, size, 0, size,
  173|  10.6k|                                                 2 + ((raw_data[1] >> 4) & 3));
  174|  10.6k|                zxc_seekable_decompress_range(sc, out, size, 0, size);
  175|  10.6k|                zxc_seekable_free(sc);
  176|  10.6k|            }
  177|  10.6k|        }
  178|  10.6k|        free(bad);
  179|  10.6k|        free(out);
  180|  10.6k|    }
  181|       |
  182|       |    /* ------------------------------------------------------------------ */
  183|       |    /* Cleanup                                                            */
  184|       |    /* ------------------------------------------------------------------ */
  185|  10.6k|    zxc_seekable_free(s);
  186|       |
  187|       |    /* ------------------------------------------------------------------ */
  188|       |    /* Phase 7: Fuzz the parser with raw data (malformed seekable archives) */
  189|       |    /* ------------------------------------------------------------------ */
  190|  10.6k|    zxc_seekable* s2 = zxc_seekable_open(raw_data, raw_size);
  191|  10.6k|    if (s2) {
  ------------------
  |  Branch (191:9): [True: 0, False: 10.6k]
  ------------------
  192|       |        /* If it parsed, try a read - should not crash */
  193|      0|        const uint64_t td = zxc_seekable_get_decompressed_size(s2);
  194|      0|        if (td > 0 && td <= FUZZ_SEEKABLE_MAX_INPUT) {
  ------------------
  |  |   27|      0|#define FUZZ_SEEKABLE_MAX_INPUT (4 << 20) /* 4 MiB */
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  |  Branch (194:23): [True: 0, False: 0]
  ------------------
  195|      0|            uint8_t* tmp = (uint8_t*)malloc((size_t)td);
  196|      0|            if (tmp) {
  ------------------
  |  Branch (196:17): [True: 0, False: 0]
  ------------------
  197|      0|                zxc_seekable_decompress_range(s2, tmp, (size_t)td, 0, (size_t)td);
  198|      0|                free(tmp);
  199|      0|            }
  200|      0|        }
  201|      0|        zxc_seekable_free(s2);
  202|      0|    }
  203|       |
  204|  10.6k|    return 0;
  205|  10.6k|}

