zxc_compress.c:rapidhash_withSeed:
  487|  9.88k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_withSeed(const void *key, size_t len, uint64_t seed) RAPIDHASH_NOEXCEPT {
  488|  9.88k|  return rapidhash_internal(key, len, seed, rapid_secret);
  489|  9.88k|}
zxc_compress.c:rapidhash_internal:
  244|  9.88k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_internal(const void *key, size_t len, uint64_t seed, const uint64_t* secret) RAPIDHASH_NOEXCEPT {
  245|  9.88k|  const uint8_t *p=(const uint8_t *)key;
  246|  9.88k|  seed ^= rapid_mix(seed ^ secret[2], secret[1]);
  247|  9.88k|  uint64_t a=0, b=0;
  248|  9.88k|  size_t i = len;
  249|  9.88k|  if (_likely_(len <= 16)) {
  ------------------
  |  |  107|  9.88k| # define _likely_(x)  __builtin_expect(x,1)
  |  |  ------------------
  |  |  |  Branch (107:24): [True: 625, False: 9.26k]
  |  |  ------------------
  ------------------
  250|    625|    if (len >= 4) {
  ------------------
  |  Branch (250:9): [True: 611, False: 14]
  ------------------
  251|    611|      seed ^= len;
  252|    611|      if (len >= 8) {
  ------------------
  |  Branch (252:11): [True: 567, False: 44]
  ------------------
  253|    567|        const uint8_t* plast = p + len - 8;
  254|    567|        a = rapid_read64(p);
  255|    567|        b = rapid_read64(plast);
  256|    567|      } else {
  257|     44|        const uint8_t* plast = p + len - 4;
  258|     44|        a = rapid_read32(p);
  259|     44|        b = rapid_read32(plast);
  260|     44|      }
  261|    611|    } else if (len > 0) {
  ------------------
  |  Branch (261:16): [True: 14, False: 0]
  ------------------
  262|     14|      a = (((uint64_t)p[0])<<45)|p[len-1];
  263|     14|      b = p[len>>1];
  264|     14|    } else
  265|      0|      a = b = 0;
  266|  9.26k|  } else {
  267|  9.26k|    if (len > 112) {
  ------------------
  |  Branch (267:9): [True: 7.61k, False: 1.65k]
  ------------------
  268|  7.61k|      uint64_t see1 = seed, see2 = seed;
  269|  7.61k|      uint64_t see3 = seed, see4 = seed;
  270|  7.61k|      uint64_t see5 = seed, see6 = seed;
  271|  7.61k|#ifdef RAPIDHASH_COMPACT
  272|  1.95M|      do {
  273|  1.95M|        seed = rapid_mix(rapid_read64(p) ^ secret[0], rapid_read64(p + 8) ^ seed);
  274|  1.95M|        see1 = rapid_mix(rapid_read64(p + 16) ^ secret[1], rapid_read64(p + 24) ^ see1);
  275|  1.95M|        see2 = rapid_mix(rapid_read64(p + 32) ^ secret[2], rapid_read64(p + 40) ^ see2);
  276|  1.95M|        see3 = rapid_mix(rapid_read64(p + 48) ^ secret[3], rapid_read64(p + 56) ^ see3);
  277|  1.95M|        see4 = rapid_mix(rapid_read64(p + 64) ^ secret[4], rapid_read64(p + 72) ^ see4);
  278|  1.95M|        see5 = rapid_mix(rapid_read64(p + 80) ^ secret[5], rapid_read64(p + 88) ^ see5);
  279|  1.95M|        see6 = rapid_mix(rapid_read64(p + 96) ^ secret[6], rapid_read64(p + 104) ^ see6);
  280|  1.95M|        p += 112;
  281|  1.95M|        i -= 112;
  282|  1.95M|      } while(i > 112);
  ------------------
  |  Branch (282:15): [True: 1.95M, False: 7.61k]
  ------------------
  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|  7.61k|      seed ^= see1;
  315|  7.61k|      see2 ^= see3;
  316|  7.61k|      see4 ^= see5;
  317|  7.61k|      seed ^= see6;
  318|  7.61k|      see2 ^= see4;
  319|  7.61k|      seed ^= see2;
  320|  7.61k|    }
  321|  9.26k|    if (i > 16) {
  ------------------
  |  Branch (321:9): [True: 8.38k, False: 876]
  ------------------
  322|  8.38k|      seed = rapid_mix(rapid_read64(p) ^ secret[2], rapid_read64(p + 8) ^ seed);
  323|  8.38k|      if (i > 32) {
  ------------------
  |  Branch (323:11): [True: 6.42k, False: 1.96k]
  ------------------
  324|  6.42k|          seed = rapid_mix(rapid_read64(p + 16) ^ secret[2], rapid_read64(p + 24) ^ seed);
  325|  6.42k|          if (i > 48) {
  ------------------
  |  Branch (325:15): [True: 5.06k, False: 1.36k]
  ------------------
  326|  5.06k|              seed = rapid_mix(rapid_read64(p + 32) ^ secret[1], rapid_read64(p + 40) ^ seed);
  327|  5.06k|              if (i > 64) {
  ------------------
  |  Branch (327:19): [True: 3.40k, False: 1.66k]
  ------------------
  328|  3.40k|                  seed = rapid_mix(rapid_read64(p + 48) ^ secret[1], rapid_read64(p + 56) ^ seed);
  329|  3.40k|                  if (i > 80) {
  ------------------
  |  Branch (329:23): [True: 2.00k, False: 1.39k]
  ------------------
  330|  2.00k|                      seed = rapid_mix(rapid_read64(p + 64) ^ secret[2], rapid_read64(p + 72) ^ seed);
  331|  2.00k|                      if (i > 96) {
  ------------------
  |  Branch (331:27): [True: 915, False: 1.09k]
  ------------------
  332|    915|                          seed = rapid_mix(rapid_read64(p + 80) ^ secret[1], rapid_read64(p + 88) ^ seed);
  333|    915|                      }
  334|  2.00k|                  }
  335|  3.40k|              }
  336|  5.06k|          }
  337|  6.42k|      }
  338|  8.38k|    }
  339|  9.26k|    a=rapid_read64(p+i-16) ^ i;  b=rapid_read64(p+i-8);
  340|  9.26k|  }
  341|  9.88k|  a ^= secret[1];
  342|  9.88k|  b ^= seed;
  343|  9.88k|  rapid_mum(&a, &b);
  344|  9.88k|  return rapid_mix(a ^ secret[7], b ^ secret[1] ^ i);
  345|  9.88k|}
zxc_compress.c:rapid_mix:
  209|  13.7M|  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|  27.4M| 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|     88| 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|  13.7M| RAPIDHASH_INLINE_CONSTEXPR void rapid_mum(uint64_t *A, uint64_t *B) RAPIDHASH_NOEXCEPT {
  158|  13.7M| #if defined(__SIZEOF_INT128__)
  159|  13.7M|   __uint128_t r=*A; r*=*B;
  160|       |   #ifdef RAPIDHASH_PROTECTED
  161|       |   *A^=(uint64_t)r; *B^=(uint64_t)(r>>64);
  162|       |   #else
  163|  13.7M|   *A=(uint64_t)r; *B=(uint64_t)(r>>64);
  164|  13.7M|   #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|  13.7M| }
zxc_decompress.c:rapidhash_withSeed:
  487|  41.1k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_withSeed(const void *key, size_t len, uint64_t seed) RAPIDHASH_NOEXCEPT {
  488|  41.1k|  return rapidhash_internal(key, len, seed, rapid_secret);
  489|  41.1k|}
zxc_decompress.c:rapidhash_internal:
  244|  41.1k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_internal(const void *key, size_t len, uint64_t seed, const uint64_t* secret) RAPIDHASH_NOEXCEPT {
  245|  41.1k|  const uint8_t *p=(const uint8_t *)key;
  246|  41.1k|  seed ^= rapid_mix(seed ^ secret[2], secret[1]);
  247|  41.1k|  uint64_t a=0, b=0;
  248|  41.1k|  size_t i = len;
  249|  41.1k|  if (_likely_(len <= 16)) {
  ------------------
  |  |  107|  41.1k| # define _likely_(x)  __builtin_expect(x,1)
  |  |  ------------------
  |  |  |  Branch (107:24): [True: 2.68k, False: 38.4k]
  |  |  ------------------
  ------------------
  250|  2.68k|    if (len >= 4) {
  ------------------
  |  Branch (250:9): [True: 2.53k, False: 158]
  ------------------
  251|  2.53k|      seed ^= len;
  252|  2.53k|      if (len >= 8) {
  ------------------
  |  Branch (252:11): [True: 2.34k, False: 188]
  ------------------
  253|  2.34k|        const uint8_t* plast = p + len - 8;
  254|  2.34k|        a = rapid_read64(p);
  255|  2.34k|        b = rapid_read64(plast);
  256|  2.34k|      } else {
  257|    188|        const uint8_t* plast = p + len - 4;
  258|    188|        a = rapid_read32(p);
  259|    188|        b = rapid_read32(plast);
  260|    188|      }
  261|  2.53k|    } else if (len > 0) {
  ------------------
  |  Branch (261:16): [True: 68, False: 90]
  ------------------
  262|     68|      a = (((uint64_t)p[0])<<45)|p[len-1];
  263|     68|      b = p[len>>1];
  264|     68|    } else
  265|     90|      a = b = 0;
  266|  38.4k|  } else {
  267|  38.4k|    if (len > 112) {
  ------------------
  |  Branch (267:9): [True: 31.8k, False: 6.63k]
  ------------------
  268|  31.8k|      uint64_t see1 = seed, see2 = seed;
  269|  31.8k|      uint64_t see3 = seed, see4 = seed;
  270|  31.8k|      uint64_t see5 = seed, see6 = seed;
  271|  31.8k|#ifdef RAPIDHASH_COMPACT
  272|  8.43M|      do {
  273|  8.43M|        seed = rapid_mix(rapid_read64(p) ^ secret[0], rapid_read64(p + 8) ^ seed);
  274|  8.43M|        see1 = rapid_mix(rapid_read64(p + 16) ^ secret[1], rapid_read64(p + 24) ^ see1);
  275|  8.43M|        see2 = rapid_mix(rapid_read64(p + 32) ^ secret[2], rapid_read64(p + 40) ^ see2);
  276|  8.43M|        see3 = rapid_mix(rapid_read64(p + 48) ^ secret[3], rapid_read64(p + 56) ^ see3);
  277|  8.43M|        see4 = rapid_mix(rapid_read64(p + 64) ^ secret[4], rapid_read64(p + 72) ^ see4);
  278|  8.43M|        see5 = rapid_mix(rapid_read64(p + 80) ^ secret[5], rapid_read64(p + 88) ^ see5);
  279|  8.43M|        see6 = rapid_mix(rapid_read64(p + 96) ^ secret[6], rapid_read64(p + 104) ^ see6);
  280|  8.43M|        p += 112;
  281|  8.43M|        i -= 112;
  282|  8.43M|      } while(i > 112);
  ------------------
  |  Branch (282:15): [True: 8.40M, False: 31.8k]
  ------------------
  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|  31.8k|      seed ^= see1;
  315|  31.8k|      see2 ^= see3;
  316|  31.8k|      see4 ^= see5;
  317|  31.8k|      seed ^= see6;
  318|  31.8k|      see2 ^= see4;
  319|  31.8k|      seed ^= see2;
  320|  31.8k|    }
  321|  38.4k|    if (i > 16) {
  ------------------
  |  Branch (321:9): [True: 34.8k, False: 3.68k]
  ------------------
  322|  34.8k|      seed = rapid_mix(rapid_read64(p) ^ secret[2], rapid_read64(p + 8) ^ seed);
  323|  34.8k|      if (i > 32) {
  ------------------
  |  Branch (323:11): [True: 26.7k, False: 8.05k]
  ------------------
  324|  26.7k|          seed = rapid_mix(rapid_read64(p + 16) ^ secret[2], rapid_read64(p + 24) ^ seed);
  325|  26.7k|          if (i > 48) {
  ------------------
  |  Branch (325:15): [True: 21.0k, False: 5.65k]
  ------------------
  326|  21.0k|              seed = rapid_mix(rapid_read64(p + 32) ^ secret[1], rapid_read64(p + 40) ^ seed);
  327|  21.0k|              if (i > 64) {
  ------------------
  |  Branch (327:19): [True: 14.2k, False: 6.87k]
  ------------------
  328|  14.2k|                  seed = rapid_mix(rapid_read64(p + 48) ^ secret[1], rapid_read64(p + 56) ^ seed);
  329|  14.2k|                  if (i > 80) {
  ------------------
  |  Branch (329:23): [True: 8.40k, False: 5.81k]
  ------------------
  330|  8.40k|                      seed = rapid_mix(rapid_read64(p + 64) ^ secret[2], rapid_read64(p + 72) ^ seed);
  331|  8.40k|                      if (i > 96) {
  ------------------
  |  Branch (331:27): [True: 3.85k, False: 4.54k]
  ------------------
  332|  3.85k|                          seed = rapid_mix(rapid_read64(p + 80) ^ secret[1], rapid_read64(p + 88) ^ seed);
  333|  3.85k|                      }
  334|  8.40k|                  }
  335|  14.2k|              }
  336|  21.0k|          }
  337|  26.7k|      }
  338|  34.8k|    }
  339|  38.4k|    a=rapid_read64(p+i-16) ^ i;  b=rapid_read64(p+i-8);
  340|  38.4k|  }
  341|  41.1k|  a ^= secret[1];
  342|  41.1k|  b ^= seed;
  343|  41.1k|  rapid_mum(&a, &b);
  344|  41.1k|  return rapid_mix(a ^ secret[7], b ^ secret[1] ^ i);
  345|  41.1k|}
zxc_decompress.c:rapid_mix:
  209|  59.2M|  RAPIDHASH_INLINE_CONSTEXPR uint64_t rapid_mix(uint64_t A, uint64_t B) RAPIDHASH_NOEXCEPT { rapid_mum(&A,&B); return A^B; }
zxc_decompress.c:rapid_read64:
  215|   118M| RAPIDHASH_INLINE uint64_t rapid_read64(const uint8_t *p) RAPIDHASH_NOEXCEPT { uint64_t v; memcpy(&v, p, sizeof(uint64_t)); return v;}
zxc_decompress.c:rapid_read32:
  216|    376| RAPIDHASH_INLINE uint64_t rapid_read32(const uint8_t *p) RAPIDHASH_NOEXCEPT { uint32_t v; memcpy(&v, p, sizeof(uint32_t)); return v;}
zxc_decompress.c:rapid_mum:
  157|  59.2M| RAPIDHASH_INLINE_CONSTEXPR void rapid_mum(uint64_t *A, uint64_t *B) RAPIDHASH_NOEXCEPT {
  158|  59.2M| #if defined(__SIZEOF_INT128__)
  159|  59.2M|   __uint128_t r=*A; r*=*B;
  160|       |   #ifdef RAPIDHASH_PROTECTED
  161|       |   *A^=(uint64_t)r; *B^=(uint64_t)(r>>64);
  162|       |   #else
  163|  59.2M|   *A=(uint64_t)r; *B=(uint64_t)(r>>64);
  164|  59.2M|   #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|  59.2M| }

zxc_cctx_compute_workspace_size:
  226|  35.2k|                                       const size_t dict_size) {
  227|  35.2k|    if (UNLIKELY(chunk_size == 0)) return 0;
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 35.2k]
  |  |  ------------------
  ------------------
  228|  35.2k|    return compute_cctx_layout(chunk_size, mode, level, dict_size, 0).total;
  229|  35.2k|}
zxc_cctx_init_in_workspace:
  243|  85.6k|                               const int defer_entropy_scratch) {
  244|  85.6k|    if (UNLIKELY(!ctx || !workspace || chunk_size == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  152|   342k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 85.6k]
  |  |  |  Branch (152:42): [True: 0, False: 85.6k]
  |  |  |  Branch (152:42): [True: 0, False: 85.6k]
  |  |  |  Branch (152:42): [True: 0, False: 85.6k]
  |  |  ------------------
  ------------------
  245|       |
  246|  85.6k|    const zxc_cctx_layout_t layout =
  247|  85.6k|        compute_cctx_layout(chunk_size, mode, level, dict_size, defer_entropy_scratch);
  248|  85.6k|    if (UNLIKELY(workspace_size < layout.total)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  85.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 85.6k]
  |  |  ------------------
  ------------------
  249|       |
  250|  85.6k|    ZXC_MEMSET(ctx, 0, sizeof(zxc_cctx_t));
  ------------------
  |  |  173|  85.6k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  251|  85.6k|    ctx->checksum_enabled = checksum_enabled;
  252|  85.6k|    ctx->chunk_size = chunk_size;
  253|  85.6k|    const uint32_t offset_bits = zxc_log2_u32((uint32_t)chunk_size);
  254|  85.6k|    ctx->offset_bits = offset_bits;
  255|  85.6k|    ctx->offset_mask = (uint32_t)((1ULL << offset_bits) - 1);
  256|  85.6k|    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|  85.6k|    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|  85.6k|    ctx->dict_size = dict_size;
  266|  85.6k|    if (dict_size > 0) {
  ------------------
  |  Branch (266:9): [True: 0, False: 85.6k]
  ------------------
  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|  85.6k|    if (mode == 0) {
  ------------------
  |  Branch (272:9): [True: 68.0k, False: 17.6k]
  ------------------
  273|  68.0k|        ctx->work_buf = mem + layout.off_work;
  274|  68.0k|        ctx->work_buf_cap = chunk_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  372|  68.0k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|  68.0k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  68.0k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|  68.0k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  68.0k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  68.0k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  68.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|  68.0k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  275|  68.0k|        ctx->lit_buffer = mem + layout.off_lit_dctx;
  276|  68.0k|        ctx->lit_buffer_cap = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  342|  68.0k|#define ZXC_PAD_SIZE 32
  ------------------
  277|  68.0k|        if (layout.sz_pivco_dctx) {
  ------------------
  |  Branch (277:13): [True: 35.2k, False: 32.7k]
  ------------------
  278|  35.2k|            ctx->tok_buffer = mem + layout.off_tok_dctx;
  279|  35.2k|            ctx->tok_buffer_cap = layout.sz_tok_dctx;
  280|  35.2k|            ctx->pivco_scratch = mem + layout.off_pivco_dctx;
  281|  35.2k|            ctx->pivco_scratch_cap = layout.sz_pivco_dctx;
  282|  35.2k|        }
  283|  68.0k|        return ZXC_OK;
  284|  68.0k|    }
  285|       |
  286|  17.6k|    ctx->hash_table = (uint32_t*)(mem + layout.off_hash_pos);
  287|  17.6k|    ctx->hash_tags = mem + layout.off_hash_tags;
  288|  17.6k|    ctx->chain_table = (uint16_t*)(mem + layout.off_chain);
  289|  17.6k|    ctx->buf_sequences = (uint32_t*)(mem + layout.off_seq_union);
  290|  17.6k|    ctx->buf_offsets = (uint16_t*)(mem + layout.off_seq_union);
  291|  17.6k|    ctx->buf_tokens = mem + layout.off_seq_union + layout.max_seq * sizeof(uint16_t);
  292|  17.6k|    ctx->buf_split = ctx->buf_tokens + layout.max_seq;
  293|  17.6k|    ctx->buf_split_hist = (zxc_spl_match_split_hist_t*)(void*)(mem + layout.off_split_hist);
  294|  17.6k|    ctx->buf_extras = mem + layout.off_extras;
  295|  17.6k|    ctx->literals = mem + layout.off_lit_cctx;
  296|  17.6k|    if (layout.sz_opt) {
  ------------------
  |  Branch (296:9): [True: 5.43k, False: 12.2k]
  ------------------
  297|  5.43k|        ctx->opt_scratch = mem + layout.off_opt;
  298|  5.43k|        ctx->opt_scratch_cap = layout.sz_opt;
  299|  5.43k|    }
  300|       |
  301|  17.6k|    ctx->compression_level = level;
  302|  17.6k|    ctx->epoch = 1;
  303|       |
  304|  17.6k|    ZXC_MEMSET(ctx->hash_table, 0, layout.sz_hash_pos);
  ------------------
  |  |  173|  17.6k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  305|  17.6k|    ZXC_MEMSET(ctx->hash_tags, 0, layout.sz_hash_tags);
  ------------------
  |  |  173|  17.6k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  306|  17.6k|    return ZXC_OK;
  307|  85.6k|}
zxc_dict_snap_size:
  311|  17.6k|size_t zxc_dict_snap_size(const size_t dict_size) {
  312|       |    // List positions are 16-bit.
  313|  17.6k|    if (dict_size < ZXC_LZ_MIN_MATCH_LEN || dict_size > ZXC_DICT_SIZE_MAX) return 0;
  ------------------
  |  |  586|  35.2k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
                  if (dict_size < ZXC_LZ_MIN_MATCH_LEN || dict_size > ZXC_DICT_SIZE_MAX) return 0;
  ------------------
  |  |   94|      0|#define ZXC_DICT_SIZE_MAX ((1U << 16) - 1U)
  ------------------
  |  Branch (313:9): [True: 17.6k, False: 0]
  |  Branch (313:45): [True: 0, False: 0]
  ------------------
  314|      0|    return ZXC_DICT_SNAP_HDR_SIZE + ZXC_DICT_SNAP_TABLES_SIZE + dict_size * sizeof(uint16_t) +
  ------------------
  |  |  309|      0|#define ZXC_DICT_SNAP_HDR_SIZE ((sizeof(zxc_dict_snap_t) + 7) & ~(size_t)7)
  ------------------
                  return ZXC_DICT_SNAP_HDR_SIZE + ZXC_DICT_SNAP_TABLES_SIZE + dict_size * sizeof(uint16_t) +
  ------------------
  |  | 2094|      0|#define ZXC_DICT_SNAP_TABLES_SIZE (ZXC_LZ_HASH_SIZE * (sizeof(uint32_t) + sizeof(uint8_t)))
  |  |  ------------------
  |  |  |  |  580|      0|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  578|      0|#define ZXC_LZ_HASH_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|      0|           dict_size;
  316|  17.6k|}
zxc_cctx_init:
  344|  50.3k|                  const int level, const int checksum_enabled, const size_t dict_size) {
  345|       |    // Cleared first, so that zxc_cctx_free is safe after a failure.
  346|  50.3k|    ZXC_MEMSET(ctx, 0, sizeof(*ctx));
  ------------------
  |  |  173|  50.3k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  347|  50.3k|    if (UNLIKELY(chunk_size == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  152|  50.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 50.3k]
  |  |  ------------------
  ------------------
  348|       |    // Heap contexts defer the decode-side entropy scratch to the first entropy
  349|       |    // section; static workspaces must have it already, they may never allocate.
  350|  50.3k|    const int defer_entropy = (mode == 0);
  351|  50.3k|    const size_t total =
  352|  50.3k|        compute_cctx_layout(chunk_size, mode, level, dict_size, defer_entropy).total;
  353|  50.3k|    if (UNLIKELY(total == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  152|  50.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 50.3k]
  |  |  ------------------
  ------------------
  354|       |
  355|  50.3k|    uint8_t* const mem = (uint8_t*)ZXC_ALIGNED_MALLOC(total, ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  134|  50.3k|#define ZXC_ALIGNED_MALLOC(size, alignment) zxc_aligned_malloc(size, alignment)
  ------------------
  356|  50.3k|    if (UNLIKELY(!mem)) return ZXC_ERROR_MEMORY;
  ------------------
  |  |  152|  50.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 50.3k]
  |  |  ------------------
  ------------------
  357|       |
  358|  50.3k|    const int rc = zxc_cctx_init_in_workspace(ctx, mem, total, chunk_size, mode, level,
  359|  50.3k|                                              checksum_enabled, dict_size, defer_entropy);
  360|  50.3k|    if (UNLIKELY(rc != ZXC_OK)) {
  ------------------
  |  |  152|  50.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 50.3k]
  |  |  ------------------
  ------------------
  361|       |        // LCOV_EXCL_START
  362|      0|        ZXC_ALIGNED_FREE(mem);
  ------------------
  |  |  137|      0|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  363|      0|        return rc;
  364|       |        // LCOV_EXCL_STOP
  365|      0|    }
  366|       |    // Library-owned buffer: record the allocation so zxc_cctx_free frees it.
  367|  50.3k|    ctx->memory_block = mem;
  368|       |    // Allocated with the workspace, so that blocks never allocate.
  369|  50.3k|    if (mode == 1) ctx->dict_snap = zxc_dict_snap_create(dict_size);
  ------------------
  |  Branch (369:9): [True: 17.6k, False: 32.7k]
  ------------------
  370|  50.3k|    return ZXC_OK;
  371|  50.3k|}
zxc_cctx_alloc_entropy_scratch:
  381|  4.24k|int zxc_cctx_alloc_entropy_scratch(zxc_cctx_t* ctx) {
  382|  4.24k|    if (LIKELY(ctx->pivco_scratch)) return ZXC_OK;
  ------------------
  |  |  146|  4.24k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 0, False: 4.24k]
  |  |  ------------------
  ------------------
  383|       |
  384|       |    // Sized for the block the context was carved for, not chunk_size: a reader
  385|       |    // over frames of several block sizes lowers chunk_size per block.
  386|  4.24k|    size_t sz_tok = 0;
  387|  4.24k|    size_t sz_pivco = 0;
  388|  4.24k|    zxc_dctx_entropy_sizes(ctx->work_buf_cap - ZXC_DECOMPRESS_TAIL_PAD, &sz_tok, &sz_pivco);
  ------------------
  |  |  372|  4.24k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|  4.24k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  4.24k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|  4.24k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  4.24k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  4.24k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  4.24k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|  4.24k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  389|  4.24k|    const size_t total = ZXC_ALIGN_CL(sz_tok) + ZXC_ALIGN_CL(sz_pivco);
  ------------------
  |  |  384|  4.24k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  4.24k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  4.24k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  4.24k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  4.24k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const size_t total = ZXC_ALIGN_CL(sz_tok) + ZXC_ALIGN_CL(sz_pivco);
  ------------------
  |  |  384|  4.24k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  4.24k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  4.24k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  4.24k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  4.24k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|       |
  391|  4.24k|    uint8_t* const mem = (uint8_t*)ZXC_ALIGNED_MALLOC(total, ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  134|  4.24k|#define ZXC_ALIGNED_MALLOC(size, alignment) zxc_aligned_malloc(size, alignment)
  ------------------
  392|  4.24k|    if (UNLIKELY(!mem)) return ZXC_ERROR_MEMORY;  // LCOV_EXCL_LINE
  ------------------
  |  |  152|  4.24k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.24k]
  |  |  ------------------
  ------------------
  393|       |
  394|  4.24k|    ctx->entropy_block = mem;
  395|  4.24k|    ctx->tok_buffer = mem;
  396|  4.24k|    ctx->tok_buffer_cap = sz_tok;
  397|  4.24k|    ctx->pivco_scratch = mem + ZXC_ALIGN_CL(sz_tok);
  ------------------
  |  |  384|  4.24k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  4.24k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  4.24k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  4.24k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  4.24k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  398|  4.24k|    ctx->pivco_scratch_cap = sz_pivco;
  399|  4.24k|    return ZXC_OK;
  400|  4.24k|}
zxc_cctx_free:
  408|  50.3k|void zxc_cctx_free(zxc_cctx_t* ctx) {
  409|  50.3k|    if (ctx->memory_block) {
  ------------------
  |  Branch (409:9): [True: 50.3k, False: 0]
  ------------------
  410|  50.3k|        ZXC_ALIGNED_FREE(ctx->memory_block);
  ------------------
  |  |  137|  50.3k|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  411|  50.3k|        ctx->memory_block = NULL;
  412|  50.3k|    }
  413|  50.3k|    if (ctx->entropy_block) {
  ------------------
  |  Branch (413:9): [True: 4.24k, False: 46.1k]
  ------------------
  414|  4.24k|        ZXC_ALIGNED_FREE(ctx->entropy_block);
  ------------------
  |  |  137|  4.24k|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  415|  4.24k|        ctx->entropy_block = NULL;
  416|  4.24k|    }
  417|  50.3k|    ZXC_FREE(ctx->dict_snap);
  ------------------
  |  |   86|  50.3k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  418|  50.3k|    ctx->dict_snap = NULL;
  419|  50.3k|    ctx->dict_buffer_gen = 0;
  420|       |
  421|  50.3k|    ctx->lit_buffer = NULL;
  422|  50.3k|    ctx->hash_table = NULL;
  423|  50.3k|    ctx->hash_tags = NULL;
  424|  50.3k|    ctx->chain_table = NULL;
  425|  50.3k|    ctx->buf_sequences = NULL;
  426|  50.3k|    ctx->buf_tokens = NULL;
  427|  50.3k|    ctx->buf_offsets = NULL;
  428|  50.3k|    ctx->buf_extras = NULL;
  429|  50.3k|    ctx->buf_split = NULL;
  430|  50.3k|    ctx->buf_split_hist = NULL;
  431|  50.3k|    ctx->literals = NULL;
  432|  50.3k|    ctx->work_buf = NULL;
  433|  50.3k|    ctx->tok_buffer = NULL;
  434|  50.3k|    ctx->pivco_scratch = NULL;
  435|  50.3k|    ctx->opt_scratch = NULL;
  436|  50.3k|    ctx->dict_buffer = NULL;
  437|  50.3k|    ctx->dict_huf = NULL;
  438|       |
  439|  50.3k|    ctx->epoch = 0;
  440|  50.3k|    ctx->lit_buffer_cap = 0;
  441|  50.3k|    ctx->work_buf_cap = 0;
  442|  50.3k|    ctx->tok_buffer_cap = 0;
  443|  50.3k|    ctx->pivco_scratch_cap = 0;
  444|  50.3k|    ctx->opt_scratch_cap = 0;
  445|  50.3k|    ctx->dict_buffer_cap = 0;
  446|  50.3k|    ctx->dict_size = 0;
  447|  50.3k|    ctx->dict_huf_tree_ok = 0;
  448|       |    ctx->lit_freq_acc = NULL;
  449|  50.3k|}
zxc_write_block_header:
  710|  23.0k|                           const zxc_block_header_t* RESTRICT bh) {
  711|  23.0k|    if (UNLIKELY(dst_capacity < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  23.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 23.0k]
  |  |  ------------------
  ------------------
  712|       |
  713|  23.0k|    dst[0] = bh->block_type;
  714|  23.0k|    dst[1] = 0;  // Flags not used currently
  715|  23.0k|    dst[2] = 0;  // Reserved
  716|  23.0k|    zxc_store_le32(dst + 3, bh->comp_size);
  717|  23.0k|    dst[7] = 0;               // Zero before hashing
  718|  23.0k|    dst[7] = zxc_hash8(dst);  // Checksum at the end
  719|       |
  720|  23.0k|    return ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  439|  23.0k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  721|  23.0k|}
zxc_write_spl_header_and_desc:
  964|  13.6k|                                  const uint32_t tok_comp) {
  965|  13.6k|    const size_t desc_sz = zxc_spl_desc_size(gh->enc_lit, gh->enc_tok);
  966|  13.6k|    const size_t needed = ZXC_SPL_HEADER_BINARY_SIZE + desc_sz;
  ------------------
  |  |  443|  13.6k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  967|       |
  968|  13.6k|    if (UNLIKELY(rem < needed)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
  969|       |
  970|  13.6k|    zxc_write_gnr_header(dst, gh);
  971|  13.6k|    uint8_t* p = dst + ZXC_SPL_HEADER_BINARY_SIZE;
  ------------------
  |  |  443|  13.6k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  972|       |
  973|  13.6k|    if (gh->enc_lit != ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (973:9): [True: 7.97k, False: 5.64k]
  ------------------
  974|  7.97k|        zxc_store_le32(p, lit_comp);
  975|  7.97k|        p += sizeof(uint32_t);
  976|  7.97k|    }
  977|  13.6k|    if (gh->enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) {
  ------------------
  |  Branch (977:9): [True: 1.96k, False: 11.6k]
  ------------------
  978|  1.96k|        zxc_store_le32(p, tok_comp);
  979|  1.96k|    }
  980|       |
  981|  13.6k|    return (int)needed;
  982|  13.6k|}
zxc_read_spl_header_and_desc:
  989|  68.2k|                                 uint32_t* RESTRICT tok_comp) {
  990|  68.2k|    if (UNLIKELY(len < ZXC_SPL_HEADER_BINARY_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  152|  68.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 21, False: 68.2k]
  |  |  ------------------
  ------------------
  991|       |
  992|  68.2k|    zxc_read_gnr_header(src, gh);
  993|       |
  994|  68.2k|    const size_t desc_sz = zxc_spl_desc_size(gh->enc_lit, gh->enc_tok);
  995|  68.2k|    const size_t needed = ZXC_SPL_HEADER_BINARY_SIZE + desc_sz;
  ------------------
  |  |  443|  68.2k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  996|  68.2k|    if (UNLIKELY(len < needed)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  152|  68.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 9, False: 68.2k]
  |  |  ------------------
  ------------------
  997|       |
  998|  68.2k|    const uint8_t* p = src + ZXC_SPL_HEADER_BINARY_SIZE;
  ------------------
  |  |  443|  68.2k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  999|       |
 1000|  68.2k|    if (gh->enc_lit != ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (1000:9): [True: 33.2k, False: 35.0k]
  ------------------
 1001|  33.2k|        *lit_comp = zxc_le32(p);
 1002|  33.2k|        p += sizeof(uint32_t);
 1003|  35.0k|    } else {
 1004|  35.0k|        *lit_comp = gh->n_literals;
 1005|  35.0k|    }
 1006|  68.2k|    *tok_comp = (gh->enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? zxc_le32(p) : gh->n_sequences;
  ------------------
  |  Branch (1006:17): [True: 29.1k, False: 39.0k]
  ------------------
 1007|       |
 1008|  68.2k|    return (int)needed;
 1009|  68.2k|}
zxc_write_pak_header:
 1020|  4.01k|                         const zxc_gnr_header_t* RESTRICT gh) {
 1021|  4.01k|    if (UNLIKELY(rem < ZXC_PAK_HEADER_BINARY_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  4.01k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.01k]
  |  |  ------------------
  ------------------
 1022|       |
 1023|  4.01k|    zxc_write_gnr_header(dst, gh);
 1024|  4.01k|    return ZXC_PAK_HEADER_BINARY_SIZE;
  ------------------
  |  |  445|  4.01k|#define ZXC_PAK_HEADER_BINARY_SIZE 12
  ------------------
 1025|  4.01k|}
zxc_read_pak_header:
 1031|  15.6k|                        zxc_gnr_header_t* RESTRICT gh) {
 1032|  15.6k|    if (UNLIKELY(len < ZXC_PAK_HEADER_BINARY_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  152|  15.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 6, False: 15.6k]
  |  |  ------------------
  ------------------
 1033|       |
 1034|  15.6k|    zxc_read_gnr_header(src, gh);
 1035|  15.6k|    return ZXC_OK;
 1036|  15.6k|}
zxc_compress_block_bound:
 1070|  17.6k|size_t zxc_compress_block_bound(const size_t input_size) {
 1071|       |    // Mirrors the Block API contract: outside [1, ZXC_BLOCK_SIZE_MAX] the call
 1072|       |    // would fail anyway, so the bound is undefined and 0 says "unusable". The cap
 1073|       |    // also makes the addition below trivially overflow-free.
 1074|  17.6k|    if (UNLIKELY(input_size == 0 || input_size > ZXC_BLOCK_SIZE_MAX)) return 0;
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1075|       |    // Outer block header + payload (worst case: incompressible, raw bytes)
 1076|       |    // + inner format overhead + optional checksum.
 1077|  17.6k|    return ZXC_BLOCK_HEADER_SIZE + input_size + ZXC_BLOCK_FORMAT_OVERHEAD + ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  439|  17.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                  return ZXC_BLOCK_HEADER_SIZE + input_size + ZXC_BLOCK_FORMAT_OVERHEAD + ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  457|  17.6k|#define ZXC_BLOCK_FORMAT_OVERHEAD 68
  ------------------
                  return ZXC_BLOCK_HEADER_SIZE + input_size + ZXC_BLOCK_FORMAT_OVERHEAD + ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  441|  17.6k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
 1078|  17.6k|}
zxc_decompress_block_bound:
 1091|  17.6k|size_t zxc_decompress_block_bound(const size_t uncompressed_size) {
 1092|  17.6k|    if (UNLIKELY(uncompressed_size > ZXC_BLOCK_SIZE_MAX)) return 0;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1093|  17.6k|    return uncompressed_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  372|  17.6k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|  17.6k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  17.6k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|  17.6k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  17.6k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  17.6k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  17.6k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|  17.6k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
 1094|  17.6k|}
zxc_max_level:
 1198|  17.6k|int zxc_max_level(void) { return ZXC_LEVEL_ULTRA; }
zxc_common.c:compute_cctx_layout:
  122|   171k|                                             const int defer_entropy_scratch) {
  123|   171k|    zxc_cctx_layout_t layout = {0};
  124|       |
  125|   171k|    const size_t max_seq = zxc_cctx_max_seq(chunk_size);
  126|       |
  127|   171k|    if (mode == 0) {
  ------------------
  |  Branch (127:9): [True: 136k, False: 35.2k]
  ------------------
  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|   136k|        const size_t sz_work = chunk_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  372|   136k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|   136k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|   136k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|   136k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   136k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   136k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   136k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|   136k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  132|   136k|        const size_t sz_lit = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  342|   136k|#define ZXC_PAD_SIZE 32
  ------------------
  133|       |
  134|   136k|        layout.off_work = layout.total;
  135|   136k|        layout.total += ZXC_ALIGN_CL(sz_work);
  ------------------
  |  |  384|   136k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|   136k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   136k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|   136k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   136k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|   136k|        layout.off_lit_dctx = layout.total;
  137|   136k|        layout.total += ZXC_ALIGN_CL(sz_lit);
  ------------------
  |  |  384|   136k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|   136k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   136k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|   136k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|   136k|#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|   136k|        if (!defer_entropy_scratch) {
  ------------------
  |  Branch (143:13): [True: 70.5k, False: 65.4k]
  ------------------
  144|  70.5k|            size_t sz_tok = 0;
  145|  70.5k|            size_t sz_pivco = 0;
  146|  70.5k|            zxc_dctx_entropy_sizes(chunk_size, &sz_tok, &sz_pivco);
  147|  70.5k|            layout.sz_tok_dctx = sz_tok;
  148|  70.5k|            layout.off_tok_dctx = layout.total;
  149|  70.5k|            layout.total += ZXC_ALIGN_CL(layout.sz_tok_dctx);
  ------------------
  |  |  384|  70.5k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  70.5k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  70.5k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  70.5k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  70.5k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|  70.5k|            layout.sz_pivco_dctx = sz_pivco;
  151|  70.5k|            layout.off_pivco_dctx = layout.total;
  152|  70.5k|            layout.total += ZXC_ALIGN_CL(layout.sz_pivco_dctx);
  ------------------
  |  |  384|  70.5k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  70.5k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  70.5k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  70.5k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  70.5k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|  70.5k|        }
  154|   136k|    } else {
  155|       |        // Compress: 7 partitions + optional opt_scratch at level >= ZXC_LEVEL_DENSITY.
  156|  35.2k|        const uint32_t offset_bits = zxc_log2_u32((uint32_t)chunk_size);
  157|  35.2k|        layout.max_seq = max_seq;
  158|  35.2k|        layout.sz_hash_pos = ZXC_LZ_HASH_SIZE * sizeof(uint32_t);
  ------------------
  |  |  580|  35.2k|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  ------------------
  |  |  |  |  578|  35.2k|#define ZXC_LZ_HASH_BITS 15
  |  |  ------------------
  ------------------
  159|  35.2k|        layout.sz_hash_tags = ZXC_LZ_HASH_SIZE * sizeof(uint8_t);
  ------------------
  |  |  580|  35.2k|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  ------------------
  |  |  |  |  578|  35.2k|#define ZXC_LZ_HASH_BITS 15
  |  |  ------------------
  ------------------
  160|  35.2k|        const size_t sz_chain = ZXC_LZ_WINDOW_SIZE * sizeof(uint16_t);
  ------------------
  |  |  582|  35.2k|#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|  35.2k|        const size_t sz_seq_union = layout.max_seq * sizeof(uint32_t);
  164|  35.2k|        const size_t vbyte_len = (offset_bits + 6) / 7;
  165|  35.2k|        const size_t sz_extras = layout.max_seq * 2 * vbyte_len;
  166|  35.2k|        const size_t sz_lit = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  342|  35.2k|#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_memory() and its
  171|       |        // consumer in zxc_compress.c.
  172|  35.2k|        if (level >= ZXC_LEVEL_DENSITY) {
  ------------------
  |  Branch (172:13): [True: 10.8k, False: 24.4k]
  ------------------
  173|  10.8k|            size_t sz_dp;
  174|  10.8k|            size_t sz_pl;
  175|  10.8k|            size_t sz_po;
  176|  10.8k|            size_t sz_bm;
  177|  10.8k|            zxc_opt_dp_sizes(chunk_size, &sz_dp, &sz_pl, &sz_po, &sz_bm);
  178|  10.8k|            const size_t dp_needed = sz_dp + sz_pl + sz_po + sz_bm;
  179|  10.8k|            layout.sz_opt =
  180|  10.8k|                (dp_needed > ZXC_HUF_NUDGE_SCRATCH_SIZE) ? dp_needed : ZXC_HUF_NUDGE_SCRATCH_SIZE;
  ------------------
  |  | 1119|  10.8k|#define ZXC_HUF_NUDGE_SCRATCH_SIZE (ZXC_HUF_NUDGE_SCRATCH_OFF + sizeof(zxc_huf_nudge_ws_t))
  |  |  ------------------
  |  |  |  | 1117|  10.8k|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  384|  10.8k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (dp_needed > ZXC_HUF_NUDGE_SCRATCH_SIZE) ? dp_needed : ZXC_HUF_NUDGE_SCRATCH_SIZE;
  ------------------
  |  | 1119|  14.0k|#define ZXC_HUF_NUDGE_SCRATCH_SIZE (ZXC_HUF_NUDGE_SCRATCH_OFF + sizeof(zxc_huf_nudge_ws_t))
  |  |  ------------------
  |  |  |  | 1117|  3.17k|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  384|  3.17k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  382|  3.17k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  380|  3.17k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  382|  3.17k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  380|  3.17k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (180:17): [True: 7.69k, False: 3.17k]
  ------------------
  181|  10.8k|        }
  182|       |
  183|  35.2k|        layout.off_hash_pos = layout.total;
  184|  35.2k|        layout.total += ZXC_ALIGN_CL(layout.sz_hash_pos);
  ------------------
  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  35.2k|        layout.off_hash_tags = layout.total;
  186|  35.2k|        layout.total += ZXC_ALIGN_CL(layout.sz_hash_tags);
  ------------------
  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|  35.2k|        layout.off_chain = layout.total;
  188|  35.2k|        layout.total += ZXC_ALIGN_CL(sz_chain);
  ------------------
  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|  35.2k|        layout.off_seq_union = layout.total;
  190|  35.2k|        layout.total += ZXC_ALIGN_CL(sz_seq_union);
  ------------------
  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  35.2k|        layout.off_split_hist = layout.total;
  192|  35.2k|        layout.total += ZXC_ALIGN_CL(sizeof(zxc_spl_match_split_hist_t));
  ------------------
  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  35.2k|        layout.off_extras = layout.total;
  194|  35.2k|        layout.total += ZXC_ALIGN_CL(sz_extras);
  ------------------
  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  35.2k|        layout.off_lit_cctx = layout.total;
  196|  35.2k|        layout.total += ZXC_ALIGN_CL(sz_lit);
  ------------------
  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  35.2k|#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|  35.2k|        if (layout.sz_opt) {
  ------------------
  |  Branch (199:13): [True: 10.8k, False: 24.4k]
  ------------------
  200|  10.8k|            layout.off_opt = layout.total;
  201|  10.8k|            layout.total += ZXC_ALIGN_CL(layout.sz_opt);
  ------------------
  |  |  384|  10.8k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|  10.8k|        }
  203|  35.2k|    }
  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|   171k|    if (dict_size > 0) {
  ------------------
  |  Branch (207:9): [True: 0, False: 171k]
  ------------------
  208|      0|        layout.sz_dict = (mode == 1) ? (chunk_size + ZXC_DECOMPRESS_TAIL_PAD)
  ------------------
  |  |  372|      0|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|      0|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|      0|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|      0|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|      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 */
  |  |  ------------------
  |  |  |  |  342|      0|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (208:26): [True: 0, False: 0]
  ------------------
  209|      0|                                     : (dict_size + chunk_size + ZXC_DECOMPRESS_TAIL_PAD);
  ------------------
  |  |  372|      0|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|      0|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|      0|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|      0|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|      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 */
  |  |  ------------------
  |  |  |  |  342|      0|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  210|      0|        layout.off_dict = layout.total;
  211|      0|        layout.total += ZXC_ALIGN_CL(layout.sz_dict);
  ------------------
  |  |  384|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      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));
  ------------------
  |  |  384|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|      0|    }
  215|   171k|    return layout;
  216|   171k|}
zxc_common.c:zxc_cctx_max_seq:
   74|   246k|static ZXC_ALWAYS_INLINE size_t zxc_cctx_max_seq(const size_t chunk_size) {
   75|   246k|    return chunk_size / ZXC_LZ_MIN_MATCH_LEN + 16;
  ------------------
  |  |  586|   246k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
   76|   246k|}
zxc_common.c:zxc_dict_snap_create:
  319|  17.6k|static zxc_dict_snap_t* zxc_dict_snap_create(const size_t dict_size) {
  320|  17.6k|    const size_t total = zxc_dict_snap_size(dict_size);
  321|  17.6k|    if (total == 0) return NULL;
  ------------------
  |  Branch (321:9): [True: 17.6k, False: 0]
  ------------------
  322|      0|    uint8_t* const mem = (uint8_t*)ZXC_MALLOC(total);
  ------------------
  |  |   68|      0|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  323|      0|    if (UNLIKELY(!mem)) return NULL;  // LCOV_EXCL_LINE
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  324|      0|    zxc_dict_snap_t* const snap = (zxc_dict_snap_t*)mem;
  325|      0|    ZXC_MEMSET(snap, 0, sizeof(*snap));
  ------------------
  |  |  173|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  326|      0|    snap->capacity = dict_size;
  327|      0|    snap->tables = mem + ZXC_DICT_SNAP_HDR_SIZE;
  ------------------
  |  |  309|      0|#define ZXC_DICT_SNAP_HDR_SIZE ((sizeof(zxc_dict_snap_t) + 7) & ~(size_t)7)
  ------------------
  328|      0|    snap->chain = (uint16_t*)(snap->tables + ZXC_DICT_SNAP_TABLES_SIZE);
  ------------------
  |  | 2094|      0|#define ZXC_DICT_SNAP_TABLES_SIZE (ZXC_LZ_HASH_SIZE * (sizeof(uint32_t) + sizeof(uint8_t)))
  |  |  ------------------
  |  |  |  |  580|      0|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  578|      0|#define ZXC_LZ_HASH_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  329|      0|    snap->dict = (uint8_t*)(snap->chain + dict_size);
  330|      0|    return snap;
  331|      0|}
zxc_common.c:zxc_dctx_entropy_sizes:
   86|  74.7k|                                   size_t* RESTRICT sz_pivco) {
   87|  74.7k|    *sz_tok = zxc_cctx_max_seq(chunk_size) + ZXC_PAD_SIZE;
  ------------------
  |  |  342|  74.7k|#define ZXC_PAD_SIZE 32
  ------------------
   88|  74.7k|    *sz_pivco = chunk_size + ZXC_PIVCO_SCRATCH_PAD;
  ------------------
  |  | 1939|  74.7k|#define ZXC_PIVCO_SCRATCH_PAD 32
  ------------------
   89|  74.7k|}
zxc_common.c:zxc_spl_desc_size:
  948|  81.8k|static ZXC_ALWAYS_INLINE size_t zxc_spl_desc_size(const uint8_t enc_lit, const uint8_t enc_tok) {
  949|  81.8k|    return ((enc_lit != ZXC_SECTION_ENCODING_RAW) ? sizeof(uint32_t) : 0) +
  ------------------
  |  Branch (949:13): [True: 41.1k, False: 40.6k]
  ------------------
  950|  81.8k|           ((enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? sizeof(uint32_t) : 0);
  ------------------
  |  Branch (950:13): [True: 31.1k, False: 50.7k]
  ------------------
  951|  81.8k|}
zxc_common.c:zxc_write_gnr_header:
  916|  17.6k|                                                   const zxc_gnr_header_t* RESTRICT gh) {
  917|  17.6k|    zxc_store_le32(dst, gh->n_sequences);
  918|  17.6k|    zxc_store_le32(dst + 4, gh->n_literals);
  919|       |
  920|  17.6k|    dst[8] = gh->enc_lit;
  921|  17.6k|    dst[9] = gh->enc_tok;
  922|  17.6k|    dst[10] = gh->enc_mlen;
  923|  17.6k|    dst[11] = gh->enc_off;
  924|  17.6k|}
zxc_common.c:zxc_read_gnr_header:
  933|  83.8k|                                                  zxc_gnr_header_t* RESTRICT gh) {
  934|  83.8k|    gh->n_sequences = zxc_le32(src);
  935|  83.8k|    gh->n_literals = zxc_le32(src + 4);
  936|  83.8k|    gh->enc_lit = src[8];
  937|  83.8k|    gh->enc_tok = src[9];
  938|  83.8k|    gh->enc_mlen = src[10];
  939|  83.8k|    gh->enc_off = src[11];
  940|  83.8k|}

zxc_compress_chunk_wrapper_default:
 2659|  17.6k|                               const uint64_t block_index) {
 2660|  17.6k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 2661|       |
 2662|  17.6k|    const size_t dict_sz = ctx->dict_size;
 2663|  17.6k|    const size_t block_sz = src_sz - dict_sz;
 2664|  17.6k|    const uint8_t* block_data = chunk + dict_sz;
 2665|  17.6k|    size_t w = 0;
 2666|  17.6k|    int res = ZXC_OK;
 2667|       |
 2668|  17.6k|    if (ctx->compression_level <= 2)
  ------------------
  |  Branch (2668:9): [True: 4.01k, False: 13.6k]
  ------------------
 2669|  4.01k|        res = zxc_encode_block_pak(ctx, chunk, src_sz, dst, dst_cap, &w);
 2670|  13.6k|    else
 2671|  13.6k|        res = zxc_encode_block_spl(ctx, chunk, src_sz, dst, dst_cap, &w);
 2672|       |
 2673|       |    // Check expansion against block data size (excluding dict prefix).
 2674|  17.6k|    if (UNLIKELY(res != ZXC_OK || w >= block_sz)) {
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 5.41k, False: 12.2k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 5.41k, False: 12.2k]
  |  |  ------------------
  ------------------
 2675|  5.41k|        res = zxc_encode_block_raw(block_data, block_sz, dst, dst_cap, &w);
 2676|  5.41k|        if (UNLIKELY(res != ZXC_OK)) return res;
  ------------------
  |  |  152|  5.41k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.41k]
  |  |  ------------------
  ------------------
 2677|  5.41k|    }
 2678|       |
 2679|  17.6k|    if (ctx->checksum_enabled) {
  ------------------
  |  Branch (2679:9): [True: 9.88k, False: 7.74k]
  ------------------
 2680|  9.88k|        if (UNLIKELY(w + ZXC_BLOCK_CHECKSUM_SIZE > dst_cap)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  152|  9.88k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 9.88k]
  |  |  ------------------
  ------------------
 2681|       |
 2682|  9.88k|        zxc_store_le32(dst + w,
 2683|  9.88k|                       zxc_checksum(block_data, block_sz, block_index, ZXC_CHECKSUM_RAPIDHASH));
  ------------------
  |  |  463|  9.88k|#define ZXC_CHECKSUM_RAPIDHASH 0
  ------------------
 2684|  9.88k|        w += ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  441|  9.88k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
 2685|  9.88k|    }
 2686|       |
 2687|  17.6k|    return (int)w;
 2688|  17.6k|}
zxc_compress.c:zxc_encode_block_pak:
 2601|  4.01k|                                size_t* RESTRICT const out_sz) {
 2602|  4.01k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  4.01k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.01k]
  |  |  ------------------
  ------------------
 2603|       |
 2604|  4.01k|    uint32_t seq_c = 0;
 2605|  4.01k|    size_t lit_c = 0, extras_c = 0;
 2606|  4.01k|    const int rc = zxc_pak_parse(ctx, src, src_sz, &seq_c, &lit_c, &extras_c);
 2607|  4.01k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  4.01k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.01k]
  |  |  ------------------
  ------------------
 2608|  4.01k|    return zxc_pak_emit(ctx, seq_c, lit_c, extras_c, dst, dst_cap, out_sz);
 2609|  4.01k|}
zxc_compress.c:zxc_encode_block_spl:
 2352|  13.6k|                                size_t* RESTRICT out_sz) {
 2353|  13.6k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2354|       |
 2355|  13.6k|    uint32_t seq_c;
 2356|  13.6k|    size_t lit_c, extras_sz;
 2357|  13.6k|    uint16_t max_offset;
 2358|  13.6k|    const int rc = zxc_spl_parse(ctx, src, src_sz, &seq_c, &lit_c, &extras_sz, &max_offset);
 2359|  13.6k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2360|  13.6k|    return zxc_spl_emit(ctx, seq_c, lit_c, extras_sz, max_offset, dst, dst_cap, out_sz);
 2361|  13.6k|}
zxc_compress.c:zxc_encode_block_raw:
 2628|  5.41k|                                size_t* RESTRICT const out_sz) {
 2629|  5.41k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE + src_sz)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  5.41k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.41k]
  |  |  ------------------
  ------------------
 2630|       |
 2631|  5.41k|    zxc_block_header_t bh;
 2632|  5.41k|    bh.block_type = ZXC_BLOCK_RAW;
 2633|  5.41k|    bh.block_flags = 0;  // Checksum flag moved to file header
 2634|  5.41k|    bh.reserved = 0;
 2635|  5.41k|    bh.comp_size = (uint32_t)src_sz;
 2636|       |
 2637|  5.41k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 2638|  5.41k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  152|  5.41k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.41k]
  |  |  ------------------
  ------------------
 2639|       |
 2640|  5.41k|    ZXC_MEMCPY(dst + ZXC_BLOCK_HEADER_SIZE, src, src_sz);
  ------------------
  |  |  168|  5.41k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2641|       |
 2642|       |    // Checksum will be appended by the wrapper
 2643|  5.41k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + src_sz;
  ------------------
  |  |  439|  5.41k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2644|  5.41k|    return ZXC_OK;
 2645|  5.41k|}
zxc_compress.c:zxc_pak_parse:
 2508|  4.01k|                         size_t* RESTRICT extras_c) {
 2509|  4.01k|    const int level = ctx->compression_level;
 2510|  4.01k|    const size_t dict_sz = ctx->dict_size;
 2511|       |
 2512|  4.01k|    zxc_lz77_params_t lzp = zxc_get_lz77_params(level);
 2513|       |    // The floor is a candidate until the block itself clears it.
 2514|  4.01k|    if (lzp.min_offset > 1 && zxc_block_is_short_dist_bound(src + dict_sz, src_sz - dict_sz))
  ------------------
  |  Branch (2514:9): [True: 4.01k, False: 0]
  |  Branch (2514:31): [True: 3.21k, False: 796]
  ------------------
 2515|  3.21k|        lzp.min_offset = 1;
 2516|       |
 2517|  4.01k|    const uint32_t epoch_mark = zxc_lz_begin_block(ctx, src, dict_sz, level);
 2518|       |
 2519|  4.01k|    return (level == ZXC_LEVEL_FAST)
  ------------------
  |  Branch (2519:12): [True: 1.64k, False: 2.36k]
  ------------------
 2520|  4.01k|               ? zxc_lz77_lazy_parse_pak_l2(ctx, src, src_sz, epoch_mark, lzp.min_offset, seq_c,
 2521|  1.64k|                                            lit_c, extras_c)
 2522|  4.01k|               : zxc_lz77_lazy_parse_pak_l1(ctx, src, src_sz, epoch_mark, lzp.min_offset, seq_c,
 2523|  2.36k|                                            lit_c, extras_c);
 2524|  4.01k|}
zxc_compress.c:zxc_lz_begin_block:
 1551|  17.6k|                                   const size_t dict_sz, const int level) {
 1552|  17.6k|    const int use_hash5 = zxc_lz77_use_hash5(level);
 1553|  17.6k|    const int seed = dict_sz >= ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|  17.6k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1554|  17.6k|    const size_t limit = seed ? dict_sz - (ZXC_LZ_MIN_MATCH_LEN - 1) : 0;
  ------------------
  |  |  586|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  |  Branch (1554:26): [True: 0, False: 17.6k]
  ------------------
 1555|       |    // Positions from `stable` on also hash the block's first bytes.
 1556|  17.6k|    const size_t stable = seed ? dict_sz + 1 - zxc_hash_span(use_hash5) : 0;
  ------------------
  |  Branch (1556:27): [True: 0, False: 17.6k]
  ------------------
 1557|  17.6k|    zxc_dict_snap_t* snap = seed ? ctx->dict_snap : NULL;
  ------------------
  |  Branch (1557:29): [True: 0, False: 17.6k]
  ------------------
 1558|  17.6k|    int restore = 0;
 1559|  17.6k|    int save = 0;
 1560|  17.6k|    if (snap) {
  ------------------
  |  Branch (1560:9): [True: 0, False: 17.6k]
  ------------------
 1561|       |        // A known identity spares comparing the bytes.
 1562|      0|        if (snap->dict_size == dict_sz && snap->offset_bits == ctx->offset_bits &&
  ------------------
  |  Branch (1562:13): [True: 0, False: 0]
  |  Branch (1562:43): [True: 0, False: 0]
  ------------------
 1563|      0|            snap->use_hash5 == use_hash5 &&
  ------------------
  |  Branch (1563:13): [True: 0, False: 0]
  ------------------
 1564|      0|            ((snap->input_gen != 0 && snap->dict_gen == snap->input_gen) ||
  ------------------
  |  Branch (1564:15): [True: 0, False: 0]
  |  Branch (1564:39): [True: 0, False: 0]
  ------------------
 1565|      0|             memcmp(snap->dict, src, dict_sz) == 0)) {
  ------------------
  |  Branch (1565:14): [True: 0, False: 0]
  ------------------
 1566|      0|            snap->dict_gen = snap->input_gen;
 1567|      0|            restore = snap->valid;
 1568|       |            // Second block in a row with this dictionary: worth a snapshot.
 1569|      0|            save = !snap->valid;
 1570|      0|        } else if (dict_sz <= snap->capacity) {
  ------------------
  |  Branch (1570:20): [True: 0, False: 0]
  ------------------
 1571|       |            // New dictionary: remember it, snapshot only if it comes back.
 1572|      0|            snap->valid = 0;
 1573|      0|            snap->dict_size = dict_sz;
 1574|      0|            snap->dict_gen = snap->input_gen;
 1575|      0|            snap->offset_bits = ctx->offset_bits;
 1576|      0|            snap->use_hash5 = use_hash5;
 1577|      0|            ZXC_MEMCPY(snap->dict, src, dict_sz);
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1578|      0|        } else {
 1579|       |            // Larger than the snapshot: seed every block.
 1580|      0|            snap->valid = 0;
 1581|      0|            snap->dict_size = 0;
 1582|      0|            snap = NULL;
 1583|      0|        }
 1584|      0|    }
 1585|       |
 1586|  17.6k|    uint32_t epoch_mark;
 1587|  17.6k|    if (restore && snap->copy) {
  ------------------
  |  Branch (1587:9): [True: 0, False: 17.6k]
  |  Branch (1587:20): [True: 0, False: 0]
  ------------------
 1588|       |        // The whole table is overwritten: the state seeding [0, stable) left.
 1589|      0|        ZXC_MEMCPY(ctx->hash_table, snap->tables, ZXC_LZ_HASH_SIZE * sizeof(uint32_t));
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1590|      0|        ZXC_MEMCPY(ctx->hash_tags, snap->tables + ZXC_LZ_HASH_SIZE * sizeof(uint32_t),
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1591|      0|                   ZXC_LZ_HASH_SIZE * sizeof(uint8_t));
 1592|      0|        ZXC_MEMCPY(ctx->chain_table, snap->chain, stable * sizeof(uint16_t));
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1593|      0|        ctx->epoch = snap->epoch;
 1594|      0|        epoch_mark = ctx->epoch << ctx->offset_bits;
 1595|  17.6k|    } else {
 1596|  17.6k|        ctx->epoch++;
 1597|  17.6k|        if (UNLIKELY(ctx->epoch >= ctx->max_epoch)) {
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1598|      0|            ZXC_MEMSET(ctx->hash_table, 0, ZXC_LZ_HASH_SIZE * sizeof(uint32_t));
  ------------------
  |  |  173|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1599|      0|            ZXC_MEMSET(ctx->hash_tags, 0, ZXC_LZ_HASH_SIZE * sizeof(uint8_t));
  ------------------
  |  |  173|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1600|      0|            ctx->epoch = 1;
 1601|      0|        }
 1602|  17.6k|        epoch_mark = ctx->epoch << ctx->offset_bits;
 1603|  17.6k|        if (restore) {
  ------------------
  |  Branch (1603:13): [True: 0, False: 17.6k]
  ------------------
 1604|      0|            const uint16_t* const slot = (const uint16_t*)snap->tables;
 1605|      0|            const uint16_t* const pos = slot + ZXC_DICT_SNAP_LIST_MAX;
  ------------------
  |  | 2091|      0|#define ZXC_DICT_SNAP_LIST_MAX (ZXC_LZ_HASH_SIZE / 8)
  |  |  ------------------
  |  |  |  |  580|      0|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  578|      0|#define ZXC_LZ_HASH_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1606|      0|            const uint8_t* const tag = (const uint8_t*)(pos + ZXC_DICT_SNAP_LIST_MAX);
  ------------------
  |  | 2091|      0|#define ZXC_DICT_SNAP_LIST_MAX (ZXC_LZ_HASH_SIZE / 8)
  |  |  ------------------
  |  |  |  |  580|      0|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  578|      0|#define ZXC_LZ_HASH_BITS 15
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1607|      0|            for (size_t i = 0; i < snap->n; i++) {
  ------------------
  |  Branch (1607:32): [True: 0, False: 0]
  ------------------
 1608|      0|                ctx->hash_table[slot[i]] = epoch_mark | pos[i];
 1609|      0|                ctx->hash_tags[slot[i]] = tag[i];
 1610|      0|            }
 1611|      0|            ZXC_MEMCPY(ctx->chain_table, snap->chain, stable * sizeof(uint16_t));
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1612|  17.6k|        } else if (seed) {
  ------------------
  |  Branch (1612:20): [True: 0, False: 17.6k]
  ------------------
 1613|      0|            zxc_lz_seed_dict(src, dict_sz, ctx->hash_table, ctx->hash_tags, ctx->chain_table,
 1614|      0|                             epoch_mark, ctx->offset_mask, use_hash5, stable);
 1615|      0|            if (save) zxc_dict_snap_save(snap, ctx, stable);
  ------------------
  |  Branch (1615:17): [True: 0, False: 0]
  ------------------
 1616|      0|        }
 1617|  17.6k|    }
 1618|  17.6k|    if (seed)
  ------------------
  |  Branch (1618:9): [True: 0, False: 17.6k]
  ------------------
 1619|      0|        zxc_lz_seed_dense(src, stable, limit, ctx->hash_table, ctx->hash_tags, ctx->chain_table,
 1620|      0|                          epoch_mark, ctx->offset_mask, use_hash5);
 1621|  17.6k|    return epoch_mark;
 1622|  17.6k|}
zxc_compress.c:zxc_lz77_use_hash5:
   66|   175M|static ZXC_ALWAYS_INLINE int zxc_lz77_use_hash5(const int level) {
   67|   175M|    return level >= ZXC_LEVEL_DEFAULT;
   68|   175M|}
zxc_compress.c:zxc_hash_func:
   49|   104M|static ZXC_ALWAYS_INLINE uint32_t zxc_hash_func(const uint64_t val, const int use_hash5) {
   50|   104M|    if (use_hash5) {
  ------------------
  |  Branch (50:9): [True: 97.6M, False: 6.98M]
  ------------------
   51|  97.6M|        const uint64_t v5 = val & 0xFFFFFFFFFFULL;
   52|  97.6M|        return (uint32_t)((v5 * ZXC_HASH_XORSHIFT64) >> (64 - ZXC_LZ_HASH_BITS));
  ------------------
  |  |  799|  97.6M|#define ZXC_HASH_XORSHIFT64 0x2545F4914F6CDD1DULL
  ------------------
                      return (uint32_t)((v5 * ZXC_HASH_XORSHIFT64) >> (64 - ZXC_LZ_HASH_BITS));
  ------------------
  |  |  578|  97.6M|#define ZXC_LZ_HASH_BITS 15
  ------------------
   53|  97.6M|    } else {
   54|  6.98M|        const uint64_t v4 = val ^ (val >> 15);
   55|  6.98M|        return ((uint32_t)v4 * ZXC_HASH_MULT32) >> (32 - ZXC_LZ_HASH_BITS);
  ------------------
  |  |  801|  6.98M|#define ZXC_HASH_MULT32 0x2D35182DU
  ------------------
                      return ((uint32_t)v4 * ZXC_HASH_MULT32) >> (32 - ZXC_LZ_HASH_BITS);
  ------------------
  |  |  578|  6.98M|#define ZXC_LZ_HASH_BITS 15
  ------------------
   56|  6.98M|    }
   57|   104M|}
zxc_compress.c:zxc_hash_tag:
   80|  96.2M|static ZXC_ALWAYS_INLINE uint8_t zxc_hash_tag(const uint32_t val4) {
   81|  96.2M|    return (uint8_t)(val4 ^ (val4 >> 16));
   82|  96.2M|}
zxc_compress.c:zxc_epoch_pos:
   91|  92.0M|                                                const uint32_t epoch_mark) {
   92|       |    // epoch_mark has no position bits: the XOR is the position when the epochs
   93|       |    // agree, above offset_mask otherwise. No ~offset_mask to keep live.
   94|  92.0M|    const uint32_t pos = head ^ epoch_mark;
   95|  92.0M|    return (pos <= offset_mask) ? pos : 0;
  ------------------
  |  Branch (95:12): [True: 58.8M, False: 33.1M]
  ------------------
   96|  92.0M|}
zxc_compress.c:zxc_chain_delta:
  104|  94.8M|static ZXC_ALWAYS_INLINE uint16_t zxc_chain_delta(const uint32_t cur_pos, const uint32_t prev_idx) {
  105|  94.8M|    const uint32_t dist = cur_pos - prev_idx;
  106|       |    // cppcheck-suppress bitwiseOnBoolean
  107|  94.8M|    const uint32_t valid = 0U - (uint32_t)((prev_idx != 0) & (dist < ZXC_LZ_WINDOW_SIZE));
  ------------------
  |  |  582|  94.8M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  ------------------
  108|  94.8M|    return (uint16_t)(dist & valid);
  109|  94.8M|}
zxc_compress.c:zxc_lz77_lazy_parse_pak_l2:
 2482|  1.64k|                                                   size_t* lit_c_out, size_t* extras_c_out) {
 2483|  1.64k|    return zxc_lz77_lazy_parse_pak_impl(ctx, src, src_sz, epoch_mark, min_offset, seq_c_out,
 2484|  1.64k|                                        lit_c_out, extras_c_out, ZXC_LEVEL_FAST);
 2485|  1.64k|}
zxc_compress.c:zxc_lz77_lazy_parse_pak_impl:
 2381|  4.01k|    size_t* RESTRICT lit_c_out, size_t* RESTRICT extras_c_out, const int level) {
 2382|  4.01k|    zxc_lz77_params_t lzp = zxc_get_lz77_params(level);
 2383|  4.01k|    lzp.min_offset = min_offset;
 2384|  4.01k|    const uint32_t offset_mask = ctx->offset_mask;
 2385|       |
 2386|  4.01k|    const uint8_t* ip = src + ctx->dict_size;
 2387|  4.01k|    const uint8_t* iend = src + src_sz;
 2388|  4.01k|    const uint8_t* anchor = ip;
 2389|  4.01k|    const uint8_t* search_limit = iend - ZXC_LZ_SEARCH_MARGIN;
  ------------------
  |  |  765|  4.01k|#define ZXC_LZ_SEARCH_MARGIN (sizeof(uint64_t))
  ------------------
 2390|       |
 2391|  4.01k|    uint32_t* const hash_table = ctx->hash_table;
 2392|  4.01k|    uint8_t* const hash_tags = ctx->hash_tags;
 2393|  4.01k|    uint8_t* const buf_extras = ctx->buf_extras;
 2394|  4.01k|    uint16_t* const chain_table = ctx->chain_table;
 2395|  4.01k|    uint8_t* const literals = ctx->literals;
 2396|  4.01k|    uint32_t* const buf_sequences = ctx->buf_sequences;
 2397|       |
 2398|  4.01k|    uint32_t seq_c = 0;
 2399|  4.01k|    size_t extras_c = 0;
 2400|  4.01k|    size_t lit_c = 0;
 2401|       |
 2402|  4.01k|    const int use_hash5 = zxc_lz77_use_hash5(level);
 2403|       |
 2404|   942k|    while (LIKELY(ip < search_limit)) {
  ------------------
  |  |  146|   942k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 938k, False: 4.01k]
  |  |  ------------------
  ------------------
 2405|   938k|        uint32_t h = zxc_hash_func(zxc_le64(ip), use_hash5);
 2406|       |
 2407|       |        // One pass per unmatched position: the hash taken to prefetch the next
 2408|       |        // position's slots is the one the finder needs there. PAK skips far more
 2409|       |        // positions than SPL, whose lazy loop gains nothing from carrying it.
 2410|  6.05M|        for (;;) {
 2411|  6.05M|            const size_t dist = (size_t)(ip - anchor);
 2412|  6.05M|            size_t step = lzp.step_base + (dist >> lzp.step_shift);
 2413|  6.05M|            if (UNLIKELY(ip + step >= search_limit)) step = 1;
  ------------------
  |  |  152|  6.05M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 95.4k, False: 5.95M]
  |  |  ------------------
  ------------------
 2414|       |
 2415|  6.05M|            ZXC_PREFETCH_READ(ip + step * 4 + ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  163|  6.05M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2416|       |
 2417|       |            // ip + step <= search_limit either way, so this read stays in the block.
 2418|  6.05M|            const uint32_t h_next = zxc_hash_func(zxc_le64(ip + step), use_hash5);
 2419|  6.05M|            ZXC_PREFETCH_READ(&hash_tags[h_next]);
  ------------------
  |  |  163|  6.05M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2420|  6.05M|            ZXC_PREFETCH_READ(&hash_table[h_next]);
  ------------------
  |  |  163|  6.05M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2421|       |
 2422|  6.05M|            const zxc_match_t m = zxc_lz77_find_best_match(
 2423|  6.05M|                src, ip, h, iend, search_limit, anchor, hash_table, hash_tags, chain_table,
 2424|  6.05M|                epoch_mark, offset_mask, level, lzp, /*last_off=*/0U);
 2425|       |
 2426|  6.05M|            if (m.ref) {
  ------------------
  |  Branch (2426:17): [True: 936k, False: 5.11M]
  ------------------
 2427|   936k|                ip -= m.backtrack;
 2428|   936k|                const uint32_t ll = (uint32_t)(ip - anchor);
 2429|   936k|                const uint32_t ml = m.len - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|   936k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 2430|   936k|                const uint32_t off = (uint32_t)(ip - m.ref);
 2431|       |
 2432|   936k|                if (ll > 0) zxc_flush_literals(literals, &lit_c, anchor, ll, iend);
  ------------------
  |  Branch (2432:21): [True: 568k, False: 367k]
  ------------------
 2433|       |
 2434|   936k|                const uint32_t ll_write = (ll >= ZXC_SEQ_LL_MASK) ? ZXC_SEQ_LL_MASK : ll;
  ------------------
  |  |  539|   936k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  533|   936k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
                              const uint32_t ll_write = (ll >= ZXC_SEQ_LL_MASK) ? ZXC_SEQ_LL_MASK : ll;
  ------------------
  |  |  539|  19.5k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  533|  19.5k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
  |  Branch (2434:43): [True: 19.5k, False: 916k]
  ------------------
 2435|   936k|                const uint32_t ml_write = (ml >= ZXC_SEQ_ML_MASK) ? ZXC_SEQ_ML_MASK : ml;
  ------------------
  |  |  541|   936k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  535|   936k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
                              const uint32_t ml_write = (ml >= ZXC_SEQ_ML_MASK) ? ZXC_SEQ_ML_MASK : ml;
  ------------------
  |  |  541|  38.1k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  535|  38.1k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
  |  Branch (2435:43): [True: 38.1k, False: 898k]
  ------------------
 2436|   936k|                const uint32_t seq_val = (ll_write << ZXC_SEQ_LL_SHIFT) |
  ------------------
  |  |  545|   936k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  535|   936k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  537|   936k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2437|   936k|                                         (ml_write << ZXC_SEQ_ML_SHIFT) |
  ------------------
  |  |  547|   936k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  537|   936k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2438|   936k|                                         ((off - ZXC_LZ_OFFSET_BIAS) & ZXC_SEQ_OFF_MASK);
  ------------------
  |  |  724|   936k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
                                                       ((off - ZXC_LZ_OFFSET_BIAS) & ZXC_SEQ_OFF_MASK);
  ------------------
  |  |  543|   936k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  537|   936k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2439|   936k|                buf_sequences[seq_c] = seq_val;
 2440|   936k|                seq_c++;
 2441|       |
 2442|   936k|                if (UNLIKELY(!zxc_emit_extra(buf_extras, &extras_c, ll, ZXC_SEQ_LL_MASK) ||
  ------------------
  |  |  152|  1.87M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 936k]
  |  |  |  Branch (152:42): [True: 0, False: 936k]
  |  |  |  Branch (152:42): [True: 0, False: 936k]
  |  |  ------------------
  ------------------
 2443|   936k|                             !zxc_emit_extra(buf_extras, &extras_c, ml, ZXC_SEQ_ML_MASK)))
 2444|      0|                    return ZXC_ERROR_OVERFLOW;
 2445|       |
 2446|   936k|                ip += m.len;
 2447|   936k|                anchor = ip;
 2448|   936k|                break;
 2449|   936k|            }
 2450|       |
 2451|  5.11M|            ip += step;
 2452|  5.11M|            if (UNLIKELY(ip >= search_limit)) break;
  ------------------
  |  |  152|  5.11M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 2.22k, False: 5.11M]
  |  |  ------------------
  ------------------
 2453|  5.11M|            h = h_next;
 2454|  5.11M|        }
 2455|   938k|    }
 2456|       |
 2457|  4.01k|    const size_t last_lits = (size_t)(iend - anchor);
 2458|  4.01k|    if (last_lits > 0) {
  ------------------
  |  Branch (2458:9): [True: 3.63k, False: 379]
  ------------------
 2459|  3.63k|        ZXC_MEMCPY(literals + lit_c, anchor, last_lits);
  ------------------
  |  |  168|  3.63k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2460|  3.63k|        lit_c += last_lits;
 2461|  3.63k|    }
 2462|       |
 2463|  4.01k|    *seq_c_out = seq_c;
 2464|  4.01k|    *lit_c_out = lit_c;
 2465|  4.01k|    *extras_c_out = extras_c;
 2466|  4.01k|    return ZXC_OK;
 2467|  4.01k|}
zxc_compress.c:zxc_lz77_find_best_match:
  669|  94.5M|    const uint32_t last_off) {
  670|  94.5M|    const int use_hash5 = zxc_lz77_use_hash5(level);
  671|       |    // Sentinel length just below the minimum, so any valid match replaces it.
  672|  94.5M|    zxc_match_t best = (zxc_match_t){NULL, ZXC_LZ_MIN_MATCH_LEN - 1, 0};
  ------------------
  |  |  586|  94.5M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  673|       |
  674|  94.5M|    const uint32_t cur_val = zxc_le32(ip);
  675|       |
  676|       |    // 8-bit tag: XOR fold of first 4 bytes for fast rejection
  677|  94.5M|    const uint8_t cur_tag = zxc_hash_tag(cur_val);
  678|       |
  679|  94.5M|    const uint32_t cur_pos = (uint32_t)(ip - src);
  680|       |
  681|       |    // Tag-first filter on fast levels.
  682|  94.5M|    const uint8_t stored_tag = hash_tags[h];
  683|  94.5M|    uint32_t match_idx;
  684|  94.5M|    if (level <= ZXC_LEVEL_FAST && stored_tag != cur_tag) {
  ------------------
  |  Branch (684:9): [True: 6.05M, False: 88.4M]
  |  Branch (684:36): [True: 4.22M, False: 1.82M]
  ------------------
  685|  4.22M|        match_idx = 0;
  686|  90.3M|    } else {
  687|  90.3M|        match_idx = zxc_epoch_pos(hash_table[h], offset_mask, epoch_mark);
  688|  90.3M|    }
  689|       |
  690|       |    // skip_head drives the chain walk on level >= 3 (advances past the
  691|       |    // mismatched head without comparing). On level <= 2 it is always 0, which
  692|       |    // the compiler cannot see: saying so frees registers in the PAK loop.
  693|       |    // cppcheck-suppress bitwiseOnBoolean
  694|  94.5M|    const int skip_head = (level > ZXC_LEVEL_FAST) & (match_idx != 0) & (stored_tag != cur_tag);
  695|       |
  696|       |    // Split table writes
  697|  94.5M|    hash_table[h] = epoch_mark | cur_pos;
  698|  94.5M|    hash_tags[h] = cur_tag;
  699|       |
  700|  94.5M|    chain_table[cur_pos & ZXC_LZ_WINDOW_MASK] = zxc_chain_delta(cur_pos, match_idx);
  ------------------
  |  |  584|  94.5M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  582|  94.5M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  701|       |
  702|  94.5M|    int attempts = p.search_depth;
  703|       |
  704|       |    // Repeat-offset seed (level-6 parser passes last_off; others pass 0).
  705|       |    // Probing the previous offset first often finds the longest match right
  706|       |    // away, speeding up the chain walk. It only raises best.len, never lowers
  707|       |    // it, so the result is unchanged - this is purely a speed optimization.
  708|  94.5M|    if (last_off != 0U && last_off >= p.min_offset && last_off <= (uint32_t)ZXC_LZ_MAX_DIST &&
  ------------------
  |  |  726|   173M|#define ZXC_LZ_MAX_DIST (ZXC_LZ_WINDOW_SIZE - 1)
  |  |  ------------------
  |  |  |  |  582|  79.3M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  |  Branch (708:9): [True: 79.3M, False: 15.1M]
  |  Branch (708:27): [True: 79.3M, False: 0]
  |  Branch (708:55): [True: 79.3M, False: 0]
  ------------------
  709|  79.3M|        last_off <= cur_pos) {
  ------------------
  |  Branch (709:9): [True: 79.3M, False: 0]
  ------------------
  710|  79.3M|        const uint8_t* const rep_ref = src + (cur_pos - last_off);
  711|  79.3M|        if (zxc_le32(rep_ref) == cur_val) {
  ------------------
  |  Branch (711:13): [True: 29.9M, False: 49.3M]
  ------------------
  712|  29.9M|            uint32_t mlen = sizeof(uint32_t);
  713|  29.9M|            const uint8_t* const limit_8 = iend - sizeof(uint64_t);
  714|   143M|            while (ip + mlen < limit_8) {
  ------------------
  |  Branch (714:20): [True: 143M, False: 35.3k]
  ------------------
  715|   143M|                const uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(rep_ref + mlen);
  716|   143M|                if (diff == 0) {
  ------------------
  |  Branch (716:21): [True: 113M, False: 29.9M]
  ------------------
  717|   113M|                    mlen += sizeof(uint64_t);
  718|   113M|                } else {
  719|  29.9M|                    mlen += (uint32_t)(zxc_ctz64(diff) >> 3);
  720|  29.9M|                    goto _rep_done;
  721|  29.9M|                }
  722|   143M|            }
  723|   165k|            while (ip + mlen < iend && rep_ref[mlen] == ip[mlen]) mlen++;
  ------------------
  |  Branch (723:20): [True: 145k, False: 20.7k]
  |  Branch (723:40): [True: 130k, False: 14.5k]
  ------------------
  724|  29.9M|        _rep_done:;
  725|  29.9M|            best.len = mlen;
  726|  29.9M|            best.ref = rep_ref;
  727|  29.9M|            if (UNLIKELY(best.len >= (uint32_t)p.sufficient_len || ip + best.len >= iend))
  ------------------
  |  |  152|  59.9M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 27.1k, False: 29.9M]
  |  |  |  Branch (152:42): [True: 6.38k, False: 29.9M]
  |  |  |  Branch (152:42): [True: 20.7k, False: 29.9M]
  |  |  ------------------
  ------------------
  728|  27.1k|                goto _finalize_match;
  729|  29.9M|        }
  730|  79.3M|    }
  731|       |
  732|  94.5M|    if (match_idx == 0) goto _finalize_match;
  ------------------
  |  Branch (732:9): [True: 36.9M, False: 57.5M]
  ------------------
  733|       |
  734|       |    // Optimization: If head tag doesn't match, advance immediately without loading the first
  735|       |    // mismatch.
  736|  57.5M|    if (skip_head) {
  ------------------
  |  Branch (736:9): [True: 24.9M, False: 32.6M]
  ------------------
  737|  24.9M|        const uint16_t delta = chain_table[match_idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  584|  24.9M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  582|  24.9M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  738|  24.9M|        const uint32_t next_idx = match_idx - delta;
  739|  24.9M|        match_idx = (delta != 0) ? next_idx : 0;
  ------------------
  |  Branch (739:21): [True: 13.6M, False: 11.3M]
  ------------------
  740|  24.9M|        attempts--;
  741|  24.9M|    }
  742|       |
  743|  2.16G|    while (match_idx > 0) {
  ------------------
  |  Branch (743:12): [True: 2.13G, False: 34.3M]
  ------------------
  744|  2.13G|        if (UNLIKELY(attempts-- < 0 || cur_pos - match_idx > ZXC_LZ_MAX_DIST)) break;
  ------------------
  |  |  152|  4.25G|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 22.6M, False: 2.11G]
  |  |  |  Branch (152:42): [True: 14.6M, False: 2.12G]
  |  |  |  Branch (152:42): [True: 8.02M, False: 2.11G]
  |  |  ------------------
  ------------------
  745|  2.11G|        const uint8_t* ref = src + match_idx;
  746|       |
  747|       |        // Load the next chain link early (before the compare) so its address
  748|       |        // resolves while we prefetch. The prefetch aims at the next gate for
  749|       |        // the current best.len; a longer match found here moves that gate.
  750|  2.11G|        const uint16_t delta = chain_table[match_idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  584|  2.11G|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  582|  2.11G|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  751|  2.11G|        const uint32_t next_idx = match_idx - delta;
  752|  2.11G|        ZXC_PREFETCH_READ(src + next_idx + best.len - 3);
  ------------------
  |  |  163|  2.11G|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
  753|       |
  754|       |        // Gate first: most candidates share the head and fail on bytes
  755|       |        // [best.len-3, best.len], which a longer match must also cover.
  756|  2.11G|        const int should_compare = (cur_pos - match_idx) >= p.min_offset &&
  ------------------
  |  Branch (756:36): [True: 2.11G, False: 658k]
  ------------------
  757|  2.11G|                                   zxc_le32(ref + best.len - 3) == zxc_le32(ip + best.len - 3) &&
  ------------------
  |  Branch (757:36): [True: 103M, False: 2.00G]
  ------------------
  758|   103M|                                   zxc_le32(ref) == cur_val;
  ------------------
  |  Branch (758:36): [True: 103M, False: 33.0k]
  ------------------
  759|       |
  760|  2.11G|        if (should_compare) {
  ------------------
  |  Branch (760:13): [True: 103M, False: 2.00G]
  ------------------
  761|   103M|            uint32_t mlen = sizeof(uint32_t);  // We already know the first 4 bytes match
  762|       |
  763|       |            // Fast path: Scalar 64-bit comparison for short matches (=< 64 bytes)
  764|       |            // Most matches are short, so this avoids SIMD overhead for common cases
  765|   103M|            const uint8_t* limit_8 = iend - sizeof(uint64_t);
  766|   103M|            const uint8_t* scalar_limit = ip + mlen + 64;
  767|   103M|            if (scalar_limit > limit_8) scalar_limit = limit_8;
  ------------------
  |  Branch (767:17): [True: 137k, False: 103M]
  ------------------
  768|       |
  769|   217M|            while (ip + mlen < scalar_limit) {
  ------------------
  |  Branch (769:20): [True: 214M, False: 2.58M]
  ------------------
  770|   214M|                uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(ref + mlen);
  771|   214M|                if (diff == 0)
  ------------------
  |  Branch (771:21): [True: 113M, False: 100M]
  ------------------
  772|   113M|                    mlen += sizeof(uint64_t);
  773|   100M|                else {
  774|   100M|                    mlen += (uint32_t)zxc_ctz64(diff) >> 3;
  775|   100M|                    goto _match_len_done;
  776|   100M|                }
  777|   214M|            }
  778|       |
  779|       |            // Long match path: Use SIMD for matches exceeding 64 bytes
  780|       |#if defined(ZXC_USE_AVX512)
  781|       |            const uint8_t* limit_64 = iend - 64;
  782|       |            while (ip + mlen < limit_64) {
  783|       |                const __m512i v_src = _mm512_loadu_si512((const void*)(ip + mlen));
  784|       |                const __m512i v_ref = _mm512_loadu_si512((const void*)(ref + mlen));
  785|       |                const __mmask64 mask = _mm512_cmpeq_epi8_mask(v_src, v_ref);
  786|       |                if (mask == 0xFFFFFFFFFFFFFFFF)
  787|       |                    mlen += 64;
  788|       |                else {
  789|       |                    mlen += (uint32_t)zxc_ctz64(~mask);
  790|       |                    goto _match_len_done;
  791|       |                }
  792|       |            }
  793|       |#elif defined(ZXC_USE_AVX2)
  794|       |            const uint8_t* limit_32 = iend - 32;
  795|       |            while (ip + mlen < limit_32) {
  796|       |                const __m256i v_src = _mm256_loadu_si256((const __m256i*)(ip + mlen));
  797|       |                const __m256i v_ref = _mm256_loadu_si256((const __m256i*)(ref + mlen));
  798|       |                const __m256i v_cmp = _mm256_cmpeq_epi8(v_src, v_ref);
  799|       |                const uint32_t mask = (uint32_t)_mm256_movemask_epi8(v_cmp);
  800|       |                if (mask == 0xFFFFFFFF)
  801|       |                    mlen += 32;
  802|       |                else {
  803|       |                    mlen += (uint32_t)zxc_ctz32(~mask);
  804|       |                    goto _match_len_done;
  805|       |                }
  806|       |            }
  807|       |#elif defined(ZXC_USE_SSE2)
  808|  2.58M|            const uint8_t* limit_16 = iend - 16;
  809|  10.5M|            while (ip + mlen < limit_16) {
  ------------------
  |  Branch (809:20): [True: 10.5M, False: 21.5k]
  ------------------
  810|  10.5M|                const __m128i v_src = _mm_loadu_si128((const __m128i*)(ip + mlen));
  811|  10.5M|                const __m128i v_ref = _mm_loadu_si128((const __m128i*)(ref + mlen));
  812|  10.5M|                const __m128i v_cmp = _mm_cmpeq_epi8(v_src, v_ref);
  813|  10.5M|                const uint32_t mask = (uint32_t)_mm_movemask_epi8(v_cmp);
  814|  10.5M|                if (mask == 0xFFFFU)
  ------------------
  |  Branch (814:21): [True: 7.95M, False: 2.56M]
  ------------------
  815|  7.95M|                    mlen += 16;
  816|  2.56M|                else {
  817|       |                    // mask != 0xFFFF => a differing byte exists in bits 0..15,
  818|       |                    // so the lowest set bit of ~mask lies in that range.
  819|  2.56M|                    mlen += (uint32_t)zxc_ctz32(~mask);
  820|  2.56M|                    goto _match_len_done;
  821|  2.56M|                }
  822|  10.5M|            }
  823|       |#elif defined(ZXC_USE_NEON64)
  824|       |            {
  825|       |                const uint8_t* limit_32 = iend - 32;
  826|       |                while (ip + mlen < limit_32) {
  827|       |                    const uint8x16_t s0 = vld1q_u8(ip + mlen);
  828|       |                    const uint8x16_t r0 = vld1q_u8(ref + mlen);
  829|       |                    const uint8x16_t c0 = vceqq_u8(s0, r0);
  830|       |                    const uint64_t m0 = vget_lane_u64(
  831|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(c0), 4)), 0);
  832|       |                    if (UNLIKELY(m0 != ~(uint64_t)0)) {
  833|       |                        mlen += (uint32_t)(zxc_ctz64(~m0) >> 2);
  834|       |                        goto _match_len_done;
  835|       |                    }
  836|       |                    const uint8x16_t s1 = vld1q_u8(ip + mlen + 16);
  837|       |                    const uint8x16_t r1 = vld1q_u8(ref + mlen + 16);
  838|       |                    const uint8x16_t c1 = vceqq_u8(s1, r1);
  839|       |                    const uint64_t m1 = vget_lane_u64(
  840|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(c1), 4)), 0);
  841|       |                    if (UNLIKELY(m1 != ~(uint64_t)0)) {
  842|       |                        mlen += 16 + (uint32_t)(zxc_ctz64(~m1) >> 2);
  843|       |                        goto _match_len_done;
  844|       |                    }
  845|       |                    mlen += 32;
  846|       |                }
  847|       |                if (ip + mlen < iend - 16) {
  848|       |                    const uint8x16_t v_src = vld1q_u8(ip + mlen);
  849|       |                    const uint8x16_t v_ref = vld1q_u8(ref + mlen);
  850|       |                    const uint8x16_t v_cmp = vceqq_u8(v_src, v_ref);
  851|       |                    const uint64_t mask = vget_lane_u64(
  852|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(v_cmp), 4)), 0);
  853|       |                    if (LIKELY(mask == ~(uint64_t)0))
  854|       |                        mlen += 16;
  855|       |                    else {
  856|       |                        mlen += (uint32_t)(zxc_ctz64(~mask) >> 2);
  857|       |                        goto _match_len_done;
  858|       |                    }
  859|       |                }
  860|       |            }
  861|       |#elif defined(ZXC_USE_NEON32)
  862|       |            {
  863|       |                const uint8_t* limit_16 = iend - 16;
  864|       |                while (ip + mlen < limit_16) {
  865|       |                    const uint8x16_t v_src = vld1q_u8(ip + mlen);
  866|       |                    const uint8x16_t v_ref = vld1q_u8(ref + mlen);
  867|       |                    const uint8x16_t v_cmp = vceqq_u8(v_src, v_ref);
  868|       |                    uint8x8_t p1 = vpmin_u8(vget_low_u8(v_cmp), vget_high_u8(v_cmp));
  869|       |                    uint8x8_t p2 = vpmin_u8(p1, p1);
  870|       |                    uint8x8_t p3 = vpmin_u8(p2, p2);
  871|       |                    uint8x8_t p4 = vpmin_u8(p3, p3);
  872|       |                    uint8_t min_val = vget_lane_u8(p4, 0);
  873|       |                    if (min_val == 0xFF)
  874|       |                        mlen += 16;
  875|       |                    else {
  876|       |                        uint8x16_t v_diff = vmvnq_u8(v_cmp);
  877|       |                        uint64_t lo =
  878|       |                            (uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 0) |
  879|       |                            ((uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 1) << 32);
  880|       |                        if (lo != 0)
  881|       |                            mlen += (zxc_ctz64(lo) >> 3);
  882|       |                        else
  883|       |                            mlen +=
  884|       |                                8 + (zxc_ctz64(
  885|       |                                         (uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 2) |
  886|       |                                         ((uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 3)
  887|       |                                          << 32)) >>
  888|       |                                     3);
  889|       |                        goto _match_len_done;
  890|       |                    }
  891|       |                }
  892|       |            }
  893|       |#endif
  894|  22.0k|            while (ip + mlen < limit_8) {
  ------------------
  |  Branch (894:20): [True: 2.22k, False: 19.8k]
  ------------------
  895|  2.22k|                const uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(ref + mlen);
  896|  2.22k|                if (diff == 0)
  ------------------
  |  Branch (896:21): [True: 520, False: 1.70k]
  ------------------
  897|    520|                    mlen += sizeof(uint64_t);
  898|  1.70k|                else {
  899|  1.70k|                    mlen += (uint32_t)zxc_ctz64(diff) >> 3;
  900|  1.70k|                    goto _match_len_done;
  901|  1.70k|                }
  902|  2.22k|            }
  903|  60.1k|            while (ip + mlen < iend && ref[mlen] == ip[mlen]) mlen++;
  ------------------
  |  Branch (903:20): [True: 58.3k, False: 1.81k]
  |  Branch (903:40): [True: 40.3k, False: 17.9k]
  ------------------
  904|       |
  905|   103M|        _match_len_done:;
  906|   103M|            const int better = (mlen > best.len);
  907|   103M|            best.len = better ? mlen : best.len;
  ------------------
  |  Branch (907:24): [True: 11.5M, False: 91.7M]
  ------------------
  908|   103M|            best.ref = better ? ref : best.ref;
  ------------------
  |  Branch (908:24): [True: 11.5M, False: 91.7M]
  ------------------
  909|       |
  910|   103M|            if (UNLIKELY(best.len >= (uint32_t)p.sufficient_len || ip + best.len >= iend)) break;
  ------------------
  |  |  152|   205M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 537k, False: 102M]
  |  |  |  Branch (152:42): [True: 536k, False: 102M]
  |  |  |  Branch (152:42): [True: 1.30k, False: 102M]
  |  |  ------------------
  ------------------
  911|   103M|        }
  912|       |
  913|  2.11G|        match_idx = (delta != 0) ? next_idx : 0;
  ------------------
  |  Branch (913:21): [True: 2.08G, False: 23.0M]
  ------------------
  914|  2.11G|    }
  915|       |
  916|  94.5M|_finalize_match:
  917|  94.5M|    if (best.ref) {
  ------------------
  |  Branch (917:9): [True: 33.6M, False: 60.8M]
  ------------------
  918|       |        // Backtrack to extend match backwards
  919|  33.6M|        const uint8_t* b_ip = ip;
  920|  33.6M|        const uint8_t* b_ref = best.ref;
  921|  34.9M|        while (b_ip > anchor && b_ref > src && b_ip[-1] == b_ref[-1]) {
  ------------------
  |  Branch (921:16): [True: 2.48M, False: 32.4M]
  |  Branch (921:33): [True: 2.47M, False: 2.20k]
  |  Branch (921:48): [True: 1.30M, False: 1.16M]
  ------------------
  922|  1.30M|            b_ip--;
  923|  1.30M|            b_ref--;
  924|  1.30M|            best.len++;
  925|  1.30M|            best.backtrack++;
  926|  1.30M|        }
  927|  33.6M|        best.ref = b_ref;
  928|  33.6M|    }
  929|       |
  930|       |    // Lazy: a match two bytes longer at ip+1, or from level 4 three bytes longer
  931|       |    // at ip+2, cancels this one.
  932|  94.5M|    if (p.use_lazy && best.ref && best.len < (uint32_t)p.lazy_len_threshold &&
  ------------------
  |  Branch (932:9): [True: 7.45M, False: 87.0M]
  |  Branch (932:23): [True: 939k, False: 6.51M]
  |  Branch (932:35): [True: 912k, False: 27.8k]
  ------------------
  933|   912k|        ip + 1 < search_limit) {
  ------------------
  |  Branch (933:9): [True: 911k, False: 733]
  ------------------
  934|   911k|        if (zxc_lazy_probe(src, ip + 1, iend, best.len + 2, hash_table, hash_tags, chain_table,
  ------------------
  |  Branch (934:13): [True: 144k, False: 766k]
  ------------------
  935|   911k|                           epoch_mark, offset_mask, use_hash5, p) ||
  936|   766k|            (level >= ZXC_LEVEL_BALANCED && ip + 2 < search_limit &&
  ------------------
  |  Branch (936:14): [True: 508k, False: 257k]
  |  Branch (936:45): [True: 508k, False: 358]
  ------------------
  937|   508k|             zxc_lazy_probe(src, ip + 2, iend, best.len + 3, hash_table, hash_tags, chain_table,
  ------------------
  |  Branch (937:14): [True: 13.9k, False: 494k]
  ------------------
  938|   508k|                            epoch_mark, offset_mask, use_hash5, p)))
  939|   158k|            best.ref = NULL;
  940|   911k|    }
  941|       |
  942|  94.5M|    return best;
  943|  57.5M|}
zxc_compress.c:zxc_lazy_probe:
  608|  1.41M|                                            const int use_hash5, const zxc_lz77_params_t p) {
  609|  1.41M|    if (need > (size_t)(iend - lp)) return 0;  // too close to the end to win
  ------------------
  |  Branch (609:9): [True: 2.14k, False: 1.41M]
  ------------------
  610|       |
  611|  1.41M|    const uint64_t val8 = zxc_le64(lp);
  612|  1.41M|    const uint32_t val = (uint32_t)val8;
  613|  1.41M|    const uint32_t h = zxc_hash_func(val8, use_hash5);
  614|  1.41M|    const uint32_t pos = (uint32_t)(lp - src);
  615|  1.41M|    const uint32_t gate = zxc_le32(lp + need - 4);
  616|  1.41M|    uint32_t idx = zxc_epoch_pos(hash_table[h], offset_mask, epoch_mark);
  617|       |    // A head with another tag is another string: walk past it.
  618|  1.41M|    int skip = (hash_tags[h] != zxc_hash_tag(val));
  619|       |
  620|  6.53M|    for (int att = p.lazy_attempts; idx > 0 && att > 0; att--) {
  ------------------
  |  Branch (620:37): [True: 6.29M, False: 238k]
  |  Branch (620:48): [True: 5.77M, False: 523k]
  ------------------
  621|  5.77M|        if (UNLIKELY(pos - idx > ZXC_LZ_MAX_DIST)) break;
  ------------------
  |  |  152|  5.77M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 35.7k, False: 5.73M]
  |  |  ------------------
  ------------------
  622|  5.73M|        const uint8_t* const ref = src + idx;
  623|       |
  624|       |        // Filtered here too: a lazy hit only cancels best.ref, so a match
  625|       |        // we could never emit would drop a legal one for nothing.
  626|  5.73M|        if (pos - idx >= p.min_offset && !skip && zxc_le32(ref + need - 4) == gate &&
  ------------------
  |  Branch (626:13): [True: 5.57M, False: 160k]
  |  Branch (626:42): [True: 5.48M, False: 92.9k]
  |  Branch (626:51): [True: 425k, False: 5.05M]
  ------------------
  627|   425k|            zxc_le32(ref) == val && zxc_match_reaches(lp, ref, sizeof(uint32_t), need, iend))
  ------------------
  |  Branch (627:13): [True: 422k, False: 2.61k]
  |  Branch (627:37): [True: 158k, False: 264k]
  ------------------
  628|   158k|            return 1;
  629|       |
  630|  5.57M|        const uint16_t delta = chain_table[idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  584|  5.57M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  582|  5.57M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  631|  5.57M|        if (UNLIKELY(delta == 0)) break;
  ------------------
  |  |  152|  5.57M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 461k, False: 5.11M]
  |  |  ------------------
  ------------------
  632|  5.11M|        idx -= delta;
  633|  5.11M|        skip = 0;
  634|  5.11M|    }
  635|  1.25M|    return 0;
  636|  1.41M|}
zxc_compress.c:zxc_match_reaches:
  582|   422k|                                               const uint8_t* iend) {
  583|  1.09M|    while (from < need) {
  ------------------
  |  Branch (583:12): [True: 1.00M, False: 91.2k]
  ------------------
  584|  1.00M|        if (UNLIKELY((size_t)(iend - cur) - from < sizeof(uint64_t))) {
  ------------------
  |  |  152|  1.00M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 710, False: 1.00M]
  |  |  ------------------
  ------------------
  585|  2.50k|            while (from < need && cur[from] == ref[from]) from++;
  ------------------
  |  Branch (585:20): [True: 2.09k, False: 406]
  |  Branch (585:35): [True: 1.79k, False: 304]
  ------------------
  586|    710|            return from >= need;
  587|    710|        }
  588|  1.00M|        const uint64_t d = zxc_le64(cur + from) ^ zxc_le64(ref + from);
  589|  1.00M|        if (d != 0) return from + (uint32_t)(zxc_ctz64(d) >> 3) >= need;
  ------------------
  |  Branch (589:13): [True: 331k, False: 674k]
  ------------------
  590|   674k|        from += sizeof(uint64_t);
  591|   674k|    }
  592|  91.2k|    return 1;
  593|   422k|}
zxc_compress.c:zxc_flush_literals:
  540|  1.08M|                                                 const uint8_t* iend) {
  541|  1.08M|    if (LIKELY(anchor + ZXC_PAD_SIZE <= iend)) {
  ------------------
  |  |  146|  1.08M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 1.07M, False: 6.26k]
  |  |  ------------------
  ------------------
  542|  1.07M|        zxc_copy32(literals + *lit_c, anchor);
  543|  1.07M|        if (UNLIKELY(ll > ZXC_PAD_SIZE))
  ------------------
  |  |  152|  1.07M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 158k, False: 920k]
  |  |  ------------------
  ------------------
  544|   158k|            ZXC_MEMCPY(literals + *lit_c + ZXC_PAD_SIZE, anchor + ZXC_PAD_SIZE, ll - ZXC_PAD_SIZE);
  ------------------
  |  |  168|   158k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  545|  1.07M|    } else {
  546|  6.26k|        ZXC_MEMCPY(literals + *lit_c, anchor, ll);
  ------------------
  |  |  168|  6.26k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  547|  6.26k|    }
  548|  1.08M|    *lit_c += ll;
  549|  1.08M|}
zxc_compress.c:zxc_emit_extra:
  256|  8.00M|                                            const uint32_t val, const uint32_t mask) {
  257|  8.00M|    if (LIKELY(val < mask)) return 1;
  ------------------
  |  |  146|  8.00M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 6.95M, False: 1.05M]
  |  |  ------------------
  ------------------
  258|  1.05M|    const size_t n = zxc_write_varint(extras + *used, val - mask);
  259|  1.05M|    if (UNLIKELY(n == 0)) return 0;
  ------------------
  |  |  152|  1.05M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 1.05M]
  |  |  ------------------
  ------------------
  260|  1.05M|    *used += n;
  261|  1.05M|    return 1;
  262|  1.05M|}
zxc_compress.c:zxc_write_varint:
  220|  1.05M|static ZXC_ALWAYS_INLINE size_t zxc_write_varint(uint8_t* RESTRICT dst, const uint32_t val) {
  221|       |    // Values above ZXC_MAX_VARINT_VALUE are out-of-spec and the decoder would
  222|       |    // reject them. Unreachable from the Block API, so this is defence in depth;
  223|       |    // callers must treat a return of 0 as an encoding error.
  224|  1.05M|    if (UNLIKELY(val > ZXC_MAX_VARINT_VALUE)) {
  ------------------
  |  |  152|  1.05M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 1.05M]
  |  |  ------------------
  ------------------
  225|      0|        return 0;
  226|      0|    }
  227|       |
  228|       |    // 1 byte: 0xxxxxxx (7 bits)
  229|  1.05M|    if (LIKELY(val < ZXC_VARINT_1B_LIMIT)) {
  ------------------
  |  |  146|  1.05M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 876k, False: 176k]
  |  |  ------------------
  ------------------
  230|   876k|        dst[0] = (uint8_t)val;
  231|   876k|        return 1;
  232|   876k|    }
  233|       |
  234|       |    // 2 bytes: 10xxxxxx xxxxxxxx (14 bits)
  235|   176k|    if (LIKELY(val < ZXC_VARINT_2B_LIMIT)) {
  ------------------
  |  |  146|   176k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 174k, False: 1.62k]
  |  |  ------------------
  ------------------
  236|   174k|        dst[0] = (uint8_t)(0x80 | (val & 0x3F));
  237|   174k|        dst[1] = (uint8_t)(val >> 6);
  238|   174k|        return 2;
  239|   174k|    }
  240|       |
  241|       |    // 3 bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> max emittable value,
  242|       |    // matching ZXC_MAX_VARINT_VALUE = ZXC_BLOCK_SIZE_MAX - 1.
  243|  1.62k|    dst[0] = (uint8_t)(0xC0 | (val & 0x1F));
  244|  1.62k|    dst[1] = (uint8_t)(val >> 5);
  245|  1.62k|    dst[2] = (uint8_t)(val >> 13);
  246|  1.62k|    return 3;
  247|   176k|}
zxc_compress.c:zxc_lz77_lazy_parse_pak_l1:
 2473|  2.36k|                                                   size_t* lit_c_out, size_t* extras_c_out) {
 2474|  2.36k|    return zxc_lz77_lazy_parse_pak_impl(ctx, src, src_sz, epoch_mark, min_offset, seq_c_out,
 2475|  2.36k|                                        lit_c_out, extras_c_out, ZXC_LEVEL_FASTEST);
 2476|  2.36k|}
zxc_compress.c:zxc_spl_parse:
 1792|  13.6k|                         size_t* RESTRICT extras_sz_out, uint16_t* RESTRICT max_offset_out) {
 1793|  13.6k|    const int level = ctx->compression_level;
 1794|  13.6k|    const size_t dict_sz = ctx->dict_size;
 1795|       |
 1796|  13.6k|    zxc_lz77_params_t lzp = zxc_get_lz77_params(level);
 1797|       |    // The floor is a candidate until the block itself clears it.
 1798|  13.6k|    if (lzp.min_offset > 1 && zxc_block_is_short_dist_bound(src + dict_sz, src_sz - dict_sz))
  ------------------
  |  Branch (1798:9): [True: 8.18k, False: 5.43k]
  |  Branch (1798:31): [True: 6.98k, False: 1.20k]
  ------------------
 1799|  6.98k|        lzp.min_offset = 1;
 1800|       |
 1801|  13.6k|    const uint32_t offset_mask = ctx->offset_mask;
 1802|  13.6k|    const uint32_t epoch_mark = zxc_lz_begin_block(ctx, src, dict_sz, level);
 1803|       |
 1804|  13.6k|    uint8_t* const literals = ctx->literals;
 1805|  13.6k|    uint8_t* const buf_tokens = ctx->buf_tokens;
 1806|  13.6k|    uint16_t* const buf_offsets = ctx->buf_offsets;
 1807|  13.6k|    uint8_t* const buf_extras = ctx->buf_extras;
 1808|       |
 1809|  13.6k|    uint32_t seq_c = 0;
 1810|  13.6k|    size_t lit_c = 0;
 1811|  13.6k|    size_t extras_sz = 0;
 1812|  13.6k|    uint16_t max_offset = 0;  // Track max offset for 1-byte/2-byte mode decision
 1813|       |
 1814|       |    // Level 6+: price-based optimal parser; below it, the lazy loop built for
 1815|       |    // the level at hand.
 1816|  13.6k|    int parse_rc;
 1817|  13.6k|    if (level >= ZXC_LEVEL_DENSITY) {
  ------------------
  |  Branch (1817:9): [True: 5.43k, False: 8.18k]
  ------------------
 1818|  5.43k|        parse_rc = zxc_lz77_optimal_parse_spl(ctx, src, src_sz, ctx->hash_table, ctx->hash_tags,
 1819|  5.43k|                                              ctx->chain_table, epoch_mark, offset_mask, level,
 1820|  5.43k|                                              literals, buf_tokens, buf_offsets, buf_extras, &seq_c,
 1821|  5.43k|                                              &lit_c, &extras_sz, &max_offset);
 1822|  8.18k|    } else if (level == ZXC_LEVEL_DEFAULT) {
  ------------------
  |  Branch (1822:16): [True: 2.94k, False: 5.24k]
  ------------------
 1823|  2.94k|        parse_rc = zxc_lz77_lazy_parse_spl_l3(ctx, src, src_sz, epoch_mark, lzp.min_offset, &seq_c,
 1824|  2.94k|                                              &lit_c, &extras_sz, &max_offset);
 1825|  5.24k|    } else if (level == ZXC_LEVEL_BALANCED) {
  ------------------
  |  Branch (1825:16): [True: 3.54k, False: 1.69k]
  ------------------
 1826|  3.54k|        parse_rc = zxc_lz77_lazy_parse_spl_l4(ctx, src, src_sz, epoch_mark, lzp.min_offset, &seq_c,
 1827|  3.54k|                                              &lit_c, &extras_sz, &max_offset);
 1828|  3.54k|    } else {
 1829|  1.69k|        parse_rc = zxc_lz77_lazy_parse_spl_l5(ctx, src, src_sz, epoch_mark, lzp.min_offset, &seq_c,
 1830|  1.69k|                                              &lit_c, &extras_sz, &max_offset);
 1831|  1.69k|    }
 1832|  13.6k|    if (UNLIKELY(parse_rc != ZXC_OK)) return parse_rc;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 1833|       |
 1834|       |    // Per-block match splitting on the parsed block (see zxc_spl_match_split_block).
 1835|  13.6k|    seq_c = zxc_spl_match_split_block(
 1836|  13.6k|        buf_tokens, buf_offsets, buf_extras, &extras_sz, ctx->buf_split, ctx->buf_split_hist, seq_c,
 1837|  13.6k|        lit_c, (max_offset <= UINT8_MAX) ? 1U : 2U, lzp.split_max, ctx->split_budget_pct);
  ------------------
  |  Branch (1837:16): [True: 9.40k, False: 4.21k]
  ------------------
 1838|       |    // Dictionary-table trainer hook: accumulate the REAL post-LZ literal
 1839|       |    // frequencies (see zxc_dict_train_huf). Cold path, NULL outside training.
 1840|  13.6k|    if (UNLIKELY(ctx->lit_freq_acc)) {
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 1841|      0|        for (size_t i = 0; i < lit_c; i++) ctx->lit_freq_acc[literals[i]]++;
  ------------------
  |  Branch (1841:28): [True: 0, False: 0]
  ------------------
 1842|      0|    }
 1843|       |
 1844|  13.6k|    *seq_c_out = seq_c;
 1845|  13.6k|    *lit_c_out = lit_c;
 1846|  13.6k|    *extras_sz_out = extras_sz;
 1847|  13.6k|    *max_offset_out = max_offset;
 1848|  13.6k|    return ZXC_OK;
 1849|  13.6k|}
zxc_compress.c:zxc_lz77_optimal_parse_spl:
 1212|  5.43k|                                      uint16_t* RESTRICT max_offset_out) {
 1213|  5.43k|    zxc_lz77_params_t lzp_opt = zxc_get_lz77_params(level);
 1214|  5.43k|    lzp_opt.use_lazy = 0;  // guard
 1215|       |
 1216|       |    // With a dictionary, src = [dict | block]. The DP arrays index from the block
 1217|       |    // start, so src_base points at the first block byte for literal copies while
 1218|       |    // src stays the match finder's base.
 1219|  5.43k|    const size_t dict_sz = ctx->dict_size;
 1220|  5.43k|    const size_t block_sz = src_sz - dict_sz;
 1221|  5.43k|    const uint8_t* const src_base = src + dict_sz;
 1222|  5.43k|    const uint8_t* const iend = src + src_sz;
 1223|       |
 1224|       |    // Block too small for any match: emit all as literals.
 1225|  5.43k|    if (UNLIKELY(block_sz < ZXC_LZ_SEARCH_MARGIN + 1)) {
  ------------------
  |  |  152|  5.43k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 46, False: 5.38k]
  |  |  ------------------
  ------------------
 1226|     46|        if (block_sz > 0) ZXC_MEMCPY(literals, src_base, block_sz);
  ------------------
  |  |  168|     46|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  |  Branch (1226:13): [True: 46, False: 0]
  ------------------
 1227|     46|        *lit_c_out = block_sz;
 1228|     46|        *seq_c_out = 0;
 1229|     46|        *extras_sz_out = 0;
 1230|     46|        *max_offset_out = 0;
 1231|     46|        return 0;
 1232|     46|    }
 1233|       |
 1234|  5.38k|    const size_t search_limit_pos = block_sz - ZXC_LZ_SEARCH_MARGIN;
  ------------------
  |  |  765|  5.38k|#define ZXC_LZ_SEARCH_MARGIN (sizeof(uint64_t))
  ------------------
 1235|  5.38k|    const uint8_t* const search_limit = src + search_limit_pos;
 1236|       |
 1237|       |    // DP arrays carved from ctx->opt_scratch, one allocation reused across
 1238|       |    // blocks, each sub-buffer cache-line padded.
 1239|       |    //
 1240|       |    //   dp             : (chunk+1) x u32: min cost to reach position p.
 1241|       |    //   parent_len     : (chunk+1) x u16: 0 = literal, >= MIN_MATCH = match.
 1242|       |    //   parent_off     : (chunk+1) x u16: biased match offset (distance-1).
 1243|       |    //   match_end_bits : one bit per position, set when a match on the chosen
 1244|       |    //                    path ends there - a forward actions[] stack at 1/64
 1245|       |    //                    the cost.
 1246|       |    //
 1247|       |    // The same buffer doubles as package-merge scratch for the code-length
 1248|       |    // builder: that scratch is live before the DP and after the parse is read
 1249|       |    // out, never during, so capacity is just the larger of the two.
 1250|  5.38k|    size_t sz_dp;
 1251|  5.38k|    size_t sz_pl;
 1252|  5.38k|    size_t sz_po;
 1253|  5.38k|    size_t sz_bm;
 1254|  5.38k|    zxc_opt_dp_sizes(ctx->chunk_size, &sz_dp, &sz_pl, &sz_po, &sz_bm);
 1255|  5.38k|    const size_t n_bm_words = ZXC_BITMAP_WORDS(block_sz + 1);
  ------------------
  |  |  393|  5.38k|#define ZXC_BITMAP_WORDS(n_bits) (((n_bits) + 63) / 64)
  ------------------
 1256|       |
 1257|       |    // Per-block literal cost (sample only block data, not dict prefix):
 1258|  5.38k|    const uint32_t lit_cost = zxc_opt_estimate_lit_bits(src_base, block_sz, ctx->opt_scratch);
 1259|       |
 1260|  5.38k|    uint32_t* const dp = (uint32_t*)ctx->opt_scratch;
 1261|  5.38k|    uint16_t* const parent_len = (uint16_t*)(ctx->opt_scratch + sz_dp);
 1262|  5.38k|    uint16_t* const parent_off = (uint16_t*)(ctx->opt_scratch + sz_dp + sz_pl);
 1263|  5.38k|    uint64_t* const match_end_bits = (uint64_t*)(ctx->opt_scratch + sz_dp + sz_pl + sz_po);
 1264|       |
 1265|  5.38k|    dp[0] = 0;
 1266|  5.38k|    ZXC_MEMSET(dp + 1, 0xFF, block_sz * sizeof(uint32_t));
  ------------------
  |  |  173|  5.38k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1267|  5.38k|    ZXC_MEMSET(match_end_bits, 0, n_bm_words * sizeof(uint64_t));
  ------------------
  |  |  173|  5.38k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1268|       |
 1269|       |    // Forward DP: visit every position, update reachable successors.
 1270|       |    // `skip_until` suppresses find_best_match strictly inside the last long
 1271|       |    // match - the transition from its start already covers dp[p+1..p+L], and
 1272|       |    // re-searching there is what makes the parser quadratic on repetitive data.
 1273|  5.38k|    size_t skip_until = 0;
 1274|       |    // Rolling repeat-offset seed for find_best_match
 1275|  5.38k|    uint32_t last_off = 0;
 1276|       |    // Previous matched position and the length relaxed from it.
 1277|  5.38k|    size_t prev_p = 0;
 1278|  5.38k|    size_t prev_len = 0;
 1279|   127M|    for (size_t p = 0; p < search_limit_pos; p++) {
  ------------------
  |  Branch (1279:24): [True: 127M, False: 5.38k]
  ------------------
 1280|   127M|        if (UNLIKELY(dp[p] == UINT32_MAX)) continue;
  ------------------
  |  |  152|   127M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 127M]
  |  |  ------------------
  ------------------
 1281|       |
 1282|       |        // Literal transition.
 1283|   127M|        const uint32_t lit_next = dp[p] + lit_cost;
 1284|   127M|        if (lit_next < dp[p + 1]) {
  ------------------
  |  Branch (1284:13): [True: 53.1M, False: 73.9M]
  ------------------
 1285|  53.1M|            dp[p + 1] = lit_next;
 1286|  53.1M|            parent_len[p + 1] = 0;
 1287|  53.1M|        }
 1288|       |
 1289|   127M|        if (p < skip_until) continue;
  ------------------
  |  Branch (1289:13): [True: 46.0M, False: 81.0M]
  ------------------
 1290|       |
 1291|       |        // Match transition: no lazy, no backtrack (anchor=ip). Sub-lengths are
 1292|       |        // iterated because any L <= max_L matches at the same offset and may end
 1293|       |        // at a more useful DP position. ip is absolute so dict references
 1294|       |        // resolve against src.
 1295|  81.0M|        const uint8_t* ip = src_base + p;
 1296|  81.0M|        const zxc_match_t m = zxc_lz77_find_best_match(
 1297|  81.0M|            src, ip, zxc_hash_func(zxc_le64(ip), zxc_lz77_use_hash5(level)), iend, search_limit,
 1298|  81.0M|            /*anchor=*/ip, hash_table, hash_tags, chain_table, epoch_mark, offset_mask, level,
 1299|  81.0M|            lzp_opt, last_off);
 1300|       |
 1301|  81.0M|        if (m.ref) {
  ------------------
  |  Branch (1301:13): [True: 31.7M, False: 49.2M]
  ------------------
 1302|  31.7M|            const uint32_t off = (uint32_t)(ip - m.ref);
 1303|  31.7M|            if (off > 0 && off <= ZXC_LZ_WINDOW_SIZE) {
  ------------------
  |  |  582|  31.7M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  ------------------
  |  Branch (1303:17): [True: 31.7M, False: 0]
  |  Branch (1303:28): [True: 31.7M, False: 0]
  ------------------
 1304|  31.7M|                last_off = off;
 1305|  31.7M|                const size_t L_max_raw = (m.len > block_sz - p) ? (block_sz - p) : (size_t)m.len;
  ------------------
  |  Branch (1305:42): [True: 0, False: 31.7M]
  ------------------
 1306|  31.7M|                const size_t L_max = (L_max_raw > UINT16_MAX) ? UINT16_MAX : L_max_raw;
  ------------------
  |  Branch (1306:38): [True: 28, False: 31.7M]
  ------------------
 1307|       |
 1308|       |                // Cost is piecewise constant in varint segments, so split
 1309|       |                // [MIN_MATCH, L_max] into:
 1310|       |                //   1. cheap   : v < ML_MASK                   -> base
 1311|       |                //   2. varint1 : v in [ML_MASK, ML_MASK + VARINT_1B_LIMIT) -> base + 8
 1312|       |                //   3. varint2+: v >= ML_MASK + VARINT_1B_LIMIT            -> base + 16, ...
 1313|       |                // The first two have a constant nxt and vectorize; the third is
 1314|       |                // rare enough to stay scalar.
 1315|  31.7M|                const uint16_t off_biased = (uint16_t)(off - ZXC_LZ_OFFSET_BIAS);
  ------------------
  |  |  724|  31.7M|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1316|  31.7M|                const size_t L_max_plus = L_max + 1;
 1317|  31.7M|                const size_t L_cheap_end = ZXC_LZ_MIN_MATCH_LEN + ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  586|  31.7M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
                              const size_t L_cheap_end = ZXC_LZ_MIN_MATCH_LEN + ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  524|  31.7M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|  31.7M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1318|  31.7M|                const size_t L_v1_end = L_cheap_end + ZXC_VARINT_1B_LIMIT;
  ------------------
  |  |  600|  31.7M|#define ZXC_VARINT_1B_LIMIT (1U << 7)
  ------------------
 1319|  31.7M|                const uint32_t nxt_cheap = dp[p] + ZXC_OPT_MATCH_COST_BASE;
  ------------------
  |  |  774|  31.7M|#define ZXC_OPT_MATCH_COST_BASE ((uint32_t)(3U * CHAR_BIT))
  ------------------
 1320|  31.7M|                const uint32_t nxt_v1 = nxt_cheap + CHAR_BIT;
 1321|       |
 1322|       |                // Covered: each processed position q bounds dp[q+l] by
 1323|       |                // dp[q] + cost(l), by relaxing or through its own predecessor.
 1324|       |                // With dp[p] >= dp[p-1], length l only wins where cost(l) <
 1325|       |                // cost(l+1): the last length of the two classes below
 1326|       |                // ZXC_OPT_LONG_MATCH_SKIP. Costs ignore the offset.
 1327|  31.7M|                const int covered = prev_len > L_max && prev_p + 1 == p && dp[p] >= dp[p - 1];
  ------------------
  |  Branch (1327:37): [True: 27.6M, False: 4.15M]
  |  Branch (1327:57): [True: 27.5M, False: 39.5k]
  |  Branch (1327:76): [True: 27.0M, False: 568k]
  ------------------
 1328|  31.7M|                prev_p = p;
 1329|  31.7M|                prev_len = L_max;
 1330|       |
 1331|  31.7M|                if (covered) {
  ------------------
  |  Branch (1331:21): [True: 27.0M, False: 4.76M]
  ------------------
 1332|  27.0M|                    if (L_max_plus >= L_cheap_end)
  ------------------
  |  Branch (1332:25): [True: 14.7M, False: 12.2M]
  ------------------
 1333|  14.7M|                        zxc_opt_relax(dp, parent_len, parent_off, p, L_cheap_end - 1, nxt_cheap,
 1334|  14.7M|                                      off_biased);
 1335|  27.0M|                    if (L_max_plus >= L_v1_end)
  ------------------
  |  Branch (1335:25): [True: 1.20M, False: 25.8M]
  ------------------
 1336|  1.20M|                        zxc_opt_relax(dp, parent_len, parent_off, p, L_v1_end - 1, nxt_v1,
 1337|  1.20M|                                      off_biased);
 1338|  27.0M|                } else {
 1339|       |                    // 1. Cheap range.
 1340|  4.76M|                    size_t L = zxc_opt_dp_update_const_cost(
 1341|  4.76M|                        dp, parent_len, parent_off, p, ZXC_LZ_MIN_MATCH_LEN,
  ------------------
  |  |  586|  4.76M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1342|  4.76M|                        (L_max_plus < L_cheap_end) ? L_max_plus : L_cheap_end, nxt_cheap,
  ------------------
  |  Branch (1342:25): [True: 3.92M, False: 846k]
  ------------------
 1343|  4.76M|                        off_biased);
 1344|       |
 1345|       |                    // 2. First varint level (1-byte extension).
 1346|  4.76M|                    if (L < L_max_plus)
  ------------------
  |  Branch (1346:25): [True: 813k, False: 3.95M]
  ------------------
 1347|   813k|                        L = zxc_opt_dp_update_const_cost(
 1348|   813k|                            dp, parent_len, parent_off, p, L,
 1349|   813k|                            (L_max_plus < L_v1_end) ? L_max_plus : L_v1_end, nxt_v1, off_biased);
  ------------------
  |  Branch (1349:29): [True: 727k, False: 85.7k]
  ------------------
 1350|       |
 1351|       |                    // 3. Higher varint levels: variable cost, kept scalar.
 1352|       |                    // Reached only by L >= ML_MASK + 128 + MIN_MATCH, so the
 1353|       |                    // v >= ML_MASK guard from the original loop is implied.
 1354|  45.7M|                    for (; L < L_max_plus; L++) {
  ------------------
  |  Branch (1354:28): [True: 40.9M, False: 4.76M]
  ------------------
 1355|  40.9M|                        uint32_t cost = ZXC_OPT_MATCH_COST_BASE;
  ------------------
  |  |  774|  40.9M|#define ZXC_OPT_MATCH_COST_BASE ((uint32_t)(3U * CHAR_BIT))
  ------------------
 1356|  40.9M|                        uint32_t v = (uint32_t)(L - ZXC_LZ_MIN_MATCH_LEN) - ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  586|  40.9M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
                                      uint32_t v = (uint32_t)(L - ZXC_LZ_MIN_MATCH_LEN) - ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  524|  40.9M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|  40.9M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1357|  40.9M|                        cost += CHAR_BIT;
 1358|  84.4M|                        while (v >= 128) {
  ------------------
  |  Branch (1358:32): [True: 43.4M, False: 40.9M]
  ------------------
 1359|  43.4M|                            v >>= 7;
 1360|  43.4M|                            cost += CHAR_BIT;
 1361|  43.4M|                        }
 1362|  40.9M|                        zxc_opt_relax(dp, parent_len, parent_off, p, L, dp[p] + cost, off_biased);
 1363|  40.9M|                    }
 1364|  4.76M|                }
 1365|  31.7M|                if (UNLIKELY(L_max >= ZXC_OPT_LONG_MATCH_SKIP)) skip_until = p + L_max - 1;
  ------------------
  |  |  152|  31.7M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 47.5k, False: 31.7M]
  |  |  ------------------
  ------------------
 1366|  31.7M|            }
 1367|  31.7M|        }
 1368|  81.0M|    }
 1369|       |
 1370|       |    // Tail (last ZXC_LZ_SEARCH_MARGIN bytes) can only be literals: the match finder
 1371|       |    // stops at search_limit so its 8-byte probe reads stay in bounds.
 1372|  48.4k|    for (size_t p = search_limit_pos; p < block_sz; p++) {
  ------------------
  |  Branch (1372:39): [True: 43.1k, False: 5.38k]
  ------------------
 1373|  43.1k|        if (UNLIKELY(dp[p] == UINT32_MAX)) continue;
  ------------------
  |  |  152|  43.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 43.1k]
  |  |  ------------------
  ------------------
 1374|  43.1k|        const uint32_t lit_next = dp[p] + lit_cost;
 1375|  43.1k|        if (lit_next < dp[p + 1]) {
  ------------------
  |  Branch (1375:13): [True: 31.9k, False: 11.1k]
  ------------------
 1376|  31.9k|            dp[p + 1] = lit_next;
 1377|  31.9k|            parent_len[p + 1] = 0;
 1378|  31.9k|        }
 1379|  43.1k|    }
 1380|       |
 1381|       |    // Backtrack from src_sz to 0. Only match endpoints are recorded; literals
 1382|       |    // are the unmarked runs between them, rebuilt at emission from lit_start,
 1383|       |    // so they need no backtrack storage.
 1384|  5.38k|    {
 1385|  5.38k|        size_t pos = block_sz;
 1386|  48.0M|        while (pos > 0) {
  ------------------
  |  Branch (1386:16): [True: 48.0M, False: 5.38k]
  ------------------
 1387|  48.0M|            const uint32_t L = parent_len[pos];
 1388|  48.0M|            if (L == 0) {
  ------------------
  |  Branch (1388:17): [True: 45.7M, False: 2.28M]
  ------------------
 1389|  45.7M|                pos -= 1;
 1390|  45.7M|            } else {
 1391|  2.28M|                match_end_bits[pos >> 6] |= (uint64_t)1 << (pos & 63);
 1392|  2.28M|                pos -= L;
 1393|  2.28M|            }
 1394|  48.0M|        }
 1395|  5.38k|    }
 1396|       |
 1397|       |    // Forward emission: walk match_end_bits word-by-word, peeling set bits
 1398|       |    // with ctzll. Each set bit gives a match endpoint; parent_len/parent_off
 1399|       |    // at that position recover (length, offset).
 1400|  5.38k|    uint32_t seq_c = 0;
 1401|  5.38k|    size_t lit_c = 0;
 1402|  5.38k|    size_t extras_sz = 0;
 1403|  5.38k|    uint16_t max_offset = 0;
 1404|  5.38k|    size_t lit_start = 0;
 1405|       |
 1406|  1.99M|    for (size_t word_idx = 0; word_idx < n_bm_words; word_idx++) {
  ------------------
  |  Branch (1406:31): [True: 1.98M, False: 5.38k]
  ------------------
 1407|  1.98M|        uint64_t w = match_end_bits[word_idx];
 1408|  4.27M|        while (w) {
  ------------------
  |  Branch (1408:16): [True: 2.28M, False: 1.98M]
  ------------------
 1409|  2.28M|            const size_t pos = (word_idx << 6) + (size_t)zxc_ctz64(w);
 1410|  2.28M|            w &= w - 1;
 1411|  2.28M|            const uint32_t L = parent_len[pos];
 1412|  2.28M|            const uint16_t off_biased = parent_off[pos];
 1413|  2.28M|            const size_t match_start = pos - L;
 1414|       |
 1415|  2.28M|            const size_t LL = match_start - lit_start;
 1416|  2.28M|            if (LL > 0) {
  ------------------
  |  Branch (1416:17): [True: 1.60M, False: 682k]
  ------------------
 1417|  1.60M|                ZXC_MEMCPY(literals + lit_c, src_base + lit_start, LL);
  ------------------
  |  |  168|  1.60M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1418|  1.60M|                lit_c += LL;
 1419|  1.60M|            }
 1420|  2.28M|            const uint32_t ll = (uint32_t)LL;
 1421|  2.28M|            const uint32_t ml = L - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|  2.28M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1422|  2.28M|            if (UNLIKELY(!zxc_spl_put_seq(buf_tokens, buf_offsets, buf_extras, &seq_c, &extras_sz,
  ------------------
  |  |  152|  2.28M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 2.28M]
  |  |  ------------------
  ------------------
 1423|  2.28M|                                          &max_offset, ll, ml, off_biased)))
 1424|      0|                return ZXC_ERROR_OVERFLOW;
 1425|  2.28M|            lit_start = pos;
 1426|  2.28M|        }
 1427|  1.98M|    }
 1428|       |
 1429|       |    // Tail literals after the last match (or all literals if no match).
 1430|  5.38k|    if (lit_start < block_sz) {
  ------------------
  |  Branch (1430:9): [True: 4.68k, False: 708]
  ------------------
 1431|  4.68k|        const size_t tail = block_sz - lit_start;
 1432|  4.68k|        ZXC_MEMCPY(literals + lit_c, src_base + lit_start, tail);
  ------------------
  |  |  168|  4.68k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1433|  4.68k|        lit_c += tail;
 1434|  4.68k|    }
 1435|       |
 1436|  5.38k|    *seq_c_out = seq_c;
 1437|  5.38k|    *lit_c_out = lit_c;
 1438|  5.38k|    *extras_sz_out = extras_sz;
 1439|  5.38k|    *max_offset_out = max_offset;
 1440|  5.38k|    return 0;
 1441|  5.38k|}
zxc_compress.c:zxc_opt_estimate_lit_bits:
 1127|  5.38k|                                          void* RESTRICT scratch) {
 1128|  5.38k|    if (UNLIKELY(src_sz < ZXC_OPT_LIT_SAMPLE_MIN)) return CHAR_BIT;
  ------------------
  |  |  152|  5.38k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 2.59k, False: 2.78k]
  |  |  ------------------
  ------------------
 1129|       |
 1130|  2.78k|    uint32_t hist[ZXC_HUF_NUM_SYMBOLS] = {0};
 1131|  2.78k|    const size_t step =
 1132|  2.78k|        (src_sz > ZXC_OPT_LIT_SAMPLE_TARGET) ? src_sz / ZXC_OPT_LIT_SAMPLE_TARGET : 1U;
  ------------------
  |  |  787|  2.78k|#define ZXC_OPT_LIT_SAMPLE_TARGET 4096
  ------------------
                      (src_sz > ZXC_OPT_LIT_SAMPLE_TARGET) ? src_sz / ZXC_OPT_LIT_SAMPLE_TARGET : 1U;
  ------------------
  |  |  787|  2.10k|#define ZXC_OPT_LIT_SAMPLE_TARGET 4096
  ------------------
  |  Branch (1132:9): [True: 2.10k, False: 683]
  ------------------
 1133|  2.78k|    size_t sampled = 0;
 1134|  11.1M|    for (size_t i = 0; i < src_sz; i += step) {
  ------------------
  |  Branch (1134:24): [True: 11.1M, False: 2.78k]
  ------------------
 1135|  11.1M|        hist[src[i]]++;
 1136|  11.1M|        sampled++;
 1137|  11.1M|    }
 1138|       |
 1139|  2.78k|    uint8_t code_len[ZXC_HUF_NUM_SYMBOLS];
 1140|  2.78k|    if (UNLIKELY(zxc_huf_build_code_lengths(hist, code_len, scratch,
  ------------------
  |  |  152|  2.78k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 2.78k]
  |  |  ------------------
  ------------------
 1141|  2.78k|                                            ZXC_HUF_MAX_CODE_LEN_DENSITY) != ZXC_OK))
 1142|      0|        return CHAR_BIT;
 1143|       |
 1144|       |    // Sample-weighted sum of code lengths = predicted Huffman bits; divide by
 1145|       |    // the sample count for bits/byte, rounded up. The DP is integer, and
 1146|       |    // rounding up favours matches over fractional-cost literals.
 1147|  2.78k|    uint32_t total_bits = 0;
 1148|   716k|    for (int k = 0; k < ZXC_HUF_NUM_SYMBOLS; k++) {
  ------------------
  |  |  833|   716k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1148:21): [True: 713k, False: 2.78k]
  ------------------
 1149|   713k|        total_bits += hist[k] * (uint32_t)code_len[k];
 1150|   713k|    }
 1151|  2.78k|    const uint32_t n = (uint32_t)sampled;
 1152|  2.78k|    const uint32_t avg = (total_bits + n - 1) / n;
 1153|       |
 1154|       |    // Cap at RAW cost: if Huffman can't beat 8 bits/byte on the sample,
 1155|       |    // the encoder will pick RAW anyway and 8 is the actual literal cost.
 1156|  2.78k|    return (avg < CHAR_BIT) ? avg : CHAR_BIT;
  ------------------
  |  Branch (1156:12): [True: 1.11k, False: 1.67k]
  ------------------
 1157|  2.78k|}
zxc_compress.c:zxc_opt_relax:
  953|  66.3M|                                            const uint16_t off_biased) {
  954|  66.3M|    if (nxt < dp[p + L]) {
  ------------------
  |  Branch (954:9): [True: 48.7M, False: 17.5M]
  ------------------
  955|  48.7M|        dp[p + L] = nxt;
  956|  48.7M|        parent_len[p + L] = (uint16_t)L;
  957|  48.7M|        parent_off[p + L] = off_biased;
  958|  48.7M|    }
  959|  66.3M|}
zxc_compress.c:zxc_opt_dp_update_const_cost:
 1003|  5.58M|    const size_t p, size_t L, const size_t L_end, const uint32_t nxt, const uint16_t off_biased) {
 1004|       |#if defined(ZXC_USE_AVX512) && defined(__AVX512VL__)
 1005|       |    if (L + 16 <= L_end) {
 1006|       |        const __m512i v_inc =
 1007|       |            _mm512_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
 1008|       |        const __m512i v_nxt = _mm512_set1_epi32((int)nxt);
 1009|       |        const __m256i v_off = _mm256_set1_epi16((int16_t)off_biased);
 1010|       |        for (; L + 16 <= L_end; L += 16) {
 1011|       |            const __m512i v_L_lanes = _mm512_add_epi32(v_inc, _mm512_set1_epi32((int)L));
 1012|       |            const __m512i v_dp = _mm512_loadu_si512((const void*)&dp[p + L]);
 1013|       |            const __mmask16 m = _mm512_cmplt_epu32_mask(v_nxt, v_dp);
 1014|       |            _mm512_mask_storeu_epi32(&dp[p + L], m, v_nxt);
 1015|       |            const __m256i v_L_u16 = _mm512_cvtusepi32_epi16(v_L_lanes);
 1016|       |            _mm256_mask_storeu_epi16((void*)&parent_len[p + L], m, v_L_u16);
 1017|       |            _mm256_mask_storeu_epi16((void*)&parent_off[p + L], m, v_off);
 1018|       |        }
 1019|       |    }
 1020|       |#elif defined(ZXC_USE_AVX2)
 1021|       |    if (L + 8 <= L_end) {
 1022|       |        const __m256i v_inc = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
 1023|       |        const __m256i v_nxt = _mm256_set1_epi32((int)nxt);
 1024|       |        const __m256i v_bias = _mm256_set1_epi32((int)0x80000000);
 1025|       |        const __m256i v_nxt_b = _mm256_xor_si256(v_nxt, v_bias);
 1026|       |        const __m128i v_off = _mm_set1_epi16((int16_t)off_biased);
 1027|       |        for (; L + 8 <= L_end; L += 8) {
 1028|       |            const __m256i v_L_lanes = _mm256_add_epi32(v_inc, _mm256_set1_epi32((int)L));
 1029|       |            const __m256i v_dp = _mm256_loadu_si256((const __m256i*)&dp[p + L]);
 1030|       |            // Unsigned-compare-via-bias trick:
 1031|       |            //   (dp ^ 0x80000000) > (nxt ^ 0x80000000)  iff  dp > nxt
 1032|       |            // because XOR with the sign bit maps unsigned ordering to
 1033|       |            // signed ordering. AVX2 only has signed cmpgt for 32-bit.
 1034|       |            const __m256i v_dp_b = _mm256_xor_si256(v_dp, v_bias);
 1035|       |            const __m256i v_mask = _mm256_cmpgt_epi32(v_dp_b, v_nxt_b);
 1036|       |            const __m256i v_dp_new = _mm256_blendv_epi8(v_dp, v_nxt, v_mask);
 1037|       |            _mm256_storeu_si256((__m256i*)&dp[p + L], v_dp_new);
 1038|       |            // Pack 8x int32 mask -> 8x int16 mask with signed saturation:
 1039|       |            // 0xFFFFFFFF -> 0xFFFF, 0x00000000 -> 0x0000.
 1040|       |            const __m128i v_mask16 = _mm_packs_epi32(_mm256_castsi256_si128(v_mask),
 1041|       |                                                     _mm256_extracti128_si256(v_mask, 1));
 1042|       |            const __m128i v_L_u16 = _mm_packus_epi32(_mm256_castsi256_si128(v_L_lanes),
 1043|       |                                                     _mm256_extracti128_si256(v_L_lanes, 1));
 1044|       |            const __m128i v_pl = _mm_loadu_si128((const __m128i*)&parent_len[p + L]);
 1045|       |            const __m128i v_pl_new = _mm_blendv_epi8(v_pl, v_L_u16, v_mask16);
 1046|       |            _mm_storeu_si128((__m128i*)&parent_len[p + L], v_pl_new);
 1047|       |            const __m128i v_po = _mm_loadu_si128((const __m128i*)&parent_off[p + L]);
 1048|       |            const __m128i v_po_new = _mm_blendv_epi8(v_po, v_off, v_mask16);
 1049|       |            _mm_storeu_si128((__m128i*)&parent_off[p + L], v_po_new);
 1050|       |        }
 1051|       |    }
 1052|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1053|       |    if (L + 4 <= L_end) {
 1054|       |        static const uint32_t k_inc_array[4] = {0, 1, 2, 3};
 1055|       |        const uint32x4_t v_inc = vld1q_u32(k_inc_array);
 1056|       |        const uint32x4_t v_nxt = vdupq_n_u32(nxt);
 1057|       |        const uint16x4_t v_off = vdup_n_u16(off_biased);
 1058|       |        for (; L + 4 <= L_end; L += 4) {
 1059|       |            const uint32x4_t v_L_lanes = vaddq_u32(v_inc, vdupq_n_u32((uint32_t)L));
 1060|       |            const uint32x4_t v_dp = vld1q_u32(&dp[p + L]);
 1061|       |            const uint32x4_t v_mask = vcgtq_u32(v_dp, v_nxt);
 1062|       |            vst1q_u32(&dp[p + L], vbslq_u32(v_mask, v_nxt, v_dp));
 1063|       |            const uint16x4_t v_mask16 = vmovn_u32(v_mask);
 1064|       |            const uint16x4_t v_L_u16 = vqmovn_u32(v_L_lanes);
 1065|       |            const uint16x4_t v_pl = vld1_u16(&parent_len[p + L]);
 1066|       |            vst1_u16(&parent_len[p + L], vbsl_u16(v_mask16, v_L_u16, v_pl));
 1067|       |            const uint16x4_t v_po = vld1_u16(&parent_off[p + L]);
 1068|       |            vst1_u16(&parent_off[p + L], vbsl_u16(v_mask16, v_off, v_po));
 1069|       |        }
 1070|       |    }
 1071|       |#elif defined(ZXC_OPT_SSE2)
 1072|  5.58M|    if (L + 4 <= L_end) {
  ------------------
  |  Branch (1072:9): [True: 2.93M, False: 2.64M]
  ------------------
 1073|  2.93M|        const __m128i v_inc = _mm_setr_epi32(0, 1, 2, 3);
 1074|  2.93M|        const __m128i v_nxt = _mm_set1_epi32((int)nxt);
 1075|  2.93M|        const __m128i v_bias = _mm_set1_epi32((int)0x80000000);
 1076|  2.93M|        const __m128i v_nxt_b = _mm_xor_si128(v_nxt, v_bias);
 1077|  2.93M|        const __m128i v_off = _mm_set1_epi16((short)off_biased);
 1078|  14.5M|        for (; L + 4 <= L_end; L += 4) {
  ------------------
  |  Branch (1078:16): [True: 11.6M, False: 2.93M]
  ------------------
 1079|  11.6M|            const __m128i v_L_lanes = _mm_add_epi32(v_inc, _mm_set1_epi32((int)L));
 1080|  11.6M|            const __m128i v_dp = _mm_loadu_si128((const __m128i*)&dp[p + L]);
 1081|       |            // Unsigned compare via sign-bit bias (SSE2 cmpgt is signed only):
 1082|       |            //   (dp ^ 0x80000000) > (nxt ^ 0x80000000)  iff  dp > nxt.
 1083|  11.6M|            const __m128i v_dp_b = _mm_xor_si128(v_dp, v_bias);
 1084|  11.6M|            const __m128i v_mask = _mm_cmpgt_epi32(v_dp_b, v_nxt_b);
 1085|  11.6M|            const __m128i v_dp_new = zxc_mm_blendv_epi8_sse2(v_dp, v_nxt, v_mask);
 1086|  11.6M|            _mm_storeu_si128((__m128i*)&dp[p + L], v_dp_new);
 1087|       |            // Narrow the 4x int32 mask / length lanes to 4x int16 (low 64 bits).
 1088|       |            // packs: 0xFFFFFFFF -> 0xFFFF, 0 -> 0; packus (SSE2-emulated): u32->u16.
 1089|  11.6M|            const __m128i v_mask16 = _mm_packs_epi32(v_mask, v_mask);
 1090|  11.6M|            const __m128i v_L_u16 = zxc_mm_packus_epi32_sse2(v_L_lanes, v_L_lanes);
 1091|  11.6M|            __m128i v_pl = _mm_loadl_epi64((const __m128i*)&parent_len[p + L]);
 1092|  11.6M|            v_pl = zxc_mm_blendv_epi8_sse2(v_pl, v_L_u16, v_mask16);
 1093|  11.6M|            _mm_storel_epi64((__m128i*)&parent_len[p + L], v_pl);
 1094|  11.6M|            __m128i v_po = _mm_loadl_epi64((const __m128i*)&parent_off[p + L]);
 1095|  11.6M|            v_po = zxc_mm_blendv_epi8_sse2(v_po, v_off, v_mask16);
 1096|  11.6M|            _mm_storel_epi64((__m128i*)&parent_off[p + L], v_po);
 1097|  11.6M|        }
 1098|  2.93M|    }
 1099|  5.58M|#endif
 1100|       |    // Scalar tail (and full path on archs without SIMD).
 1101|       |    // L < L_end <= UINT16_MAX (caller precondition), so the cast is lossless.
 1102|  14.9M|    for (; L < L_end; L++) zxc_opt_relax(dp, parent_len, parent_off, p, L, nxt, off_biased);
  ------------------
  |  Branch (1102:12): [True: 9.40M, False: 5.58M]
  ------------------
 1103|  5.58M|    return L;
 1104|  5.58M|}
zxc_compress.c:zxc_mm_blendv_epi8_sse2:
  179|  34.8M|static ZXC_ALWAYS_INLINE __m128i zxc_mm_blendv_epi8_sse2(__m128i a, __m128i b, __m128i mask) {
  180|  34.8M|    return _mm_or_si128(_mm_and_si128(mask, b), _mm_andnot_si128(mask, a));
  181|  34.8M|}
zxc_compress.c:zxc_mm_packus_epi32_sse2:
  195|  11.6M|static ZXC_ALWAYS_INLINE __m128i zxc_mm_packus_epi32_sse2(__m128i a, __m128i b) {
  196|  11.6M|    const __m128i bias32 = _mm_set1_epi32(0x8000);
  197|  11.6M|    const __m128i bias16 = _mm_set1_epi16((short)0x8000);
  198|  11.6M|    const __m128i pa = _mm_sub_epi32(a, bias32);
  199|  11.6M|    const __m128i pb = _mm_sub_epi32(b, bias32);
  200|  11.6M|    return _mm_add_epi16(_mm_packs_epi32(pa, pb), bias16);
  201|  11.6M|}
zxc_compress.c:zxc_spl_put_seq:
  285|  3.06M|                                             const uint32_t ml, const uint16_t off_biased) {
  286|  3.06M|    const uint8_t ll_code = (ll >= ZXC_TOKEN_LL_MASK) ? ZXC_TOKEN_LL_MASK : (uint8_t)ll;
  ------------------
  |  |  522|  3.06M|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  518|  3.06M|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
                  const uint8_t ll_code = (ll >= ZXC_TOKEN_LL_MASK) ? ZXC_TOKEN_LL_MASK : (uint8_t)ll;
  ------------------
  |  |  522|   438k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  518|   438k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (286:29): [True: 438k, False: 2.62M]
  ------------------
  287|  3.06M|    const uint8_t ml_code = (ml >= ZXC_TOKEN_ML_MASK) ? ZXC_TOKEN_ML_MASK : (uint8_t)ml;
  ------------------
  |  |  524|  3.06M|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|  3.06M|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
                  const uint8_t ml_code = (ml >= ZXC_TOKEN_ML_MASK) ? ZXC_TOKEN_ML_MASK : (uint8_t)ml;
  ------------------
  |  |  524|   556k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|   556k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (287:29): [True: 556k, False: 2.50M]
  ------------------
  288|  3.06M|    buf_tokens[*seq_c] = (uint8_t)((ll_code << ZXC_TOKEN_LIT_BITS) | ml_code);
  ------------------
  |  |  518|  3.06M|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
  289|  3.06M|    buf_offsets[*seq_c] = off_biased;
  290|  3.06M|    if (off_biased > *max_offset) *max_offset = off_biased;
  ------------------
  |  Branch (290:9): [True: 144k, False: 2.92M]
  ------------------
  291|  3.06M|    if (UNLIKELY(!zxc_emit_extra(buf_extras, extras_sz, ll, ZXC_TOKEN_LL_MASK) ||
  ------------------
  |  |  152|  6.13M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 3.06M]
  |  |  |  Branch (152:42): [True: 0, False: 3.06M]
  |  |  |  Branch (152:42): [True: 0, False: 3.06M]
  |  |  ------------------
  ------------------
  292|  3.06M|                 !zxc_emit_extra(buf_extras, extras_sz, ml, ZXC_TOKEN_ML_MASK)))
  293|      0|        return 0;
  294|  3.06M|    (*seq_c)++;
  295|  3.06M|    return 1;
  296|  3.06M|}
zxc_compress.c:zxc_lz77_lazy_parse_spl_l3:
 1743|  2.94k|                                                   uint16_t* max_offset_out) {
 1744|  2.94k|    return zxc_lz77_lazy_parse_spl_impl(ctx, src, src_sz, epoch_mark, min_offset, seq_c_out,
 1745|  2.94k|                                        lit_c_out, extras_sz_out, max_offset_out,
 1746|  2.94k|                                        ZXC_LEVEL_DEFAULT);
 1747|  2.94k|}
zxc_compress.c:zxc_lz77_lazy_parse_spl_impl:
 1648|  8.18k|    const int level) {
 1649|  8.18k|    zxc_lz77_params_t lzp = zxc_get_lz77_params(level);
 1650|  8.18k|    lzp.min_offset = min_offset;
 1651|  8.18k|    const uint32_t offset_mask = ctx->offset_mask;
 1652|       |
 1653|  8.18k|    const uint8_t* ip = src + ctx->dict_size;
 1654|  8.18k|    const uint8_t* iend = src + src_sz;
 1655|  8.18k|    const uint8_t* anchor = ip;
 1656|  8.18k|    const uint8_t* search_limit = iend - ZXC_LZ_SEARCH_MARGIN;
  ------------------
  |  |  765|  8.18k|#define ZXC_LZ_SEARCH_MARGIN (sizeof(uint64_t))
  ------------------
 1657|       |
 1658|  8.18k|    uint32_t* const hash_table = ctx->hash_table;
 1659|  8.18k|    uint8_t* const hash_tags = ctx->hash_tags;
 1660|  8.18k|    uint16_t* const chain_table = ctx->chain_table;
 1661|  8.18k|    uint8_t* const literals = ctx->literals;
 1662|  8.18k|    uint8_t* const buf_tokens = ctx->buf_tokens;
 1663|  8.18k|    uint16_t* const buf_offsets = ctx->buf_offsets;
 1664|  8.18k|    uint8_t* const buf_extras = ctx->buf_extras;
 1665|       |
 1666|  8.18k|    uint32_t seq_c = 0;
 1667|  8.18k|    size_t lit_c = 0;
 1668|  8.18k|    size_t extras_sz = 0;
 1669|  8.18k|    uint16_t max_offset = 0;
 1670|       |
 1671|  8.18k|    const int use_hash5 = zxc_lz77_use_hash5(level);
 1672|       |
 1673|  7.46M|    while (LIKELY(ip < search_limit)) {
  ------------------
  |  |  146|  7.46M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 7.45M, False: 8.18k]
  |  |  ------------------
  ------------------
 1674|  7.45M|        const size_t dist = (size_t)(ip - anchor);
 1675|  7.45M|        size_t step = lzp.step_base + (dist >> lzp.step_shift);
 1676|  7.45M|        if (UNLIKELY(ip + step >= search_limit)) step = 1;
  ------------------
  |  |  152|  7.45M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 62.0k, False: 7.39M]
  |  |  ------------------
  ------------------
 1677|       |
 1678|       |        // ip + step <= search_limit either way, so this read stays in the block.
 1679|       |        // cppcheck-suppress unreadVariable
 1680|  7.45M|        const uint32_t h_next = zxc_hash_func(zxc_le64(ip + step), use_hash5);
 1681|  7.45M|        ZXC_PREFETCH_READ(&hash_tags[h_next]);
  ------------------
  |  |  163|  7.45M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 1682|  7.45M|        ZXC_PREFETCH_READ(&hash_table[h_next]);
  ------------------
  |  |  163|  7.45M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 1683|       |
 1684|  7.45M|        const zxc_match_t m = zxc_lz77_find_best_match(
 1685|  7.45M|            src, ip, zxc_hash_func(zxc_le64(ip), use_hash5), iend, search_limit, anchor, hash_table,
 1686|  7.45M|            hash_tags, chain_table, epoch_mark, offset_mask, level, lzp,
 1687|  7.45M|            /*last_off=*/0U);
 1688|       |
 1689|  7.45M|        if (m.ref) {
  ------------------
  |  Branch (1689:13): [True: 781k, False: 6.67M]
  ------------------
 1690|   781k|            ip -= m.backtrack;
 1691|   781k|            const uint32_t ll = (uint32_t)(ip - anchor);
 1692|   781k|            const uint32_t ml = m.len - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|   781k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1693|   781k|            const uint32_t off = (uint32_t)(ip - m.ref);
 1694|   781k|            const uint16_t off_biased = (uint16_t)(off - ZXC_LZ_OFFSET_BIAS);
  ------------------
  |  |  724|   781k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1695|       |
 1696|   781k|            if (ll > 0) zxc_flush_literals(literals, &lit_c, anchor, ll, iend);
  ------------------
  |  Branch (1696:17): [True: 516k, False: 264k]
  ------------------
 1697|       |
 1698|   781k|            if (UNLIKELY(!zxc_spl_put_seq(buf_tokens, buf_offsets, buf_extras, &seq_c, &extras_sz,
  ------------------
  |  |  152|   781k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 781k]
  |  |  ------------------
  ------------------
 1699|   781k|                                          &max_offset, ll, ml, off_biased)))
 1700|      0|                return ZXC_ERROR_OVERFLOW;
 1701|       |
 1702|   781k|            if (m.len > 2 && level > ZXC_LEVEL_BALANCED) {
  ------------------
  |  Branch (1702:17): [True: 781k, False: 0]
  |  Branch (1702:30): [True: 280k, False: 500k]
  ------------------
 1703|   280k|                const uint8_t* match_end = ip + m.len;
 1704|   280k|                if (match_end < iend - 7) {
  ------------------
  |  Branch (1704:21): [True: 279k, False: 1.12k]
  ------------------
 1705|   279k|                    const uint32_t pos_u = (uint32_t)((match_end - 2) - src);
 1706|   279k|                    const uint64_t val_u8 = zxc_le64(match_end - 2);
 1707|   279k|                    const uint32_t val_u = (uint32_t)val_u8;
 1708|   279k|                    const uint32_t h_u = zxc_hash_func(val_u8, use_hash5);
 1709|   279k|                    const uint32_t prev_idx =
 1710|   279k|                        zxc_epoch_pos(hash_table[h_u], offset_mask, epoch_mark);
 1711|   279k|                    hash_table[h_u] = epoch_mark | pos_u;
 1712|   279k|                    hash_tags[h_u] = zxc_hash_tag(val_u);
 1713|   279k|                    chain_table[pos_u & ZXC_LZ_WINDOW_MASK] = zxc_chain_delta(pos_u, prev_idx);
  ------------------
  |  |  584|   279k|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  582|   279k|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
 1714|   279k|                }
 1715|   280k|            }
 1716|       |
 1717|   781k|            ip += m.len;
 1718|   781k|            anchor = ip;
 1719|  6.67M|        } else {
 1720|  6.67M|            ip += step;
 1721|  6.67M|        }
 1722|  7.45M|    }
 1723|       |
 1724|  8.18k|    const size_t last_lits = (size_t)(iend - anchor);
 1725|  8.18k|    if (last_lits > 0) {
  ------------------
  |  Branch (1725:9): [True: 7.44k, False: 745]
  ------------------
 1726|  7.44k|        ZXC_MEMCPY(literals + lit_c, anchor, last_lits);
  ------------------
  |  |  168|  7.44k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1727|  7.44k|        lit_c += last_lits;
 1728|  7.44k|    }
 1729|       |
 1730|  8.18k|    *seq_c_out = seq_c;
 1731|  8.18k|    *lit_c_out = lit_c;
 1732|  8.18k|    *extras_sz_out = extras_sz;
 1733|  8.18k|    *max_offset_out = max_offset;
 1734|  8.18k|    return ZXC_OK;
 1735|  8.18k|}
zxc_compress.c:zxc_lz77_lazy_parse_spl_l4:
 1754|  3.54k|                                                   uint16_t* max_offset_out) {
 1755|  3.54k|    return zxc_lz77_lazy_parse_spl_impl(ctx, src, src_sz, epoch_mark, min_offset, seq_c_out,
 1756|  3.54k|                                        lit_c_out, extras_sz_out, max_offset_out,
 1757|  3.54k|                                        ZXC_LEVEL_BALANCED);
 1758|  3.54k|}
zxc_compress.c:zxc_lz77_lazy_parse_spl_l5:
 1765|  1.69k|                                                   uint16_t* max_offset_out) {
 1766|  1.69k|    return zxc_lz77_lazy_parse_spl_impl(ctx, src, src_sz, epoch_mark, min_offset, seq_c_out,
 1767|  1.69k|                                        lit_c_out, extras_sz_out, max_offset_out,
 1768|  1.69k|                                        ZXC_LEVEL_COMPACT);
 1769|  1.69k|}
zxc_compress.c:zxc_spl_match_split_block:
  464|  13.6k|                                          const uint8_t budget_pct) {
  465|  13.6k|    if (n_seq == 0) return n_seq;
  ------------------
  |  Branch (465:9): [True: 851, False: 12.7k]
  ------------------
  466|  12.7k|    const uint8_t* const extras_end = extras + *extras_sz;
  467|  12.7k|    uint8_t ctx_bad[1U << ZXC_SPL_MATCH_SPLIT_CTX_BITS];
  468|       |
  469|       |    // 0. The caps: the budget's, then the gate's (same scratch, in turn).
  470|  12.7k|    uint32_t all_cap = ZXC_SPL_INLINE_ML_CODE, gate_cap = ZXC_SPL_INLINE_ML_CODE;
  ------------------
  |  |  677|  12.7k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  12.7k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  12.7k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  uint32_t all_cap = ZXC_SPL_INLINE_ML_CODE, gate_cap = ZXC_SPL_INLINE_ML_CODE;
  ------------------
  |  |  677|  12.7k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  12.7k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  12.7k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  471|  12.7k|    if (budget_pct)
  ------------------
  |  Branch (471:9): [True: 0, False: 12.7k]
  ------------------
  472|      0|        all_cap = zxc_spl_match_split_budget_cap(tokens, offsets, extras, *extras_sz, n_seq, lit_c,
  473|      0|                                                 off_bytes, (*hist_buf)[0][0], budget_pct);
  474|  12.7k|    if (gate_max > ZXC_SPL_INLINE_ML_CODE &&
  ------------------
  |  |  677|  25.5k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  12.7k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  12.7k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:9): [True: 7.74k, False: 5.02k]
  ------------------
  475|  7.74k|        zxc_spl_match_split_analyze(tokens, n_seq, hist_buf, ctx_bad, side))
  ------------------
  |  Branch (475:9): [True: 2.21k, False: 5.52k]
  ------------------
  476|  2.21k|        gate_cap = gate_max;
  477|  12.7k|    if (all_cap == ZXC_SPL_INLINE_ML_CODE && gate_cap == ZXC_SPL_INLINE_ML_CODE) return n_seq;
  ------------------
  |  |  677|  25.5k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  12.7k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  12.7k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (all_cap == ZXC_SPL_INLINE_ML_CODE && gate_cap == ZXC_SPL_INLINE_ML_CODE) return n_seq;
  ------------------
  |  |  677|  12.7k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  12.7k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  12.7k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (477:9): [True: 12.7k, False: 0]
  |  Branch (477:46): [True: 10.5k, False: 2.21k]
  ------------------
  478|       |
  479|       |    // 1. Mark the matches to split and drop their varints; the other extras
  480|       |    // move forward.
  481|  2.21k|    size_t r = 0, w = 0;
  482|  2.21k|    uint32_t extra = 0;
  483|   343k|    for (uint32_t i = 0; i < n_seq; i++) {
  ------------------
  |  Branch (483:26): [True: 341k, False: 2.21k]
  ------------------
  484|   341k|        const uint8_t tok = tokens[i];
  485|   341k|        const int bad = gate_cap != ZXC_SPL_INLINE_ML_CODE && ctx_bad[side[i]];
  ------------------
  |  |  677|   683k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|   341k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|   341k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (485:25): [True: 341k, False: 0]
  |  Branch (485:63): [True: 321k, False: 19.7k]
  ------------------
  486|   341k|        side[i] = 0;
  487|   341k|        if ((tok >> ZXC_TOKEN_LIT_BITS) == ZXC_TOKEN_LL_MASK)
  ------------------
  |  |  518|   341k|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
                      if ((tok >> ZXC_TOKEN_LIT_BITS) == ZXC_TOKEN_LL_MASK)
  ------------------
  |  |  522|   341k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  518|   341k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (487:13): [True: 43.3k, False: 298k]
  ------------------
  488|  43.3k|            zxc_varint_keep(extras, &w, &r, extras_end);
  489|   341k|        if ((tok & ZXC_TOKEN_ML_MASK) != ZXC_TOKEN_ML_MASK) continue;
  ------------------
  |  |  524|   341k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|   341k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
                      if ((tok & ZXC_TOKEN_ML_MASK) != ZXC_TOKEN_ML_MASK) continue;
  ------------------
  |  |  524|   341k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|   341k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (489:13): [True: 291k, False: 49.9k]
  ------------------
  490|  49.9k|        const uint8_t* p = extras + r;
  491|  49.9k|        const uint32_t code = zxc_read_varint(&p, extras_end) + ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  524|  49.9k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|  49.9k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  492|  49.9k|        if ((code <= all_cap && zxc_spl_match_split_far(offsets[i])) || (bad && code <= gate_cap)) {
  ------------------
  |  Branch (492:14): [True: 0, False: 49.9k]
  |  Branch (492:33): [True: 0, False: 0]
  |  Branch (492:74): [True: 37.8k, False: 12.1k]
  |  Branch (492:81): [True: 24.0k, False: 13.8k]
  ------------------
  493|  24.0k|            side[i] = (uint8_t)code;
  494|  24.0k|            extra += zxc_spl_match_split_pieces(code) - 1;
  495|  24.0k|            r = (size_t)(p - extras);
  496|  25.9k|        } else {
  497|  25.9k|            zxc_extras_move(extras, &w, &r, p);
  498|  25.9k|        }
  499|  49.9k|    }
  500|  2.21k|    *extras_sz = w;
  501|  2.21k|    if (extra == 0) return n_seq;
  ------------------
  |  Branch (501:9): [True: 1.01k, False: 1.20k]
  ------------------
  502|       |
  503|       |    // 2. Expand backward. A marked sequence spans its pieces, written forward: the
  504|       |    // first keeps the literal nibble and its escape, the last takes the remainder.
  505|  1.20k|    uint32_t out = n_seq + extra;
  506|   329k|    for (uint32_t i = n_seq; i-- > 0;) {
  ------------------
  |  Branch (506:30): [True: 328k, False: 1.20k]
  ------------------
  507|   328k|        const uint8_t tok = tokens[i];
  508|   328k|        const uint16_t off = offsets[i];
  509|   328k|        if (side[i] == 0) {
  ------------------
  |  Branch (509:13): [True: 304k, False: 24.0k]
  ------------------
  510|   304k|            out--;
  511|   304k|            tokens[out] = tok;
  512|   304k|            offsets[out] = off;
  513|   304k|            continue;
  514|   304k|        }
  515|  24.0k|        uint32_t code = side[i];
  516|  24.0k|        uint8_t ll_bits = tok & (uint8_t)(ZXC_TOKEN_LL_MASK << ZXC_TOKEN_LIT_BITS);
  ------------------
  |  |  522|  24.0k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  518|  24.0k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
                      uint8_t ll_bits = tok & (uint8_t)(ZXC_TOKEN_LL_MASK << ZXC_TOKEN_LIT_BITS);
  ------------------
  |  |  518|  24.0k|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
  517|  24.0k|        out -= zxc_spl_match_split_pieces(code);
  518|  24.0k|        uint32_t k = out;
  519|  48.0k|        while (code > ZXC_SPL_INLINE_ML_CODE) {
  ------------------
  |  |  677|  48.0k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  48.0k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  48.0k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (519:16): [True: 24.0k, False: 24.0k]
  ------------------
  520|  24.0k|            const uint32_t p = zxc_spl_match_split_piece(code);
  521|  24.0k|            tokens[k] = (uint8_t)(ll_bits | p);
  522|  24.0k|            offsets[k++] = off;
  523|  24.0k|            ll_bits = 0;
  524|  24.0k|            code -= p + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|  24.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  525|  24.0k|        }
  526|  24.0k|        tokens[k] = (uint8_t)(ll_bits | code);
  527|  24.0k|        offsets[k] = off;
  528|  24.0k|    }
  529|  1.20k|    return n_seq + extra;
  530|  2.21k|}
zxc_compress.c:zxc_spl_match_split_analyze:
  342|  7.74k|                                       uint8_t* RESTRICT ctx_bad, uint8_t* RESTRICT side) {
  343|  7.74k|    uint32_t order = ZXC_SPL_MATCH_SPLIT_CTX_BITS;
  ------------------
  |  |  693|  7.74k|#define ZXC_SPL_MATCH_SPLIT_CTX_BITS 8
  ------------------
  344|  52.2k|    while (order > 2 && (n_seq >> order) < 16) order--;
  ------------------
  |  Branch (344:12): [True: 45.2k, False: 7.08k]
  |  Branch (344:25): [True: 44.5k, False: 661]
  ------------------
  345|  7.74k|    const uint32_t hmask = (1U << order) - 1U;
  346|  7.74k|    uint32_t (*const ctx_hist)[2][1U << ZXC_SPL_MATCH_SPLIT_CTX_BITS] = *hist_buf;
  347|  38.7k|    for (uint32_t l = 0; l < 4; l++) {
  ------------------
  |  Branch (347:26): [True: 30.9k, False: 7.74k]
  ------------------
  348|  30.9k|        ZXC_MEMSET(ctx_hist[l][0], 0, (hmask + 1) * sizeof(uint32_t));
  ------------------
  |  |  173|  30.9k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  349|  30.9k|        ZXC_MEMSET(ctx_hist[l][1], 0, (hmask + 1) * sizeof(uint32_t));
  ------------------
  |  |  173|  30.9k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  350|  30.9k|    }
  351|  7.74k|    uint32_t hist = 0, n_esc = 0;
  352|   788k|    for (uint32_t i = 0; i < n_seq; i++) {
  ------------------
  |  Branch (352:26): [True: 781k, False: 7.74k]
  ------------------
  353|   781k|        const uint32_t esc = (tokens[i] & ZXC_TOKEN_ML_MASK) == ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  524|   781k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|   781k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
                      const uint32_t esc = (tokens[i] & ZXC_TOKEN_ML_MASK) == ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  524|   781k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|   781k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
  354|   781k|        side[i] = (uint8_t)hist;
  355|   781k|        ctx_hist[i & 3][esc][hist]++;
  356|   781k|        hist = ((hist << 1) | esc) & hmask;
  357|   781k|        n_esc += esc;
  358|   781k|    }
  359|       |    // No conditional sum here: GCC 14.2 miscompiles it for AVX-512
  360|  7.74k|    uint32_t errors = 0;
  361|  68.5k|    for (uint32_t c = 0; c <= hmask; c++) {
  ------------------
  |  Branch (361:26): [True: 60.8k, False: 7.74k]
  ------------------
  362|  60.8k|        uint32_t n0 = 0, n1 = 0;
  363|   304k|        for (uint32_t l = 0; l < 4; l++) {
  ------------------
  |  Branch (363:30): [True: 243k, False: 60.8k]
  ------------------
  364|   243k|            n0 += ctx_hist[l][0][c];
  365|   243k|            n1 += ctx_hist[l][1][c];
  366|   243k|        }
  367|  60.8k|        ctx_bad[c] = (n1 < n0);  // escape a strict minority in its context
  368|  60.8k|        errors += (n0 < n1) ? n0 : n1;
  ------------------
  |  Branch (368:19): [True: 11.1k, False: 49.6k]
  ------------------
  369|  60.8k|    }
  370|  7.74k|    return n_esc != 0 &&
  ------------------
  |  Branch (370:12): [True: 4.52k, False: 3.22k]
  ------------------
  371|  4.52k|           (uint64_t)errors * 100 >= (uint64_t)ZXC_SPL_MATCH_SPLIT_MIN_MISPREDICT_PCT * n_esc;
  ------------------
  |  |  696|  4.52k|#define ZXC_SPL_MATCH_SPLIT_MIN_MISPREDICT_PCT 80
  ------------------
  |  Branch (371:12): [True: 2.21k, False: 2.30k]
  ------------------
  372|  7.74k|}
zxc_compress.c:zxc_varint_keep:
  306|  43.3k|                                              size_t* RESTRICT r, const uint8_t* end) {
  307|  43.3k|    const uint8_t* p = extras + *r;
  308|  43.3k|    (void)zxc_read_varint(&p, end);
  309|  43.3k|    zxc_extras_move(extras, w, r, p);
  310|  43.3k|}
zxc_compress.c:zxc_spl_match_split_pieces:
  313|  48.0k|static ZXC_ALWAYS_INLINE uint32_t zxc_spl_match_split_pieces(const uint32_t code) {
  314|  48.0k|    return (code + ZXC_LZ_MIN_MATCH_LEN + ZXC_SPL_MAX_INLINE_ML - 1) / ZXC_SPL_MAX_INLINE_ML;
  ------------------
  |  |  586|  48.0k|#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;
  ------------------
  |  |  683|  48.0k|#define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  677|  48.0k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  524|  48.0k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  520|  48.0k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  586|  48.0k|#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;
  ------------------
  |  |  683|  48.0k|#define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  677|  48.0k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  524|  48.0k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  520|  48.0k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  ------------------
  |  |  |  |  586|  48.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  ------------------
  ------------------
  315|  48.0k|}
zxc_compress.c:zxc_extras_move:
  300|  69.3k|                                              size_t* RESTRICT r, const uint8_t* to) {
  301|   147k|    while (extras + *r < to) extras[(*w)++] = extras[(*r)++];
  ------------------
  |  Branch (301:12): [True: 78.3k, False: 69.3k]
  ------------------
  302|  69.3k|}
zxc_compress.c:zxc_spl_match_split_piece:
  319|  24.0k|static ZXC_ALWAYS_INLINE uint32_t zxc_spl_match_split_piece(const uint32_t code) {
  320|  24.0k|    const uint32_t rest = code - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|  24.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  321|  24.0k|    return (rest < ZXC_SPL_INLINE_ML_CODE) ? rest : ZXC_SPL_INLINE_ML_CODE;
  ------------------
  |  |  677|  24.0k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  24.0k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  24.0k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  return (rest < ZXC_SPL_INLINE_ML_CODE) ? rest : ZXC_SPL_INLINE_ML_CODE;
  ------------------
  |  |  677|  13.3k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  ------------------
  |  |  |  |  524|  13.3k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  520|  13.3k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (321:12): [True: 10.6k, False: 13.3k]
  ------------------
  322|  24.0k|}
zxc_compress.c:zxc_pak_emit:
 2529|  4.01k|                        size_t* RESTRICT const out_sz) {
 2530|  4.01k|    const size_t sz_lit = lit_c;
 2531|  4.01k|    const size_t sz_seq = seq_c * sizeof(uint32_t);
 2532|  4.01k|    const size_t sz_ext = extras_c;
 2533|       |
 2534|       |    // See the SPL twin. PAK literals are always RAW, so the slack always
 2535|       |    // matters here.
 2536|  4.01k|    const size_t behind_lit = sz_seq + sz_ext;
 2537|  4.01k|    const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  356|  4.01k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
                  const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  356|  1.71k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
  |  Branch (2537:24): [True: 1.71k, False: 2.30k]
  ------------------
 2538|       |
 2539|  4.01k|    if (!dst) {
  ------------------
  |  Branch (2539:9): [True: 0, False: 4.01k]
  ------------------
 2540|      0|        *out_sz = ZXC_BLOCK_HEADER_SIZE + ZXC_PAK_HEADER_BINARY_SIZE + sz_lit + behind_lit + pad;
  ------------------
  |  |  439|      0|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                      *out_sz = ZXC_BLOCK_HEADER_SIZE + ZXC_PAK_HEADER_BINARY_SIZE + sz_lit + behind_lit + pad;
  ------------------
  |  |  445|      0|#define ZXC_PAK_HEADER_BINARY_SIZE 12
  ------------------
 2541|      0|        return ZXC_OK;
 2542|      0|    }
 2543|  4.01k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  4.01k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.01k]
  |  |  ------------------
  ------------------
 2544|       |
 2545|  4.01k|    const uint8_t* const literals = ctx->literals;
 2546|  4.01k|    const uint8_t* const buf_extras = ctx->buf_extras;
 2547|  4.01k|    const uint32_t* const buf_sequences = ctx->buf_sequences;
 2548|       |
 2549|  4.01k|    zxc_block_header_t bh = {.block_type = ZXC_BLOCK_PAK};
 2550|  4.01k|    uint8_t* const p = dst + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  439|  4.01k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2551|  4.01k|    size_t rem = dst_cap - ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  439|  4.01k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2552|       |
 2553|  4.01k|    const zxc_gnr_header_t gh = {.n_sequences = seq_c,
 2554|  4.01k|                                 .n_literals = (uint32_t)lit_c,
 2555|  4.01k|                                 .enc_lit = ZXC_SECTION_ENCODING_RAW,
 2556|  4.01k|                                 .enc_tok = 0,
 2557|  4.01k|                                 .enc_mlen = 0,
 2558|  4.01k|                                 .enc_off = 0};
 2559|       |
 2560|  4.01k|    const int ghs = zxc_write_pak_header(p, rem, &gh);
 2561|  4.01k|    if (UNLIKELY(ghs < 0)) return ghs;
  ------------------
  |  |  152|  4.01k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.01k]
  |  |  ------------------
  ------------------
 2562|       |
 2563|  4.01k|    uint8_t* p_curr = p + ghs;
 2564|  4.01k|    rem -= (size_t)ghs;
 2565|       |
 2566|  4.01k|    if (UNLIKELY(rem < sz_lit + sz_seq + sz_ext + pad)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  4.01k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.01k]
  |  |  ------------------
  ------------------
 2567|       |
 2568|  4.01k|    ZXC_MEMCPY(p_curr, literals, lit_c);
  ------------------
  |  |  168|  4.01k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2569|  4.01k|    p_curr += lit_c;
 2570|       |
 2571|       |    // Write sequences in little-endian order
 2572|       |#ifdef ZXC_BIG_ENDIAN
 2573|       |    for (uint32_t i = 0; i < seq_c; i++) {
 2574|       |        zxc_store_le32(p_curr, buf_sequences[i]);
 2575|       |        p_curr += sizeof(uint32_t);
 2576|       |    }
 2577|       |#else
 2578|  4.01k|    ZXC_MEMCPY(p_curr, buf_sequences, sz_seq);
  ------------------
  |  |  168|  4.01k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2579|  4.01k|    p_curr += sz_seq;
 2580|  4.01k|#endif
 2581|       |
 2582|       |    // --- WRITE EXTRAS ---
 2583|  4.01k|    ZXC_MEMCPY(p_curr, buf_extras, sz_ext);
  ------------------
  |  |  168|  4.01k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2584|  4.01k|    p_curr += sz_ext;
 2585|       |
 2586|  4.01k|    ZXC_MEMSET(p_curr, 0, pad);
  ------------------
  |  |  173|  4.01k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2587|  4.01k|    p_curr += pad;
 2588|       |
 2589|  4.01k|    bh.comp_size = (uint32_t)(p_curr - (dst + ZXC_BLOCK_HEADER_SIZE));
  ------------------
  |  |  439|  4.01k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2590|  4.01k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 2591|  4.01k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  152|  4.01k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.01k]
  |  |  ------------------
  ------------------
 2592|       |
 2593|       |    // Checksum will be appended by the wrapper
 2594|  4.01k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + bh.comp_size;
  ------------------
  |  |  439|  4.01k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2595|  4.01k|    return ZXC_OK;
 2596|  4.01k|}
zxc_compress.c:zxc_spl_emit:
 1869|  13.6k|                        const size_t dst_cap, size_t* RESTRICT out_sz) {
 1870|  13.6k|    if (UNLIKELY(dst && dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  27.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  |  Branch (152:42): [True: 13.6k, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 1871|       |
 1872|  13.6k|    const int level = ctx->compression_level;
 1873|  13.6k|    const uint8_t* const literals = ctx->literals;
 1874|  13.6k|    const uint8_t* const buf_tokens = ctx->buf_tokens;
 1875|  13.6k|    const uint16_t* const buf_offsets = ctx->buf_offsets;
 1876|  13.6k|    const uint8_t* const buf_extras = ctx->buf_extras;
 1877|       |
 1878|       |    // --- RLE ANALYSIS ---
 1879|  13.6k|    size_t rle_size = 0;
 1880|  13.6k|    int enc_lit = ZXC_SECTION_ENCODING_RAW;
 1881|  13.6k|    size_t best_j = lit_c;
 1882|       |
 1883|  13.6k|    if (lit_c > 0) {
  ------------------
  |  Branch (1883:9): [True: 13.6k, False: 0]
  ------------------
 1884|  13.6k|        const uint8_t* p = literals;
 1885|  13.6k|        const uint8_t* const p_end = literals + lit_c;
 1886|  13.6k|        const uint8_t* const p_end_4 = p_end - 3;  // Safe limit for 4-byte lookahead
 1887|       |
 1888|   113k|        while (LIKELY(p < p_end)) {
  ------------------
  |  |  146|   113k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 99.4k, False: 13.6k]
  |  |  ------------------
  ------------------
 1889|  99.4k|            const uint8_t b = *p;
 1890|  99.4k|            const uint8_t* run_start = p++;
 1891|       |
 1892|       |            // Fast run counting with early SIMD exit
 1893|       |#if defined(ZXC_USE_AVX512)
 1894|       |            const __m512i vb = _mm512_set1_epi8((char)b);
 1895|       |            while (p <= p_end - 64) {
 1896|       |                const __m512i v = _mm512_loadu_si512((const void*)p);
 1897|       |                const __mmask64 mask = _mm512_cmpeq_epi8_mask(v, vb);
 1898|       |                if (mask != 0xFFFFFFFFFFFFFFFFULL) {
 1899|       |                    p += (size_t)zxc_ctz64(~mask);
 1900|       |                    goto _run_done;
 1901|       |                }
 1902|       |                p += 64;
 1903|       |            }
 1904|       |#elif defined(ZXC_USE_AVX2)
 1905|       |            const __m256i vb = _mm256_set1_epi8((char)b);
 1906|       |            while (p <= p_end - 32) {
 1907|       |                const __m256i v = _mm256_loadu_si256((const __m256i*)p);
 1908|       |                const uint32_t mask = (uint32_t)_mm256_movemask_epi8(_mm256_cmpeq_epi8(v, vb));
 1909|       |                if (mask != 0xFFFFFFFF) {
 1910|       |                    p += zxc_ctz32(~mask);
 1911|       |                    goto _run_done;
 1912|       |                }
 1913|       |                p += 32;
 1914|       |            }
 1915|       |#elif defined(ZXC_USE_SSE2)
 1916|       |            const __m128i vb = _mm_set1_epi8((char)b);
 1917|   130k|            while (p <= p_end - 16) {
  ------------------
  |  Branch (1917:20): [True: 119k, False: 11.2k]
  ------------------
 1918|   119k|                const __m128i v = _mm_loadu_si128((const __m128i*)p);
 1919|   119k|                const uint32_t mask = (uint32_t)_mm_movemask_epi8(_mm_cmpeq_epi8(v, vb));
 1920|   119k|                if (mask != 0xFFFFU) {
  ------------------
  |  Branch (1920:21): [True: 88.2k, False: 30.8k]
  ------------------
 1921|  88.2k|                    p += zxc_ctz32(~mask);
 1922|  88.2k|                    goto _run_done;
 1923|  88.2k|                }
 1924|  30.8k|                p += 16;
 1925|  30.8k|            }
 1926|       |#elif defined(ZXC_USE_NEON64)
 1927|       |            const uint8x16_t vb = vdupq_n_u8(b);
 1928|       |            while (p <= p_end - 16) {
 1929|       |                const uint8x16_t v = vld1q_u8(p);
 1930|       |                const uint8x16_t eq = vceqq_u8(v, vb);
 1931|       |                // SHRN nibble-mask: see find_best_match above for rationale.
 1932|       |                const uint64_t mask =
 1933|       |                    vget_lane_u64(vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(eq), 4)), 0);
 1934|       |                if (LIKELY(mask == ~(uint64_t)0)) {
 1935|       |                    p += 16;
 1936|       |                } else {
 1937|       |                    p += (size_t)(zxc_ctz64(~mask) >> 2);
 1938|       |                    goto _run_done;
 1939|       |                }
 1940|       |            }
 1941|       |#elif defined(ZXC_USE_NEON32)
 1942|       |            uint8x16_t vb = vdupq_n_u8(b);
 1943|       |            while (p <= p_end - 16) {
 1944|       |                uint8x16_t v = vld1q_u8(p);
 1945|       |                uint8x16_t eq = vceqq_u8(v, vb);
 1946|       |                uint8x16_t not_eq = vmvnq_u8(eq);
 1947|       |
 1948|       |                // 32-bit ARM NEON doesn't always support vgetq_lane_u64 / vreinterpretq_u64_u8 so
 1949|       |                // we treat the 128-bit vector as 4 x 32-bit lanes */
 1950|       |                const uint32x4_t neq32 = vreinterpretq_u32_u8(not_eq);
 1951|       |                const uint32_t l0 = vgetq_lane_u32(neq32, 0);
 1952|       |                const uint32_t l1 = vgetq_lane_u32(neq32, 1);
 1953|       |
 1954|       |                const uint64_t lo = ((uint64_t)l1 << 32) | l0;
 1955|       |                if (lo != 0) {
 1956|       |                    p += (size_t)(zxc_ctz64(lo) >> 3);
 1957|       |                    goto _run_done;
 1958|       |                }
 1959|       |
 1960|       |                const uint32_t h0 = vgetq_lane_u32(neq32, 2);
 1961|       |                const uint32_t h1 = vgetq_lane_u32(neq32, 3);
 1962|       |                const uint64_t hi = ((uint64_t)h1 << 32) | h0;
 1963|       |
 1964|       |                if (hi != 0) {
 1965|       |                    p += 8 + (zxc_ctz64(hi) >> 3);
 1966|       |                    goto _run_done;
 1967|       |                }
 1968|       |                p += 16;
 1969|       |            }
 1970|       |#endif
 1971|  31.1k|            while (p < p_end && *p == b) p++;
  ------------------
  |  Branch (1971:20): [True: 28.7k, False: 2.41k]
  |  Branch (1971:33): [True: 19.9k, False: 8.78k]
  ------------------
 1972|       |
 1973|  11.2k|#if defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || defined(ZXC_USE_NEON64) || \
 1974|  11.2k|    defined(ZXC_USE_NEON32) || defined(ZXC_USE_SSE2)
 1975|  99.4k|        _run_done:;
 1976|  99.4k|#endif
 1977|  99.4k|            const size_t run = (size_t)(p - run_start);
 1978|       |
 1979|  99.4k|            if (run >= ZXC_LIT_RLE_RUN_MIN) {
  ------------------
  |  |  561|  99.4k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (1979:17): [True: 46.6k, False: 52.8k]
  ------------------
 1980|       |                // RLE run: 2 bytes per ZXC_LIT_RLE_RUN_MAX values, then remainder
 1981|       |                // Branchless: full_chunks * 2 + remainder handling
 1982|  46.6k|                const size_t full_chunks = run / ZXC_LIT_RLE_RUN_MAX;
  ------------------
  |  |  563|  46.6k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  557|  46.6k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|  46.6k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  561|  46.6k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
 1983|  46.6k|                const size_t rem = run - full_chunks * ZXC_LIT_RLE_RUN_MAX;  // Avoid modulo
  ------------------
  |  |  563|  46.6k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  557|  46.6k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|  46.6k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  561|  46.6k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
 1984|  46.6k|                rle_size += full_chunks * 2;
 1985|       |                // Remainder: if >= 4 -> 2 bytes (RLE), else 1 + rem (literal)
 1986|  46.6k|                if (rem >= ZXC_LIT_RLE_RUN_MIN)
  ------------------
  |  |  561|  46.6k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (1986:21): [True: 46.3k, False: 283]
  ------------------
 1987|  46.3k|                    rle_size += 2;
 1988|    283|                else if (rem > 0)
  ------------------
  |  Branch (1988:26): [True: 84, False: 199]
  ------------------
 1989|     84|                    rle_size += 1 + rem;
 1990|  52.8k|            } else {
 1991|       |                // Literal run: scan ahead with fast SIMD lookahead
 1992|  52.8k|                const uint8_t* lit_start = run_start;
 1993|       |
 1994|  52.8k|#if defined(ZXC_RLE_WIN)
 1995|  4.72M|                while (p <= p_end_4 - ZXC_RLE_WIN) {
  ------------------
  |  |  140|  4.72M|#define ZXC_RLE_WIN 16
  ------------------
  |  Branch (1995:24): [True: 4.70M, False: 16.2k]
  ------------------
 1996|  4.70M|                    const zxc_rle_mask_t m = zxc_rle_pair_mask(p);
 1997|  4.70M|                    const zxc_rle_mask_t mask = m & (m >> ZXC_RLE_BPB) & (m >> (2 * ZXC_RLE_BPB));
  ------------------
  |  |  141|  4.70M|#define ZXC_RLE_BPB 1
  ------------------
                                  const zxc_rle_mask_t mask = m & (m >> ZXC_RLE_BPB) & (m >> (2 * ZXC_RLE_BPB));
  ------------------
  |  |  141|  4.70M|#define ZXC_RLE_BPB 1
  ------------------
 1998|  4.70M|                    if (LIKELY(mask == 0)) {
  ------------------
  |  |  146|  4.70M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 4.34M, False: 361k]
  |  |  ------------------
  ------------------
 1999|  4.34M|                        p += ZXC_RLE_WIN - 2;
  ------------------
  |  |  140|  4.34M|#define ZXC_RLE_WIN 16
  ------------------
 2000|  4.34M|                        continue;
 2001|  4.34M|                    }
 2002|   361k|                    const unsigned rpos = (unsigned)(ZXC_RLE_CTZ(mask) / ZXC_RLE_BPB);
  ------------------
  |  |  142|   361k|#define ZXC_RLE_CTZ(x) zxc_ctz32(x)
  ------------------
                                  const unsigned rpos = (unsigned)(ZXC_RLE_CTZ(mask) / ZXC_RLE_BPB);
  ------------------
  |  |  141|   361k|#define ZXC_RLE_BPB 1
  ------------------
 2003|   361k|                    const unsigned rpairs =
 2004|   361k|                        (unsigned)(ZXC_RLE_CTZ(~(m >> (rpos * ZXC_RLE_BPB))) / ZXC_RLE_BPB);
  ------------------
  |  |  142|   361k|#define ZXC_RLE_CTZ(x) zxc_ctz32(x)
  ------------------
                                      (unsigned)(ZXC_RLE_CTZ(~(m >> (rpos * ZXC_RLE_BPB))) / ZXC_RLE_BPB);
  ------------------
  |  |  141|   361k|#define ZXC_RLE_BPB 1
  ------------------
 2005|   361k|                    if (UNLIKELY(rpos + rpairs >= ZXC_RLE_WIN)) {
  ------------------
  |  |  152|   361k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 36.6k, False: 324k]
  |  |  ------------------
  ------------------
 2006|  36.6k|                        p += rpos;
 2007|  36.6k|                        goto _lit_done; /* run may extend past the window */
 2008|  36.6k|                    }
 2009|   324k|                    const size_t seg = (size_t)(p + rpos - lit_start);
 2010|   324k|                    rle_size += seg + (seg + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  557|   324k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  ------------------
  |  |  |  |  555|   324k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  ------------------
  ------------------
                                  rle_size += seg + (seg + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  559|   324k|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  557|   324k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|   324k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2011|   324k|                    rle_size += 2; /* run fits one chunk: full_chunks=0, rem>=4 */
 2012|   324k|                    p += rpos + rpairs + 1;
 2013|   324k|                    lit_start = p;
 2014|   324k|                }
 2015|       |#elif defined(ZXC_USE_NEON32)
 2016|       |                while (p <= p_end_4 - 16) {
 2017|       |                    uint8x16_t v0 = vld1q_u8(p);
 2018|       |                    uint8x16_t v1 = vld1q_u8(p + 1);
 2019|       |                    const uint8x16_t pe = vceqq_u8(v0, v1);
 2020|       |                    const uint8x16_t zv = vdupq_n_u8(0);
 2021|       |                    const uint8x16_t eq =
 2022|       |                        vandq_u8(pe, vandq_u8(vextq_u8(pe, zv, 1), vextq_u8(pe, zv, 2)));
 2023|       |
 2024|       |                    uint32x4_t eq32 = vreinterpretq_u32_u8(eq);
 2025|       |                    uint32_t l0 = vgetq_lane_u32(eq32, 0);
 2026|       |                    uint32_t l1 = vgetq_lane_u32(eq32, 1);
 2027|       |                    uint64_t lo = ((uint64_t)l1 << 32) | l0;
 2028|       |
 2029|       |                    if (lo != 0) {
 2030|       |                        p += (zxc_ctz64(lo) >> 3);
 2031|       |                        goto _lit_done;
 2032|       |                    }
 2033|       |
 2034|       |                    uint32_t h0 = vgetq_lane_u32(eq32, 2);
 2035|       |                    uint32_t h1 = vgetq_lane_u32(eq32, 3);
 2036|       |                    uint64_t hi = ((uint64_t)h1 << 32) | h0;
 2037|       |
 2038|       |                    if (hi != 0) {
 2039|       |                        p += 8 + (zxc_ctz64(hi) >> 3);
 2040|       |                        goto _lit_done;
 2041|       |                    }
 2042|       |                    p += 14;
 2043|       |                }
 2044|       |#endif
 2045|   104k|                while (p < p_end_4) {
  ------------------
  |  Branch (2045:24): [True: 92.5k, False: 12.0k]
  ------------------
 2046|  92.5k|                    if (UNLIKELY(p[0] == p[1] && p[1] == p[2] && p[2] == p[3])) break;
  ------------------
  |  |  152|   209k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 4.14k, False: 88.3k]
  |  |  |  Branch (152:42): [True: 17.0k, False: 75.5k]
  |  |  |  Branch (152:42): [True: 7.17k, False: 9.85k]
  |  |  |  Branch (152:42): [True: 4.14k, False: 3.02k]
  |  |  ------------------
  ------------------
 2047|  88.3k|                    p++;
 2048|  88.3k|                }
 2049|  16.2k|                if (p >= p_end_4) p = p_end;
  ------------------
  |  Branch (2049:21): [True: 12.0k, False: 4.14k]
  ------------------
 2050|       |
 2051|  16.2k|#if defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || defined(ZXC_USE_NEON64) || \
 2052|  16.2k|    defined(ZXC_USE_NEON32) || defined(ZXC_USE_SSE2)
 2053|  52.8k|            _lit_done:;
 2054|  52.8k|#endif
 2055|  52.8k|                const size_t lit_run = (size_t)(p - lit_start);
 2056|       |                // 1 header per ZXC_LIT_RUN_MAX bytes + all data bytes
 2057|  52.8k|                rle_size += lit_run + (lit_run + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  557|  52.8k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  ------------------
  |  |  |  |  555|  52.8k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  ------------------
  ------------------
                              rle_size += lit_run + (lit_run + ZXC_LIT_LEN_MASK) / ZXC_LIT_RUN_MAX;
  ------------------
  |  |  559|  52.8k|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  557|  52.8k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|  52.8k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2058|  52.8k|            }
 2059|  99.4k|        }
 2060|       |
 2061|       |        // RLE over RAW: space-speed J comparison. The per-level premium
 2062|       |        // reproduces the historical margin exactly below ULTRA.
 2063|  13.6k|        const size_t rle_j = rle_size + ZXC_SS_TAX(lit_c, zxc_ss_prem_rle_q8(level));
  ------------------
  |  |  950|  13.6k|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
 2064|  13.6k|        if (rle_j < best_j) {
  ------------------
  |  Branch (2064:13): [True: 7.10k, False: 6.51k]
  ------------------
 2065|  7.10k|            enc_lit = ZXC_SECTION_ENCODING_RLE;
 2066|  7.10k|            best_j = rle_j;
 2067|  7.10k|        }
 2068|  13.6k|    }
 2069|       |
 2070|       |    // Level >= 6: Huffman as a third literal-encoding candidate. Histogram,
 2071|       |    // length-limited code lengths, exact PivCo section size, and switch if its
 2072|       |    // J (size + decode tax) beats the current winner's.
 2073|  13.6k|    uint8_t huf_code_len[ZXC_HUF_NUM_SYMBOLS];
 2074|  13.6k|    size_t huf_total_size = SIZE_MAX;
 2075|  13.6k|    uint32_t lit_freq[ZXC_HUF_NUM_SYMBOLS]; /* valid iff huf_total_size != SIZE_MAX */
 2076|  13.6k|    if (level >= ZXC_LEVEL_DENSITY && lit_c >= ZXC_HUF_MIN_LITERALS) {
  ------------------
  |  |  999|  5.43k|#define ZXC_HUF_MIN_LITERALS 139
  ------------------
  |  Branch (2076:9): [True: 5.43k, False: 8.18k]
  |  Branch (2076:39): [True: 3.42k, False: 2.01k]
  ------------------
 2077|  3.42k|        uint32_t freq0[ZXC_HUF_NUM_SYMBOLS] = {0};
 2078|  3.42k|        uint32_t freq1[ZXC_HUF_NUM_SYMBOLS] = {0};
 2079|  3.42k|        uint32_t freq2[ZXC_HUF_NUM_SYMBOLS] = {0};
 2080|  3.42k|        uint32_t freq3[ZXC_HUF_NUM_SYMBOLS] = {0};
 2081|  3.42k|        {
 2082|  3.42k|            size_t i = 0;
 2083|  11.4M|            for (; i + 4 <= lit_c; i += 4) {
  ------------------
  |  Branch (2083:20): [True: 11.4M, False: 3.42k]
  ------------------
 2084|  11.4M|                freq0[literals[i + 0]]++;
 2085|  11.4M|                freq1[literals[i + 1]]++;
 2086|  11.4M|                freq2[literals[i + 2]]++;
 2087|  11.4M|                freq3[literals[i + 3]]++;
 2088|  11.4M|            }
 2089|  8.85k|            for (; i < lit_c; i++) freq0[literals[i]]++;
  ------------------
  |  Branch (2089:20): [True: 5.42k, False: 3.42k]
  ------------------
 2090|  3.42k|        }
 2091|  3.42k|        uint32_t* const freq = lit_freq;
 2092|   879k|        for (int k = 0; k < ZXC_HUF_NUM_SYMBOLS; k++) {
  ------------------
  |  |  833|   879k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (2092:25): [True: 876k, False: 3.42k]
  ------------------
 2093|   876k|            freq[k] = freq0[k] + freq1[k] + freq2[k] + freq3[k];
 2094|   876k|        }
 2095|       |
 2096|  3.42k|        if (zxc_huf_build_code_lengths(freq, huf_code_len, ctx->opt_scratch,
  ------------------
  |  |   27|  3.42k|#define zxc_huf_build_code_lengths ZXC_CAT(zxc_huf_build_code_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|  3.42k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  3.42k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2096:13): [True: 3.42k, False: 0]
  ------------------
 2097|  3.42k|                                       zxc_huf_enc_max_code_len(level)) == ZXC_OK) {
 2098|  3.42k|            (void)zxc_huf_nudge_code_lengths(freq, huf_code_len, ctx->opt_scratch,
 2099|  3.42k|                                             ctx->opt_scratch_cap, zxc_huf_enc_max_code_len(level));
 2100|  3.42k|            huf_total_size = zxc_huf_calc_size(freq, huf_code_len, 1);
  ------------------
  |  |   29|  3.42k|#define zxc_huf_calc_size ZXC_CAT(zxc_huf_calc_size, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|  3.42k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  3.42k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2101|       |            // Space-speed: the entropy candidate must beat the current winner's
 2102|       |            // J, paying its own decode tax over the copy path.
 2103|  3.42k|            if (huf_total_size != SIZE_MAX) {
  ------------------
  |  Branch (2103:17): [True: 3.42k, False: 0]
  ------------------
 2104|  3.42k|                const size_t huf_j = huf_total_size + ZXC_SS_TAX(lit_c, zxc_ss_prem_huf_q8(level));
  ------------------
  |  |  950|  3.42k|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
 2105|  3.42k|                if (huf_j < best_j) {
  ------------------
  |  Branch (2105:21): [True: 1.66k, False: 1.75k]
  ------------------
 2106|  1.66k|                    enc_lit = ZXC_SECTION_ENCODING_HUFFMAN;
 2107|  1.66k|                    best_j = huf_j;
 2108|  1.66k|                }
 2109|  3.42k|            }
 2110|  3.42k|        }
 2111|  3.42k|    }
 2112|       |
 2113|       |    // Shared dictionary table (level >= 6, dict with a table): the HUFFMAN
 2114|       |    // bitstream minus the 128-byte header, so it stays viable far below
 2115|       |    // ZXC_HUF_MIN_LITERALS. A literal without a code drops the candidate.
 2116|  13.6k|    size_t huf_dict_total_size = SIZE_MAX;
 2117|  13.6k|#ifndef ZXC_NO_DICT
 2118|  13.6k|    if (level >= ZXC_LEVEL_DENSITY && ctx->dict_huf_tree_ok && lit_c > 0) {
  ------------------
  |  Branch (2118:9): [True: 5.43k, False: 8.18k]
  |  Branch (2118:39): [True: 0, False: 5.43k]
  |  Branch (2118:64): [True: 0, False: 0]
  ------------------
 2119|       |        // The dict candidate runs on sections too small for the per-block
 2120|       |        // table, so the histogram may not have been built above.
 2121|      0|        if (huf_total_size == SIZE_MAX) {
  ------------------
  |  Branch (2121:13): [True: 0, False: 0]
  ------------------
 2122|      0|            ZXC_MEMSET(lit_freq, 0, sizeof(uint32_t) * ZXC_HUF_NUM_SYMBOLS);
  ------------------
  |  |  173|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2123|      0|            for (size_t i = 0; i < lit_c; i++) lit_freq[literals[i]]++;
  ------------------
  |  Branch (2123:32): [True: 0, False: 0]
  ------------------
 2124|      0|        }
 2125|       |        // zxc_huf_calc_size returns SIZE_MAX for unencodable candidates
 2126|       |        // (a literal byte without a code in the shared table).
 2127|      0|        huf_dict_total_size =
 2128|      0|            zxc_huf_calc_size_dict(lit_freq, ctx->dict_huf->code_len, &ctx->dict_huf->tree);
  ------------------
  |  |   30|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2129|      0|        if (huf_dict_total_size != SIZE_MAX) {
  ------------------
  |  Branch (2129:13): [True: 0, False: 0]
  ------------------
 2130|       |            // Same J rule against the running winner: vs the per-block Huffman
 2131|       |            // candidate the equal entropy taxes cancel (pure size comparison),
 2132|       |            // while RAW/RLE baselines keep their decode-tax edge.
 2133|      0|            const size_t huf_dict_j =
 2134|      0|                huf_dict_total_size + ZXC_SS_TAX(lit_c, zxc_ss_prem_huf_q8(level));
  ------------------
  |  |  950|      0|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
 2135|       |            // Last candidate: no need to keep best_j updated past this point.
 2136|      0|            if (huf_dict_j < best_j) enc_lit = ZXC_SECTION_ENCODING_HUFFMAN_DICT;
  ------------------
  |  Branch (2136:17): [True: 0, False: 0]
  ------------------
 2137|      0|        }
 2138|      0|    }
 2139|  13.6k|#endif
 2140|       |
 2141|       |    // Level-7 (ULTRA): Huffman-code the token stream with the literal codec -
 2142|       |    // tokens are a <= 256-symbol alphabet. Same J rule; the decoder picks the
 2143|       |    // path from gh.enc_tok. opt_scratch is free by now.
 2144|  13.6k|    uint8_t tok_code_len[ZXC_HUF_NUM_SYMBOLS];
 2145|  13.6k|    uint8_t enc_tok = ZXC_SECTION_ENCODING_RAW;
 2146|  13.6k|    size_t tok_huf_size = 0;
 2147|  13.6k|    uint32_t tfreq[ZXC_HUF_NUM_SYMBOLS];
 2148|  13.6k|    if (level >= ZXC_LEVEL_ULTRA && seq_c >= ZXC_HUF_MIN_LITERALS) {
  ------------------
  |  |  999|  3.67k|#define ZXC_HUF_MIN_LITERALS 139
  ------------------
  |  Branch (2148:9): [True: 3.67k, False: 9.94k]
  |  Branch (2148:37): [True: 2.29k, False: 1.38k]
  ------------------
 2149|  2.29k|        ZXC_MEMSET(tfreq, 0, sizeof(tfreq)); /* only the ULTRA path reads tfreq */
  ------------------
  |  |  173|  2.29k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2150|  2.15M|        for (uint32_t i = 0; i < seq_c; i++) tfreq[buf_tokens[i]]++;
  ------------------
  |  Branch (2150:30): [True: 2.15M, False: 2.29k]
  ------------------
 2151|  2.29k|        if (zxc_huf_build_code_lengths(tfreq, tok_code_len, ctx->opt_scratch,
  ------------------
  |  |   27|  2.29k|#define zxc_huf_build_code_lengths ZXC_CAT(zxc_huf_build_code_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|  2.29k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  2.29k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2151:13): [True: 2.29k, False: 0]
  ------------------
 2152|  2.29k|                                       zxc_huf_enc_max_code_len(level)) == ZXC_OK) {
 2153|  2.29k|            (void)zxc_huf_nudge_code_lengths(tfreq, tok_code_len, ctx->opt_scratch,
 2154|  2.29k|                                             ctx->opt_scratch_cap, zxc_huf_enc_max_code_len(level));
 2155|  2.29k|            tok_huf_size = zxc_huf_calc_size(tfreq, tok_code_len, 1);
  ------------------
  |  |   29|  2.29k|#define zxc_huf_calc_size ZXC_CAT(zxc_huf_calc_size, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|  2.29k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  2.29k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2156|       |            // Space-speed J comparison (this path is ULTRA-only): the PivCo
 2157|       |            // token section pays the same decode tax as PivCo literals.
 2158|  2.29k|            if (tok_huf_size != SIZE_MAX &&
  ------------------
  |  Branch (2158:17): [True: 2.29k, False: 0]
  ------------------
 2159|  2.29k|                tok_huf_size + ZXC_SS_TAX((size_t)seq_c, zxc_ss_prem_huf_q8(level)) < (size_t)seq_c)
  ------------------
  |  |  950|  2.29k|#define ZXC_SS_TAX(n, prem_q8) (((size_t)(n) * (size_t)(prem_q8)) >> 8)
  ------------------
  |  Branch (2159:17): [True: 1.96k, False: 324]
  ------------------
 2160|  1.96k|                enc_tok = ZXC_SECTION_ENCODING_HUFFMAN;
 2161|  2.29k|        }
 2162|  2.29k|    }
 2163|       |
 2164|  13.6k|    const int use_8bit_off = (max_offset <= UINT8_MAX) ? 1 : 0;
  ------------------
  |  Branch (2164:30): [True: 9.40k, False: 4.21k]
  ------------------
 2165|  13.6k|    const size_t off_stream_size = use_8bit_off ? seq_c : (seq_c * 2);
  ------------------
  |  Branch (2165:36): [True: 9.40k, False: 4.21k]
  ------------------
 2166|       |
 2167|  13.6k|    const zxc_gnr_header_t gh = {.n_sequences = seq_c,
 2168|  13.6k|                                 .n_literals = (uint32_t)lit_c,
 2169|  13.6k|                                 .enc_lit = (uint8_t)enc_lit,
 2170|  13.6k|                                 .enc_tok = enc_tok,
 2171|  13.6k|                                 .enc_mlen = 0,
 2172|  13.6k|                                 .enc_off = (uint8_t)use_8bit_off};
 2173|       |
 2174|  13.6k|    const size_t sz_lit = (enc_lit == ZXC_SECTION_ENCODING_RLE)            ? rle_size
  ------------------
  |  Branch (2174:27): [True: 6.30k, False: 7.31k]
  ------------------
 2175|  13.6k|                          : (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN)      ? huf_total_size
  ------------------
  |  Branch (2175:29): [True: 1.66k, False: 5.64k]
  ------------------
 2176|  7.31k|                          : (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN_DICT) ? huf_dict_total_size
  ------------------
  |  Branch (2176:29): [True: 0, False: 5.64k]
  ------------------
 2177|  5.64k|                                                                           : lit_c;
 2178|  13.6k|    const size_t sz_tok = (enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? tok_huf_size : seq_c;
  ------------------
  |  Branch (2178:27): [True: 1.96k, False: 11.6k]
  ------------------
 2179|  13.6k|    const size_t sz_off = off_stream_size;
 2180|  13.6k|    const size_t sz_ext = extras_sz;
 2181|       |
 2182|  13.6k|    if (!dst) {
  ------------------
  |  Branch (2182:9): [True: 0, False: 13.6k]
  ------------------
 2183|      0|        const size_t desc = ((enc_lit != ZXC_SECTION_ENCODING_RAW) ? sizeof(uint32_t) : 0) +
  ------------------
  |  Branch (2183:30): [True: 0, False: 0]
  ------------------
 2184|      0|                            ((enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? sizeof(uint32_t) : 0);
  ------------------
  |  Branch (2184:30): [True: 0, False: 0]
  ------------------
 2185|      0|        const size_t behind = sz_tok + sz_off + sz_ext;
 2186|      0|        const size_t slack = (behind < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind : 0;
  ------------------
  |  |  356|      0|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
                      const size_t slack = (behind < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind : 0;
  ------------------
  |  |  356|      0|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
  |  Branch (2186:30): [True: 0, False: 0]
  ------------------
 2187|      0|        *out_sz =
 2188|      0|            ZXC_BLOCK_HEADER_SIZE + ZXC_SPL_HEADER_BINARY_SIZE + desc + sz_lit + behind + slack;
  ------------------
  |  |  439|      0|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                          ZXC_BLOCK_HEADER_SIZE + ZXC_SPL_HEADER_BINARY_SIZE + desc + sz_lit + behind + slack;
  ------------------
  |  |  443|      0|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
 2189|      0|        return ZXC_OK;
 2190|      0|    }
 2191|       |
 2192|  13.6k|    zxc_block_header_t bh = {.block_type = ZXC_BLOCK_SPL};
 2193|  13.6k|    uint8_t* const p = dst + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  439|  13.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2194|  13.6k|    size_t rem = dst_cap - ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  439|  13.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2195|       |
 2196|  13.6k|    const int ghs = zxc_write_spl_header_and_desc(p, rem, &gh, (uint32_t)sz_lit, (uint32_t)sz_tok);
 2197|  13.6k|    if (UNLIKELY(ghs < 0)) return ghs;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2198|       |
 2199|  13.6k|    uint8_t* p_curr = p + ghs;
 2200|  13.6k|    rem -= (size_t)ghs;
 2201|       |
 2202|  13.6k|    if (UNLIKELY(rem < sz_lit)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2203|       |
 2204|  13.6k|    if (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN) {
  ------------------
  |  Branch (2204:9): [True: 1.66k, False: 11.9k]
  ------------------
 2205|  1.66k|        const int written =
 2206|  1.66k|            zxc_huf_encode_section(literals, lit_c, lit_freq, huf_code_len, p_curr, rem);
  ------------------
  |  |   31|  1.66k|#define zxc_huf_encode_section ZXC_CAT(zxc_huf_encode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|  1.66k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  1.66k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2207|  1.66k|        if (UNLIKELY(written < 0)) return written;
  ------------------
  |  |  152|  1.66k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 1.66k]
  |  |  ------------------
  ------------------
 2208|  1.66k|        if (UNLIKELY((size_t)written != huf_total_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  1.66k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 1.66k]
  |  |  ------------------
  ------------------
 2209|  1.66k|        p_curr += written;
 2210|  1.66k|#ifndef ZXC_NO_DICT
 2211|  11.9k|    } else if (enc_lit == ZXC_SECTION_ENCODING_HUFFMAN_DICT) {
  ------------------
  |  Branch (2211:16): [True: 0, False: 11.9k]
  ------------------
 2212|      0|        const int written =
 2213|      0|            zxc_huf_encode_section_dict(literals, lit_c, lit_freq, ctx->dict_huf->code_len,
  ------------------
  |  |   32|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2214|      0|                                        &ctx->dict_huf->tree, ctx->dict_huf->codes, p_curr, rem);
 2215|      0|        if (UNLIKELY(written < 0)) return written;
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2216|      0|        if (UNLIKELY((size_t)written != huf_dict_total_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2217|      0|        p_curr += written;
 2218|      0|#endif
 2219|  11.9k|    } else if (enc_lit == ZXC_SECTION_ENCODING_RLE) {
  ------------------
  |  Branch (2219:16): [True: 6.30k, False: 5.64k]
  ------------------
 2220|       |        // Write RLE - optimized single-pass encoding
 2221|  6.30k|        const uint8_t* lit_ptr = literals;
 2222|  6.30k|        const uint8_t* const lit_end = literals + lit_c;
 2223|       |
 2224|   328k|        while (lit_ptr < lit_end) {
  ------------------
  |  Branch (2224:16): [True: 321k, False: 6.30k]
  ------------------
 2225|   321k|            uint8_t b = *lit_ptr;
 2226|   321k|            const uint8_t* run_start = lit_ptr++;
 2227|       |
 2228|  1.50M|            while (lit_ptr < lit_end && *lit_ptr == b) lit_ptr++;
  ------------------
  |  Branch (2228:20): [True: 1.50M, False: 1.92k]
  |  Branch (2228:41): [True: 1.18M, False: 319k]
  ------------------
 2229|   321k|            size_t run = (size_t)(lit_ptr - run_start);
 2230|       |
 2231|   321k|            if (run >= ZXC_LIT_RLE_RUN_MIN) {
  ------------------
  |  |  561|   321k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (2231:17): [True: 165k, False: 156k]
  ------------------
 2232|       |                // RLE runs: emit 2-byte tokens (header + value)
 2233|   332k|                while (run >= ZXC_LIT_RLE_RUN_MIN) {
  ------------------
  |  |  561|   332k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  |  Branch (2233:24): [True: 166k, False: 165k]
  ------------------
 2234|   166k|                    size_t chunk = (run > ZXC_LIT_RLE_RUN_MAX) ? ZXC_LIT_RLE_RUN_MAX : run;
  ------------------
  |  |  563|   166k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  557|   166k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|   166k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  561|   166k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
                                  size_t chunk = (run > ZXC_LIT_RLE_RUN_MAX) ? ZXC_LIT_RLE_RUN_MAX : run;
  ------------------
  |  |  563|  1.21k|#define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  557|  1.21k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|  1.21k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_LIT_RLE_RUN_MAX (ZXC_LIT_LEN_MASK + ZXC_LIT_RLE_RUN_MIN) /* 131 */
  |  |  ------------------
  |  |  |  |  561|  1.21k|#define ZXC_LIT_RLE_RUN_MIN 4U
  |  |  ------------------
  ------------------
  |  Branch (2234:36): [True: 1.21k, False: 165k]
  ------------------
 2235|   166k|                    *p_curr++ = (uint8_t)(ZXC_LIT_RLE_FLAG | (chunk - ZXC_LIT_RLE_RUN_MIN));
  ------------------
  |  |  555|   166k|#define ZXC_LIT_RLE_FLAG 0x80U
  ------------------
                                  *p_curr++ = (uint8_t)(ZXC_LIT_RLE_FLAG | (chunk - ZXC_LIT_RLE_RUN_MIN));
  ------------------
  |  |  561|   166k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
 2236|   166k|                    *p_curr++ = b;
 2237|   166k|                    run -= chunk;
 2238|   166k|                }
 2239|       |                // Leftover < 4 bytes: emit as literal
 2240|   165k|                if (run > 0) {
  ------------------
  |  Branch (2240:21): [True: 83, False: 165k]
  ------------------
 2241|     83|                    *p_curr++ = (uint8_t)(run - 1);
 2242|     83|                    ZXC_MEMCPY(p_curr, lit_ptr - run, run);
  ------------------
  |  |  168|     83|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2243|     83|                    p_curr += run;
 2244|     83|                }
 2245|   165k|            } else {
 2246|       |                // Literal run: scan ahead to find next RLE opportunity
 2247|   156k|                const uint8_t* lit_run_start = run_start;
 2248|       |
 2249|  10.7M|                while (lit_ptr < lit_end) {
  ------------------
  |  Branch (2249:24): [True: 10.7M, False: 4.93k]
  ------------------
 2250|  10.7M|                    if (UNLIKELY(lit_ptr + 3 < lit_end && lit_ptr[0] == lit_ptr[1] &&
  ------------------
  |  |  152|  43.9M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 151k, False: 10.5M]
  |  |  |  Branch (152:42): [True: 10.6M, False: 12.3k]
  |  |  |  Branch (152:42): [True: 860k, False: 9.83M]
  |  |  |  Branch (152:42): [True: 307k, False: 553k]
  |  |  |  Branch (152:42): [True: 151k, False: 155k]
  |  |  ------------------
  ------------------
 2251|  10.7M|                                 lit_ptr[1] == lit_ptr[2] && lit_ptr[2] == lit_ptr[3])) {
 2252|   151k|                        break;
 2253|   151k|                    }
 2254|  10.5M|                    lit_ptr++;
 2255|  10.5M|                }
 2256|       |
 2257|   156k|                size_t lit_run = (size_t)(lit_ptr - lit_run_start);
 2258|   156k|                const uint8_t* src_ptr = lit_run_start;
 2259|       |
 2260|       |                // Emit literal chunks (ZXC_LIT_RUN_MAX bytes each at most)
 2261|   365k|                while (lit_run > 0) {
  ------------------
  |  Branch (2261:24): [True: 208k, False: 156k]
  ------------------
 2262|   208k|                    size_t chunk = (lit_run > ZXC_LIT_RUN_MAX) ? ZXC_LIT_RUN_MAX : lit_run;
  ------------------
  |  |  559|   208k|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  557|   208k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|   208k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  size_t chunk = (lit_run > ZXC_LIT_RUN_MAX) ? ZXC_LIT_RUN_MAX : lit_run;
  ------------------
  |  |  559|  52.3k|#define ZXC_LIT_RUN_MAX (ZXC_LIT_LEN_MASK + 1U) /* 128 */
  |  |  ------------------
  |  |  |  |  557|  52.3k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  555|  52.3k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2262:36): [True: 52.3k, False: 156k]
  ------------------
 2263|   208k|                    *p_curr++ = (uint8_t)(chunk - 1);
 2264|   208k|                    ZXC_MEMCPY(p_curr, src_ptr, chunk);
  ------------------
  |  |  168|   208k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2265|   208k|                    p_curr += chunk;
 2266|   208k|                    src_ptr += chunk;
 2267|   208k|                    lit_run -= chunk;
 2268|   208k|                }
 2269|   156k|            }
 2270|   321k|        }
 2271|  6.30k|    } else {
 2272|  5.64k|        ZXC_MEMCPY(p_curr, literals, lit_c);
  ------------------
  |  |  168|  5.64k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2273|  5.64k|        p_curr += lit_c;
 2274|  5.64k|    }
 2275|  13.6k|    rem -= sz_lit;
 2276|       |
 2277|  13.6k|    if (UNLIKELY(rem < sz_tok)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2278|       |
 2279|  13.6k|    if (enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) {
  ------------------
  |  Branch (2279:9): [True: 1.96k, False: 11.6k]
  ------------------
 2280|  1.96k|        const int written =
 2281|  1.96k|            zxc_huf_encode_section(buf_tokens, seq_c, tfreq, tok_code_len, p_curr, rem);
  ------------------
  |  |   31|  1.96k|#define zxc_huf_encode_section ZXC_CAT(zxc_huf_encode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   24|  1.96k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  1.96k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2282|  1.96k|        if (UNLIKELY(written < 0)) return written;
  ------------------
  |  |  152|  1.96k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 1.96k]
  |  |  ------------------
  ------------------
 2283|  1.96k|        if (UNLIKELY((size_t)written != tok_huf_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  1.96k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 1.96k]
  |  |  ------------------
  ------------------
 2284|  1.96k|        p_curr += written;
 2285|  11.6k|    } else {
 2286|  11.6k|        ZXC_MEMCPY(p_curr, buf_tokens, seq_c);
  ------------------
  |  |  168|  11.6k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2287|  11.6k|        p_curr += seq_c;
 2288|  11.6k|    }
 2289|  13.6k|    rem -= sz_tok;
 2290|       |
 2291|  13.6k|    if (UNLIKELY(rem < sz_off)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2292|       |
 2293|  13.6k|    if (use_8bit_off) {
  ------------------
  |  Branch (2293:9): [True: 9.40k, False: 4.21k]
  ------------------
 2294|       |        // Write 1-byte offsets - unroll for better throughput
 2295|  9.40k|        uint32_t i = 0;
 2296|  15.6k|        for (; i + 8 <= seq_c; i += 8) {
  ------------------
  |  Branch (2296:16): [True: 6.22k, False: 9.40k]
  ------------------
 2297|  6.22k|            p_curr[0] = (uint8_t)buf_offsets[i + 0];
 2298|  6.22k|            p_curr[1] = (uint8_t)buf_offsets[i + 1];
 2299|  6.22k|            p_curr[2] = (uint8_t)buf_offsets[i + 2];
 2300|  6.22k|            p_curr[3] = (uint8_t)buf_offsets[i + 3];
 2301|  6.22k|            p_curr[4] = (uint8_t)buf_offsets[i + 4];
 2302|  6.22k|            p_curr[5] = (uint8_t)buf_offsets[i + 5];
 2303|  6.22k|            p_curr[6] = (uint8_t)buf_offsets[i + 6];
 2304|  6.22k|            p_curr[7] = (uint8_t)buf_offsets[i + 7];
 2305|  6.22k|            p_curr += 8;
 2306|  6.22k|        }
 2307|  33.7k|        for (; i < seq_c; i++) {
  ------------------
  |  Branch (2307:16): [True: 24.3k, False: 9.40k]
  ------------------
 2308|  24.3k|            *p_curr++ = (uint8_t)buf_offsets[i];
 2309|  24.3k|        }
 2310|  9.40k|    } else {
 2311|       |        // Write 2-byte offsets in little-endian order
 2312|       |#ifdef ZXC_BIG_ENDIAN
 2313|       |        for (uint32_t i = 0; i < seq_c; i++) {
 2314|       |            zxc_store_le16(p_curr, buf_offsets[i]);
 2315|       |            p_curr += sizeof(uint16_t);
 2316|       |        }
 2317|       |#else
 2318|  4.21k|        ZXC_MEMCPY(p_curr, buf_offsets, seq_c * sizeof(uint16_t));
  ------------------
  |  |  168|  4.21k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2319|  4.21k|        p_curr += seq_c * sizeof(uint16_t);
 2320|  4.21k|#endif
 2321|  4.21k|    }
 2322|  13.6k|    rem -= sz_off;
 2323|       |
 2324|       |    // The sections behind the literals must total ZXC_BLOCK_LIT_SLACK bytes so
 2325|       |    // the decoder's literal wild-copy can overshoot. Tokens and offsets alone
 2326|       |    // clear it from 16 sequences on, so pad is 0 on any real block. It rides
 2327|       |    // inside the extras section, which the decoder sizes from the payload
 2328|       |    // residue - hence no wire field.
 2329|  13.6k|    const size_t behind_lit = sz_tok + sz_off + sz_ext;
 2330|  13.6k|    const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  356|  13.6k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
                  const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  356|  8.71k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
  |  Branch (2330:24): [True: 8.71k, False: 4.90k]
  ------------------
 2331|       |
 2332|  13.6k|    if (UNLIKELY(rem < sz_ext + pad)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2333|       |
 2334|  13.6k|    ZXC_MEMCPY(p_curr, buf_extras, extras_sz);
  ------------------
  |  |  168|  13.6k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2335|  13.6k|    p_curr += extras_sz;
 2336|       |
 2337|  13.6k|    ZXC_MEMSET(p_curr, 0, pad);
  ------------------
  |  |  173|  13.6k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2338|  13.6k|    p_curr += pad;
 2339|       |
 2340|  13.6k|    bh.comp_size = (uint32_t)(p_curr - (dst + ZXC_BLOCK_HEADER_SIZE));
  ------------------
  |  |  439|  13.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2341|  13.6k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 2342|  13.6k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  152|  13.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.6k]
  |  |  ------------------
  ------------------
 2343|       |
 2344|       |    // Checksum will be appended by the wrapper
 2345|  13.6k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + bh.comp_size;
  ------------------
  |  |  439|  13.6k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2346|  13.6k|    return ZXC_OK;
 2347|  13.6k|}
zxc_compress.c:zxc_rle_pair_mask:
  144|  4.70M|static ZXC_ALWAYS_INLINE zxc_rle_mask_t zxc_rle_pair_mask(const uint8_t* p) {
  145|  4.70M|    const __m128i v0 = _mm_loadu_si128((const __m128i*)p);
  146|  4.70M|    const __m128i v1 = _mm_loadu_si128((const __m128i*)(p + 1));
  147|  4.70M|    return (uint32_t)_mm_movemask_epi8(_mm_cmpeq_epi8(v0, v1));
  148|  4.70M|}

zxc_decompress_chunk_wrapper_default:
 1700|  72.8k|                                 const uint64_t block_index) {
 1701|  72.8k|    return zxc_decompress_chunk_wrapper_body(ctx, src, src_sz, dst, dst_cap, block_index, 0, 0);
 1702|  72.8k|}
zxc_decompress_chunk_wrapper_safe_default:
 1747|  73.7k|                                      const size_t dst_cap, const uint64_t block_index) {
 1748|  73.7k|    return zxc_decompress_chunk_wrapper_body(ctx, src, src_sz, dst, dst_cap, block_index, 0, 1);
 1749|  73.7k|}
zxc_decompress.c:zxc_decompress_chunk_wrapper_body:
 1633|   146k|    const int safe) {
 1634|   146k|    if (UNLIKELY(src_sz < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  152|   146k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 146k]
  |  |  ------------------
  ------------------
 1635|   146k|    if (UNLIKELY(!zxc_block_header_ok(src))) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  152|   146k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 37.2k, False: 109k]
  |  |  ------------------
  ------------------
 1636|       |
 1637|   109k|    const uint8_t type = src[0];
 1638|   109k|    const uint32_t comp_sz = zxc_le32(src + 3);
 1639|   109k|    const int has_checksum = ctx->checksum_enabled;
 1640|       |
 1641|       |    // A block never compresses past its own content size
 1642|   109k|    if (UNLIKELY((uint64_t)comp_sz > (uint64_t)ctx->chunk_size)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  152|   109k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 215, False: 109k]
  |  |  ------------------
  ------------------
 1643|       |
 1644|       |    // Check bounds: Header + Body + Checksum(if any)
 1645|   109k|    const size_t expected_sz =
 1646|   109k|        (size_t)ZXC_BLOCK_HEADER_SIZE + comp_sz + (has_checksum ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  439|   109k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                      (size_t)ZXC_BLOCK_HEADER_SIZE + comp_sz + (has_checksum ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  441|  60.1k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (1646:52): [True: 60.1k, False: 49.0k]
  ------------------
 1647|   109k|    if (UNLIKELY(src_sz < expected_sz)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  152|   109k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 17.9k, False: 91.2k]
  |  |  ------------------
  ------------------
 1648|       |
 1649|  91.2k|    const uint8_t* data = src + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  439|  91.2k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1650|       |
 1651|  91.2k|    int decoded_sz = ZXC_ERROR_BAD_BLOCK_TYPE;
 1652|       |
 1653|  91.2k|    switch (type) {
 1654|  53.6k|        case ZXC_BLOCK_SPL:
  ------------------
  |  Branch (1654:9): [True: 53.6k, False: 37.5k]
  ------------------
 1655|  53.6k|            decoded_sz = safe       ? zxc_decode_block_spl_safe(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1655:26): [True: 26.4k, False: 27.2k]
  ------------------
 1656|  53.6k|                         : has_dict ? zxc_decode_block_spl_dict(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1656:28): [True: 0, False: 27.2k]
  ------------------
 1657|  27.2k|                                    : zxc_decode_block_spl(ctx, data, comp_sz, dst, dst_cap);
 1658|  53.6k|            break;
 1659|  15.6k|        case ZXC_BLOCK_PAK:
  ------------------
  |  Branch (1659:9): [True: 15.6k, False: 75.6k]
  ------------------
 1660|  15.6k|            decoded_sz = safe       ? zxc_decode_block_pak_safe(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1660:26): [True: 7.71k, False: 7.90k]
  ------------------
 1661|  15.6k|                         : has_dict ? zxc_decode_block_pak_dict(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1661:28): [True: 0, False: 7.90k]
  ------------------
 1662|  7.90k|                                    : zxc_decode_block_pak(ctx, data, comp_sz, dst, dst_cap);
 1663|  15.6k|            break;
 1664|  21.9k|        case ZXC_BLOCK_RAW:
  ------------------
  |  Branch (1664:9): [True: 21.9k, False: 69.3k]
  ------------------
 1665|       |            // For RAW blocks, comp_sz == raw_sz (uncompressed data stored as-is)
 1666|  21.9k|            if (UNLIKELY(comp_sz > dst_cap)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  21.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 6, False: 21.9k]
  |  |  ------------------
  ------------------
 1667|  21.9k|            ZXC_MEMCPY(dst, data, comp_sz);
  ------------------
  |  |  168|  21.9k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1668|  21.9k|            decoded_sz = (int)comp_sz;
 1669|  21.9k|            break;
 1670|      3|        case ZXC_BLOCK_EOF:
  ------------------
  |  Branch (1670:9): [True: 3, False: 91.2k]
  ------------------
 1671|       |            // EOF should be handled by the dispatcher, not here
 1672|      3|            return ZXC_ERROR_CORRUPT_DATA;
 1673|     14|        default:
  ------------------
  |  Branch (1673:9): [True: 14, False: 91.2k]
  ------------------
 1674|     14|            return ZXC_ERROR_BAD_BLOCK_TYPE;
 1675|  91.2k|    }
 1676|       |
 1677|       |    // dst_cap includes the wild-copy margin: bound the block itself
 1678|  91.2k|    if (UNLIKELY(decoded_sz > 0 && (size_t)decoded_sz > ctx->chunk_size))
  ------------------
  |  |  152|   163k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 31, False: 91.1k]
  |  |  |  Branch (152:42): [True: 72.7k, False: 18.4k]
  |  |  |  Branch (152:42): [True: 31, False: 72.7k]
  |  |  ------------------
  ------------------
 1679|     31|        return ZXC_ERROR_BAD_BLOCK_SIZE;
 1680|       |
 1681|  91.1k|    if (has_checksum && LIKELY(decoded_sz >= 0)) {
  ------------------
  |  |  146|  50.1k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 41.1k, False: 8.92k]
  |  |  ------------------
  ------------------
  |  Branch (1681:9): [True: 50.1k, False: 41.0k]
  ------------------
 1682|  41.1k|        const uint32_t stored = zxc_le32(data + comp_sz);
 1683|  41.1k|        if (UNLIKELY(stored !=
  ------------------
  |  |  152|  41.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 1.60k, False: 39.5k]
  |  |  ------------------
  ------------------
 1684|  41.1k|                     zxc_checksum(dst, (size_t)decoded_sz, block_index, ZXC_CHECKSUM_RAPIDHASH)))
 1685|  1.60k|            return ZXC_ERROR_BAD_CHECKSUM;
 1686|  41.1k|    }
 1687|       |
 1688|  89.5k|    return decoded_sz;
 1689|  91.1k|}
zxc_decompress.c:zxc_decode_block_spl_safe:
 1577|  26.4k|                                                  const size_t dst_capacity) {
 1578|  26.4k|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 1, 0, 0);
 1579|  26.4k|}
zxc_decompress.c:zxc_decode_block_spl_impl:
  835|  68.2k|                                                       const int has_dict, const int tok_entropy) {
  836|  68.2k|    zxc_gnr_header_t gh;
  837|       |
  838|       |    // Constant 0 when !has_dict, so `d_floor` folds to `dst`.
  839|  68.2k|    const size_t dict_size = has_dict ? ctx->dict_size : 0;
  ------------------
  |  Branch (839:30): [True: 0, False: 68.2k]
  ------------------
  840|  68.2k|    uint32_t lit_comp;
  841|  68.2k|    uint32_t tok_comp;
  842|       |
  843|  68.2k|    const int hdr_sz = zxc_read_spl_header_and_desc(src, src_size, &gh, &lit_comp, &tok_comp);
  844|  68.2k|    if (UNLIKELY(hdr_sz < 0)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  152|  68.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 30, False: 68.2k]
  |  |  ------------------
  ------------------
  845|       |
  846|       |    // Only 0 and 1 are defined widths.
  847|  68.2k|    if (UNLIKELY(gh.enc_off > 1)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  68.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 104, False: 68.1k]
  |  |  ------------------
  ------------------
  848|       |
  849|       |    // Entropy-coded tokens (level 7): tail-call the dedicated instantiation
  850|       |    // before any section work - it restarts from the header, so only the parse
  851|       |    // above is duplicated. Flags are constant per instantiation, so exactly one
  852|       |    // call survives and t_ptr keeps a single provenance below.
  853|  68.1k|    if (!tok_entropy && UNLIKELY(gh.enc_tok == ZXC_SECTION_ENCODING_HUFFMAN)) {
  ------------------
  |  |  152|  53.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 14.5k, False: 38.9k]
  |  |  ------------------
  ------------------
  |  Branch (853:9): [True: 53.5k, False: 14.5k]
  ------------------
  854|  14.5k|        if (safe) return zxc_decode_block_spl_entropy_safe(ctx, src, src_size, dst, dst_capacity);
  ------------------
  |  Branch (854:13): [True: 7.20k, False: 7.36k]
  ------------------
  855|  7.36k|        if (has_dict)
  ------------------
  |  Branch (855:13): [True: 0, False: 7.36k]
  ------------------
  856|      0|            return zxc_decode_block_spl_entropy_dict(ctx, src, src_size, dst, dst_capacity);
  857|  7.36k|        return zxc_decode_block_spl_entropy(ctx, src, src_size, dst, dst_capacity);
  858|  7.36k|    }
  859|       |
  860|  53.5k|    const uint8_t* p_data = src + (size_t)hdr_sz;
  861|  53.5k|    const uint8_t* p_curr = p_data;
  862|       |
  863|       |    // --- Literal Stream Setup ---
  864|  53.5k|    const uint8_t* l_ptr;
  865|  53.5k|    const uint8_t* l_end;
  866|  53.5k|    uint8_t* rle_buf = NULL;
  867|       |
  868|  53.5k|    size_t lit_stream_size = lit_comp;
  869|       |    // Decoded size of an encoded literal section (RAW ignores it).
  870|  53.5k|    const size_t required_size = gh.n_literals;
  871|       |
  872|  53.5k|    if (gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN ||
  ------------------
  |  Branch (872:9): [True: 7.57k, False: 45.9k]
  ------------------
  873|  45.9k|        gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN_DICT) {
  ------------------
  |  Branch (873:9): [True: 239, False: 45.7k]
  ------------------
  874|  7.80k|        if (UNLIKELY(lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  152|  7.80k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 148, False: 7.66k]
  |  |  ------------------
  ------------------
  875|    148|            return ZXC_ERROR_CORRUPT_DATA;
  876|  7.66k|        if (required_size == 0) {
  ------------------
  |  Branch (876:13): [True: 43, False: 7.61k]
  ------------------
  877|     43|            l_ptr = p_curr;
  878|     43|            l_end = p_curr;
  879|  7.61k|        } else {
  880|  7.61k|            if (UNLIKELY(required_size > dst_capacity || required_size > SIZE_MAX - ZXC_PAD_SIZE))
  ------------------
  |  |  152|  14.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 327, False: 7.29k]
  |  |  |  Branch (152:42): [True: 327, False: 7.29k]
  |  |  |  Branch (152:42): [True: 0, False: 7.29k]
  |  |  ------------------
  ------------------
  881|    327|                return ZXC_ERROR_DST_TOO_SMALL;
  882|  7.29k|            const int rc =
  883|  7.29k|                (gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN)
  ------------------
  |  Branch (883:17): [True: 7.25k, False: 36]
  ------------------
  884|  7.29k|                    ? zxc_decode_lit_pivco(ctx, p_curr, lit_stream_size, required_size)
  885|  7.29k|                    : zxc_decode_lit_pivco_dict(ctx, p_curr, lit_stream_size, required_size);
  886|  7.29k|            if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  7.29k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 146, False: 7.14k]
  |  |  ------------------
  ------------------
  887|  7.14k|            l_ptr = ctx->lit_buffer;
  888|  7.14k|            l_end = ctx->lit_buffer + required_size;
  889|  7.14k|        }
  890|  45.7k|    } else if (gh.enc_lit == ZXC_SECTION_ENCODING_RLE) {
  ------------------
  |  Branch (890:16): [True: 17.9k, False: 27.7k]
  ------------------
  891|  17.9k|        if (required_size > 0) {
  ------------------
  |  Branch (891:13): [True: 17.7k, False: 231]
  ------------------
  892|  17.7k|            if (UNLIKELY(required_size > dst_capacity || required_size > SIZE_MAX - ZXC_PAD_SIZE))
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 322, False: 17.4k]
  |  |  |  Branch (152:42): [True: 322, False: 17.4k]
  |  |  |  Branch (152:42): [True: 0, False: 17.4k]
  |  |  ------------------
  ------------------
  893|    322|                return ZXC_ERROR_DST_TOO_SMALL;
  894|  17.4k|            const size_t alloc_size = required_size + ZXC_PAD_SIZE;
  ------------------
  |  |  342|  17.4k|#define ZXC_PAD_SIZE 32
  ------------------
  895|       |
  896|       |            // lit_buffer is pre-allocated to chunk_size + ZXC_PAD_SIZE by
  897|       |            // zxc_cctx_init (mode == 0).
  898|  17.4k|            if (UNLIKELY(ctx->lit_buffer_cap < alloc_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  17.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 52, False: 17.3k]
  |  |  ------------------
  ------------------
  899|       |
  900|  17.3k|            rle_buf = ctx->lit_buffer;
  901|  17.3k|            if (UNLIKELY(!rle_buf || lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  152|  34.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 180, False: 17.2k]
  |  |  |  Branch (152:42): [True: 0, False: 17.3k]
  |  |  |  Branch (152:42): [True: 180, False: 17.2k]
  |  |  ------------------
  ------------------
  902|    180|                return ZXC_ERROR_CORRUPT_DATA;
  903|       |
  904|  17.2k|            const uint8_t* r_ptr = p_curr;
  905|  17.2k|            const uint8_t* r_end = r_ptr + lit_stream_size;
  906|  17.2k|            uint8_t* w_ptr = rle_buf;
  907|  17.2k|            const uint8_t* const w_end = rle_buf + required_size;
  908|       |
  909|  1.59M|            while (r_ptr < r_end && w_ptr < w_end) {
  ------------------
  |  Branch (909:20): [True: 1.57M, False: 17.0k]
  |  Branch (909:37): [True: 1.57M, False: 16]
  ------------------
  910|  1.57M|                uint8_t token = *r_ptr++;
  911|  1.57M|                if (LIKELY(!(token & ZXC_LIT_RLE_FLAG))) {
  ------------------
  |  |  146|  1.57M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 874k, False: 699k]
  |  |  ------------------
  ------------------
  912|       |                    // Raw copy (most common path): 32-byte wild copies (zxc_copy32 width)
  913|       |                    // token is 7-bit (0-127), so len is 1-128 bytes
  914|   874k|                    const uint32_t len = (uint32_t)token + 1;
  915|   874k|                    if (UNLIKELY(w_ptr + len > w_end || r_ptr + len > r_end))
  ------------------
  |  |  152|  1.74M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 115, False: 874k]
  |  |  |  Branch (152:42): [True: 13, False: 874k]
  |  |  |  Branch (152:42): [True: 102, False: 874k]
  |  |  ------------------
  ------------------
  916|    115|                        return ZXC_ERROR_CORRUPT_DATA;
  917|       |
  918|       |                    // Destination has ZXC_PAD_SIZE bytes of safe overrun space.
  919|       |                    // Source may not - check before wild copy.
  920|       |                    // Fast path: source holds a full zxc_copy32 read (most common)
  921|   874k|                    if (LIKELY(r_ptr + 32 <= r_end)) {
  ------------------
  |  |  146|   874k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 851k, False: 22.3k]
  |  |  ------------------
  ------------------
  922|       |                        // Single copy covers len <= 32 (most tokens)
  923|   851k|                        zxc_copy32(w_ptr, r_ptr);
  924|       |
  925|   851k|                        if (UNLIKELY(len > 32)) {
  ------------------
  |  |  152|   851k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 409k, False: 441k]
  |  |  ------------------
  ------------------
  926|       |                            // Unroll: max len=128, so max 4 copies total. The last
  927|       |                            // copy is placed to end exactly on len, overlapping the
  928|       |                            // previous one - unconditional stores beat branches here.
  929|   409k|                            if (len <= 64) {
  ------------------
  |  Branch (929:33): [True: 104k, False: 305k]
  ------------------
  930|   104k|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  931|   305k|                            } else if (len <= 96) {
  ------------------
  |  Branch (931:40): [True: 50.2k, False: 255k]
  ------------------
  932|  50.2k|                                zxc_copy32(w_ptr + 32, r_ptr + 32);
  933|  50.2k|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  934|   255k|                            } else {
  935|   255k|                                zxc_copy32(w_ptr + 32, r_ptr + 32);
  936|   255k|                                zxc_copy32(w_ptr + 64, r_ptr + 64);
  937|   255k|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  938|   255k|                            }
  939|   409k|                        }
  940|   851k|                    } else {
  941|       |                        // Near end of source: safe copy (rare cold path)
  942|  22.3k|                        ZXC_MEMCPY(w_ptr, r_ptr, len);
  ------------------
  |  |  168|  22.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  943|  22.3k|                    }
  944|       |
  945|   874k|                    w_ptr += len;
  946|   874k|                    r_ptr += len;
  947|   874k|                } else {
  948|       |                    // RLE run: fill with single byte
  949|   699k|                    const uint32_t len = (token & ZXC_LIT_LEN_MASK) + ZXC_LIT_RLE_RUN_MIN;
  ------------------
  |  |  557|   699k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  ------------------
  |  |  |  |  555|   699k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  ------------------
  ------------------
                                  const uint32_t len = (token & ZXC_LIT_LEN_MASK) + ZXC_LIT_RLE_RUN_MIN;
  ------------------
  |  |  561|   699k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  950|   699k|                    if (UNLIKELY(w_ptr + len > w_end || r_ptr >= r_end))
  ------------------
  |  |  152|  1.39M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 33, False: 699k]
  |  |  |  Branch (152:42): [True: 19, False: 699k]
  |  |  |  Branch (152:42): [True: 14, False: 699k]
  |  |  ------------------
  ------------------
  951|     33|                        return ZXC_ERROR_CORRUPT_DATA;
  952|   699k|                    ZXC_MEMSET(w_ptr, *r_ptr++, len);
  ------------------
  |  |  173|   699k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  953|   699k|                    w_ptr += len;
  954|   699k|                }
  955|  1.57M|            }
  956|  17.0k|            if (UNLIKELY(w_ptr != w_end || r_ptr != r_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  34.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 82, False: 16.9k]
  |  |  |  Branch (152:42): [True: 66, False: 16.9k]
  |  |  |  Branch (152:42): [True: 16, False: 16.9k]
  |  |  ------------------
  ------------------
  957|  16.9k|            l_ptr = rle_buf;
  958|  16.9k|            l_end = rle_buf + required_size;
  959|  16.9k|        } else {
  960|    231|            if (UNLIKELY(lit_stream_size != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|    231|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 169, False: 62]
  |  |  ------------------
  ------------------
  961|     62|            l_ptr = p_curr;
  962|     62|            l_end = p_curr;
  963|     62|        }
  964|  27.7k|    } else if (gh.enc_lit == ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (964:16): [True: 27.6k, False: 69]
  ------------------
  965|  27.6k|        if (UNLIKELY(lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  152|  27.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 175, False: 27.5k]
  |  |  ------------------
  ------------------
  966|    175|            return ZXC_ERROR_CORRUPT_DATA;
  967|  27.5k|        l_ptr = p_curr;
  968|  27.5k|        l_end = p_curr + lit_stream_size;
  969|  27.5k|    } else {
  970|     69|        return ZXC_ERROR_CORRUPT_DATA;
  971|     69|    }
  972|       |
  973|  51.7k|    p_curr += lit_stream_size;
  974|       |
  975|       |    // --- Stream Pointers & Validation ---
  976|       |    // Only the literal and token sizes are on the wire; offsets follow from the
  977|       |    // sequence count and width, and extras take the payload residue.
  978|  51.7k|    const size_t sz_tokens = tok_comp;
  979|  51.7k|    const uint64_t sz_offsets = SPL_OFF8 ? (uint64_t)gh.n_sequences : (uint64_t)gh.n_sequences * 2;
  ------------------
  |  |  577|  51.7k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (577:18): [True: 30.3k, False: 21.3k]
  |  |  ------------------
  ------------------
  980|       |
  981|  51.7k|    const size_t payload_avail = (size_t)(src + src_size - p_data);
  982|  51.7k|    const uint64_t consumed = (uint64_t)lit_stream_size + (uint64_t)sz_tokens + sz_offsets;
  983|  51.7k|    if (UNLIKELY(consumed > (uint64_t)payload_avail)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  51.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 357, False: 51.3k]
  |  |  ------------------
  ------------------
  984|  51.3k|    const size_t sz_extras = payload_avail - (size_t)consumed; /* slack padding included */
  985|       |
  986|       |    // RAW literals point into the caller's buffer and the wild copy overshoots,
  987|       |    // so it needs ZXC_BLOCK_LIT_SLACK readable bytes behind it. v7 staged short
  988|       |    // streams into a padded scratch here; v8 rejects instead. No underflow:
  989|       |    // lit_stream_size <= consumed <= payload_avail.
  990|  51.3k|    if (UNLIKELY(payload_avail - lit_stream_size < ZXC_BLOCK_LIT_SLACK))
  ------------------
  |  |  152|  51.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 24, False: 51.3k]
  |  |  ------------------
  ------------------
  991|     24|        return ZXC_ERROR_CORRUPT_DATA;
  992|       |
  993|       |    // Offsets/extras follow the on-disk token SECTION; sz_tokens is its size
  994|       |    // (== n_sequences when RAW, the Huffman payload size when enc_tok set).
  995|  51.3k|    const uint8_t* o_ptr = p_curr + sz_tokens;
  996|  51.3k|    const uint8_t* e_ptr = o_ptr + (size_t)sz_offsets;
  997|  51.3k|    const uint8_t* const e_end = e_ptr + sz_extras;
  998|       |
  999|  51.3k|    const uint8_t* RESTRICT t_ptr;
 1000|  51.3k|    if (!tok_entropy) {
  ------------------
  |  Branch (1000:9): [True: 37.8k, False: 13.4k]
  ------------------
 1001|       |        // enc_tok == 2 was re-routed right after the header parse; any other
 1002|       |        // value would have mis-sized the section descriptors above.
 1003|  37.8k|        if (UNLIKELY(gh.enc_tok != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  37.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 16, False: 37.8k]
  |  |  ------------------
  ------------------
 1004|  37.8k|        t_ptr = p_curr;
 1005|  37.8k|    } else {
 1006|  13.4k|        if (UNLIKELY(gh.enc_tok != ZXC_SECTION_ENCODING_HUFFMAN)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  13.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.4k]
  |  |  ------------------
  ------------------
 1007|  13.4k|        const int rc = zxc_decode_tok_pivco(ctx, p_curr, sz_tokens, gh.n_sequences);
 1008|  13.4k|        if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  13.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 167, False: 13.3k]
  |  |  ------------------
  ------------------
 1009|  13.3k|        t_ptr = ctx->tok_buffer;
 1010|  13.3k|    }
 1011|       |
 1012|  51.1k|    uint8_t* d_ptr = dst;
 1013|  51.1k|    const uint8_t* const d_end = dst + dst_capacity;
 1014|       |    // Lowest address a match may reach: the dictionary prefix if any, else dst.
 1015|  51.1k|    const uint8_t* const d_floor = dst - dict_size;
 1016|       |    // 4x loop margin: four sequences without a varint, the wild-copy overshoot, 4 of safety.
 1017|  51.1k|    const size_t d_margin_4x = 4 * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE + 4;
  ------------------
  |  |  674|  51.1k|#define ZXC_SPL_MAX_INLINE_OUT_PER_SEQ ((ZXC_TOKEN_LL_MASK - 1U) + ZXC_SPL_MAX_INLINE_ML) /* 33 */
  |  |  ------------------
  |  |  |  |  522|  51.1k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  518|  51.1k|#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 */
  |  |  ------------------
  |  |  |  |  683|  51.1k|#define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  677|  51.1k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  51.1k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  520|  51.1k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  51.1k|#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;
  ------------------
  |  |  342|  51.1k|#define ZXC_PAD_SIZE 32
  ------------------
 1018|  51.1k|    const uint8_t* const d_end_safe = (dst_capacity > d_margin_4x) ? d_end - d_margin_4x : dst;
  ------------------
  |  Branch (1018:39): [True: 44.7k, False: 6.38k]
  ------------------
 1019|       |
 1020|       |    // Literal margin for the 4x loops: without a varint, ll <= 14 per sequence,
 1021|       |    // so 4 * 14 = 56. Past that margin only the cold varint path checks l_ptr.
 1022|  51.1k|    const size_t spl_sz_lit = (size_t)(l_end - l_ptr);
 1023|  51.1k|    const size_t spl_margin_4x = 4 * (ZXC_TOKEN_LL_MASK - 1);  // 56
  ------------------
  |  |  522|  51.1k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  518|  51.1k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
 1024|  51.1k|    const size_t spl_margin_1x = ZXC_TOKEN_LL_MASK - 1;        // 14
  ------------------
  |  |  522|  51.1k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  518|  51.1k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
 1025|  51.1k|    const uint8_t* const l_end_safe_4x =
 1026|  51.1k|        (spl_sz_lit > spl_margin_4x) ? l_end - spl_margin_4x : l_ptr;
  ------------------
  |  Branch (1026:9): [True: 43.8k, False: 7.28k]
  ------------------
 1027|  51.1k|    const uint8_t* const l_end_safe_1x =
 1028|  51.1k|        (spl_sz_lit > spl_margin_1x) ? l_end - spl_margin_1x : l_ptr;
  ------------------
  |  Branch (1028:9): [True: 47.7k, False: 3.38k]
  ------------------
 1029|       |
 1030|  51.1k|    uint32_t n_seq = gh.n_sequences;
 1031|       |
 1032|       |    // Offsets only need checking until the output is wider than the widest offset
 1033|       |    // the format can encode (256 for 1-byte offsets, 65536 for 2-byte); past that
 1034|       |    // none can reach below d_floor. A dictionary counts as already written, so a
 1035|       |    // large one puts d_bounds at dst and skips the SAFE loop.
 1036|  51.1k|    const size_t off_span = SPL_OFF8 ? (1U << 8) : (1U << 16);
  ------------------
  |  |  577|  51.1k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (577:18): [True: 30.0k, False: 21.0k]
  |  |  ------------------
  ------------------
 1037|  51.1k|    const size_t span = (dict_size >= off_span) ? 0 : off_span - dict_size;
  ------------------
  |  Branch (1037:25): [True: 0, False: 51.1k]
  ------------------
 1038|  51.1k|    const uint8_t* const d_bounds = (span >= dst_capacity) ? d_end : dst + span;
  ------------------
  |  Branch (1038:37): [True: 20.4k, False: 30.6k]
  ------------------
 1039|       |
 1040|       |    // --- SAFE Loop: offset validation until d_bounds (4x unroll) ---
 1041|  51.1k|    if (safe) {
  ------------------
  |  Branch (1041:9): [True: 24.7k, False: 26.3k]
  ------------------
 1042|       |        // SAFE variant: save per-batch state so overflow can rollback.
 1043|  1.29M|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1043:16): [True: 1.28M, False: 4.56k]
  |  Branch (1043:30): [True: 1.28M, False: 4.89k]
  |  Branch (1043:52): [True: 1.28M, False: 3.23k]
  |  Branch (1043:77): [True: 1.27M, False: 5.54k]
  ------------------
 1044|  1.27M|            const uint8_t* const t_save = t_ptr;
 1045|  1.27M|            const uint8_t* const o_save = o_ptr;
 1046|  1.27M|            const uint8_t* const e_save = e_ptr;
 1047|  1.27M|            uint8_t* const d_save = d_ptr;
 1048|  1.27M|            const uint8_t* const l_save = l_ptr;
 1049|  1.27M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  ------------------
  |  |  639|  1.27M|    do {                                                                                           \
  |  |  640|  1.27M|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  641|  1.27M|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  642|  1.27M|        uint64_t offs;                                                                             \
  |  |  643|  1.27M|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  577|  1.27M|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:18): [True: 14.4k, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  644|  14.4k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  645|  14.4k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  646|  14.4k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  647|  14.4k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  648|  1.26M|        } else {                                                                                   \
  |  |  649|  1.26M|            offs = zxc_le64(o_ptr);                                                                \
  |  |  650|  1.26M|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  651|  1.26M|        }                                                                                          \
  |  |  652|  1.27M|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  593|  1.27M|    do {                                                                                        \
  |  |  |  |  594|  1.27M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.27M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.27M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 181k, False: 1.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   181k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   181k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   181k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   181k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   181k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   181k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   362k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 587, False: 180k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 127, False: 181k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 460, False: 180k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   181k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   181k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   181k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   181k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   181k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.09M|        } else {                                                                                \
  |  |  |  |  609|  1.09M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.09M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.09M|        }                                                                                       \
  |  |  |  |  612|  1.27M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.27M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.27M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 215k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   215k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   215k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   215k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   215k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.64k, False: 213k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   215k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   215k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   215k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   215k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   213k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   213k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|   213k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   213k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   213k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   213k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 64, False: 213k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   213k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   213k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   213k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 213k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.05M|        } else {                                                                                \
  |  |  |  |  624|  1.05M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.05M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.05M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.05M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|  1.05M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.05M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.05M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.05M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 96, False: 1.05M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.05M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.05M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.05M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.05M|        }                                                                                       \
  |  |  |  |  628|  1.27M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.27M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  653|  1.27M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  654|  1.27M|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  655|  1.27M|                       DECODE, ON_FAIL);                                                           \
  |  |  656|  1.27M|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  593|  1.27M|    do {                                                                                        \
  |  |  |  |  594|  1.27M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.27M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.27M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 177k, False: 1.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   177k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   177k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   177k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   177k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   177k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   177k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   355k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 554, False: 177k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 117, False: 177k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 437, False: 177k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   177k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   177k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   177k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   177k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   177k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.09M|        } else {                                                                                \
  |  |  |  |  609|  1.09M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.09M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.09M|        }                                                                                       \
  |  |  |  |  612|  1.27M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.27M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.27M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 214k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   214k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   214k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   214k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   214k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 842, False: 214k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   214k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   214k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   214k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   214k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   214k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   214k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|   214k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   214k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   214k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   214k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 29, False: 214k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   214k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   214k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   214k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 214k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.05M|        } else {                                                                                \
  |  |  |  |  624|  1.05M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.05M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.05M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.05M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|  1.05M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.05M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.05M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.05M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 28, False: 1.05M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.05M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.05M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.05M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.05M|        }                                                                                       \
  |  |  |  |  628|  1.27M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.27M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  657|  1.27M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  658|  1.27M|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  659|  1.27M|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  593|  1.27M|    do {                                                                                        \
  |  |  |  |  594|  1.27M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.27M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.27M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 175k, False: 1.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   175k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   175k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   175k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   175k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   175k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   175k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   351k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 651, False: 175k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 119, False: 175k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 532, False: 175k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   175k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   175k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   175k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   175k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   175k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.09M|        } else {                                                                                \
  |  |  |  |  609|  1.09M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.09M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.09M|        }                                                                                       \
  |  |  |  |  612|  1.27M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.27M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.27M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 214k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   214k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   214k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   214k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   214k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 709, False: 214k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   214k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   214k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   214k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   214k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   214k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   214k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|   214k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   214k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   214k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   214k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 16, False: 214k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   214k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   214k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   214k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 214k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.05M|        } else {                                                                                \
  |  |  |  |  624|  1.05M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.05M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.05M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.05M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|  1.05M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.05M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.05M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.05M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 31, False: 1.05M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.05M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.05M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.05M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.05M|        }                                                                                       \
  |  |  |  |  628|  1.27M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.27M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|  1.27M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  661|  1.27M|                       DECODE, ON_FAIL);                                                           \
  |  |  662|  1.27M|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  593|  1.27M|    do {                                                                                        \
  |  |  |  |  594|  1.27M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.27M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.27M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.27M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 175k, False: 1.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   175k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   175k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   175k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   175k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   175k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   175k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   351k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 578, False: 175k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 146, False: 175k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 432, False: 175k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   175k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   175k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   175k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   175k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   175k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.09M|        } else {                                                                                \
  |  |  |  |  609|  1.09M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.09M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.09M|        }                                                                                       \
  |  |  |  |  612|  1.27M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.26M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.26M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.26M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 214k, False: 1.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   214k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   214k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   214k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   214k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 688, False: 213k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   214k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   214k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   214k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   214k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   213k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   213k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|   213k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   213k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   213k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   213k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 17, False: 213k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   213k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   213k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   213k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 213k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.05M|        } else {                                                                                \
  |  |  |  |  624|  1.05M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.05M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.05M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.05M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1049|  1.05M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.05M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.05M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.05M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 19, False: 1.05M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.05M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.05M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.05M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.05M|        }                                                                                       \
  |  |  |  |  628|  1.26M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  663|  1.27M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  664|  1.27M|        n_seq -= 4;                                                                                \
  |  |  665|  1.26M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (665:14): [Folded, False: 1.26M]
  |  |  ------------------
  ------------------
 1050|  1.26M|            continue;
 1051|       |
 1052|  1.26M|        rollback_safe_4x:
 1053|  6.25k|            t_ptr = t_save;
 1054|  6.25k|            o_ptr = o_save;
 1055|  6.25k|            e_ptr = e_save;
 1056|  6.25k|            d_ptr = d_save;
 1057|  6.25k|            l_ptr = l_save;
 1058|  6.25k|            break;
 1059|  1.27M|        }
 1060|  26.3k|    } else {
 1061|  1.56M|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1061:16): [True: 1.56M, False: 8.82k]
  |  Branch (1061:30): [True: 1.55M, False: 2.44k]
  |  Branch (1061:52): [True: 1.55M, False: 4.71k]
  |  Branch (1061:77): [True: 1.54M, False: 6.91k]
  ------------------
 1062|  1.54M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  ------------------
  |  |  639|  1.54M|    do {                                                                                           \
  |  |  640|  1.54M|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  641|  1.54M|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  642|  1.54M|        uint64_t offs;                                                                             \
  |  |  643|  1.54M|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  577|  1.54M|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:18): [True: 16.2k, False: 1.53M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  644|  16.2k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  645|  16.2k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  646|  16.2k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  647|  16.2k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  648|  1.53M|        } else {                                                                                   \
  |  |  649|  1.53M|            offs = zxc_le64(o_ptr);                                                                \
  |  |  650|  1.53M|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  651|  1.53M|        }                                                                                          \
  |  |  652|  1.54M|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  593|  1.54M|    do {                                                                                        \
  |  |  |  |  594|  1.54M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.54M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.54M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 219k, False: 1.32M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   219k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   219k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   219k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   219k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   219k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   219k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   439k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 393, False: 219k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 163, False: 219k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 230, False: 219k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   219k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   219k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   219k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   219k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   219k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.32M|        } else {                                                                                \
  |  |  |  |  609|  1.32M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.32M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.32M|        }                                                                                       \
  |  |  |  |  612|  1.54M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.54M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.54M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 258k, False: 1.28M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   258k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   258k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   258k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   258k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 548, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   258k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   258k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   258k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   258k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   258k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   258k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|   258k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   258k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   258k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   258k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 41, False: 258k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   258k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   258k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   258k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 258k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.28M|        } else {                                                                                \
  |  |  |  |  624|  1.28M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.28M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.28M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.28M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|  1.28M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.28M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.28M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.28M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 55, False: 1.28M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.28M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.28M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.28M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.28M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.28M|        }                                                                                       \
  |  |  |  |  628|  1.54M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  653|  1.54M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  654|  1.54M|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  655|  1.54M|                       DECODE, ON_FAIL);                                                           \
  |  |  656|  1.54M|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  593|  1.54M|    do {                                                                                        \
  |  |  |  |  594|  1.54M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.54M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.54M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 215k, False: 1.32M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   215k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   215k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   215k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   215k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   215k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   215k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   431k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 374, False: 215k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 156, False: 215k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 218, False: 215k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   215k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   215k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   215k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   215k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   215k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.32M|        } else {                                                                                \
  |  |  |  |  609|  1.32M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.32M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.32M|        }                                                                                       \
  |  |  |  |  612|  1.54M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.54M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.54M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 258k, False: 1.28M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   258k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   258k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   258k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   258k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 340, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   258k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   258k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   258k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   258k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   258k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   258k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|   258k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   258k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   258k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   258k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 19, False: 258k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   258k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   258k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   258k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 258k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.28M|        } else {                                                                                \
  |  |  |  |  624|  1.28M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.28M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.28M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.28M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|  1.28M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.28M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.28M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.28M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 19, False: 1.28M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.28M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.28M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.28M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.28M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.28M|        }                                                                                       \
  |  |  |  |  628|  1.54M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  657|  1.54M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  658|  1.54M|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  659|  1.54M|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  593|  1.54M|    do {                                                                                        \
  |  |  |  |  594|  1.54M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.54M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.54M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 213k, False: 1.33M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   213k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   213k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   213k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   213k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   213k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   213k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   426k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 425, False: 212k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 159, False: 213k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 266, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   213k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   213k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   213k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   213k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   213k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.33M|        } else {                                                                                \
  |  |  |  |  609|  1.33M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.33M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.33M|        }                                                                                       \
  |  |  |  |  612|  1.54M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.54M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.54M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 259k, False: 1.28M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   259k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   259k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   259k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   259k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 367, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   259k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   259k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   259k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   259k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   258k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   258k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|   258k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   258k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   258k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   258k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 10, False: 258k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   258k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   258k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   258k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 258k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.28M|        } else {                                                                                \
  |  |  |  |  624|  1.28M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.28M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.28M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.28M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|  1.28M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.28M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.28M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.28M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 20, False: 1.28M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.28M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.28M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.28M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.28M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.28M|        }                                                                                       \
  |  |  |  |  628|  1.54M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|  1.54M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  661|  1.54M|                       DECODE, ON_FAIL);                                                           \
  |  |  662|  1.54M|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  593|  1.54M|    do {                                                                                        \
  |  |  |  |  594|  1.54M|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|  1.54M|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|  1.54M|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 212k, False: 1.33M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|   212k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|   212k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|   212k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|   212k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|   212k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|   212k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   425k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 427, False: 212k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 211, False: 212k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 216, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|   212k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|   212k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|   212k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|   212k|                ON_FAIL;                                                                        \
  |  |  |  |  607|   212k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|  1.33M|        } else {                                                                                \
  |  |  |  |  609|  1.33M|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|  1.33M|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|  1.33M|        }                                                                                       \
  |  |  |  |  612|  1.54M|        l_ptr += ll;                                                                            \
  |  |  |  |  613|  1.54M|        d_ptr += ll;                                                                            \
  |  |  |  |  614|  1.54M|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.54M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 258k, False: 1.28M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|   258k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|   258k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|   258k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   258k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 425, False: 258k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|   258k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|   258k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|   258k|                ON_FAIL;                                                                        \
  |  |  |  |  621|   258k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   258k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|   258k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|   258k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   258k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   258k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   258k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 13, False: 258k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   258k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   258k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   258k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 258k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|  1.28M|        } else {                                                                                \
  |  |  |  |  624|  1.28M|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|  1.28M|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  1.28M|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|  1.28M|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1062|  1.28M|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|  1.28M|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|  1.28M|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|  1.28M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 11, False: 1.28M]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|  1.28M|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|  1.28M|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|  1.28M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 1.28M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|  1.28M|        }                                                                                       \
  |  |  |  |  628|  1.54M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 1.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  663|  1.54M|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  664|  1.54M|        n_seq -= 4;                                                                                \
  |  |  665|  1.54M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (665:14): [Folded, False: 1.54M]
  |  |  ------------------
  ------------------
 1063|  1.54M|        }
 1064|  26.3k|    }
 1065|       |
 1066|       |    // --- FAST Loop: After threshold, no offset validation needed (4x unroll) ---
 1067|  47.3k|    if (safe) {
  ------------------
  |  Branch (1067:9): [True: 24.4k, False: 22.8k]
  ------------------
 1068|   268k|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1068:16): [True: 262k, False: 6.05k]
  |  Branch (1068:30): [True: 257k, False: 5.64k]
  |  Branch (1068:52): [True: 253k, False: 4.01k]
  ------------------
 1069|   253k|            const uint8_t* const t_save = t_ptr;
 1070|   253k|            const uint8_t* const o_save = o_ptr;
 1071|   253k|            const uint8_t* const e_save = e_ptr;
 1072|   253k|            uint8_t* const d_save = d_ptr;
 1073|   253k|            const uint8_t* const l_save = l_ptr;
 1074|   253k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  ------------------
  |  |  639|   253k|    do {                                                                                           \
  |  |  640|   253k|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  641|   253k|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  642|   253k|        uint64_t offs;                                                                             \
  |  |  643|   253k|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  577|   253k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:18): [True: 20.2k, False: 233k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  644|  20.2k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  645|  20.2k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  646|  20.2k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  647|  20.2k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  648|   233k|        } else {                                                                                   \
  |  |  649|   233k|            offs = zxc_le64(o_ptr);                                                                \
  |  |  650|   233k|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  651|   233k|        }                                                                                          \
  |  |  652|   253k|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  593|   253k|    do {                                                                                        \
  |  |  |  |  594|   253k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   253k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   253k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   253k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 41.0k, False: 212k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  41.0k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  41.0k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  41.0k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  41.0k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  41.0k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  41.0k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  81.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 934, False: 40.0k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 168, False: 40.8k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 766, False: 40.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  41.0k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  41.0k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  41.0k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  41.0k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  41.0k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   212k|        } else {                                                                                \
  |  |  |  |  609|   212k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   212k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   212k|        }                                                                                       \
  |  |  |  |  612|   253k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   252k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   252k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   252k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 55.3k, False: 196k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  55.3k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  55.3k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  55.3k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  55.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.90k, False: 53.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  55.3k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  55.3k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  55.3k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  55.3k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  53.4k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  53.4k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|  53.4k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  53.4k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  53.4k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  53.4k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  53.4k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 53.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   196k|        } else {                                                                                \
  |  |  |  |  624|   196k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   196k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   196k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   196k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|   196k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   196k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   196k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   196k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   196k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 196k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   196k|        }                                                                                       \
  |  |  |  |  628|   252k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 250k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  653|   253k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  654|   253k|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  655|   253k|                       DECODE, ON_FAIL);                                                           \
  |  |  656|   253k|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  593|   250k|    do {                                                                                        \
  |  |  |  |  594|   250k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   250k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   250k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   250k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 39.8k, False: 210k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  39.8k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  39.8k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  39.8k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  39.8k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  39.8k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  39.8k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  79.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 925, False: 38.8k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 152, False: 39.6k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 773, False: 38.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  39.8k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  39.8k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  39.8k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  39.8k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  39.8k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   210k|        } else {                                                                                \
  |  |  |  |  609|   210k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   210k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   210k|        }                                                                                       \
  |  |  |  |  612|   250k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   249k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   249k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   249k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 53.9k, False: 195k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  53.9k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  53.9k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  53.9k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  53.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.08k, False: 52.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  53.9k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  53.9k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  53.9k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  53.9k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  52.8k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  52.8k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|  52.8k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  52.8k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  52.8k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  52.8k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  52.8k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 52.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   195k|        } else {                                                                                \
  |  |  |  |  624|   195k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   195k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   195k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   195k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|   195k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   195k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   195k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   195k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   195k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 195k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   195k|        }                                                                                       \
  |  |  |  |  628|   249k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 248k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  657|   250k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  658|   250k|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  659|   250k|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  593|   248k|    do {                                                                                        \
  |  |  |  |  594|   248k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   248k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   248k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   248k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 39.6k, False: 208k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  39.6k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  39.6k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  39.6k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  39.6k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  39.6k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  39.6k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  79.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.04k, False: 38.6k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 172, False: 39.4k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 876, False: 38.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  39.6k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  39.6k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  39.6k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  39.6k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  39.6k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   208k|        } else {                                                                                \
  |  |  |  |  609|   208k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   208k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   208k|        }                                                                                       \
  |  |  |  |  612|   248k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   247k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   247k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   247k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 52.8k, False: 194k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  52.8k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  52.8k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  52.8k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  52.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.03k, False: 51.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  52.8k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  52.8k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  52.8k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  52.8k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  51.7k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  51.7k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|  51.7k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  51.7k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  51.7k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  51.7k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  51.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 51.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   194k|        } else {                                                                                \
  |  |  |  |  624|   194k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   194k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   194k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   194k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|   194k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   194k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   194k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   194k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   194k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 194k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   194k|        }                                                                                       \
  |  |  |  |  628|   247k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 246k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|   248k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  661|   248k|                       DECODE, ON_FAIL);                                                           \
  |  |  662|   248k|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  593|   246k|    do {                                                                                        \
  |  |  |  |  594|   246k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   246k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   246k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   246k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 38.7k, False: 207k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  38.7k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  38.7k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  38.7k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  38.7k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  38.7k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  38.7k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  77.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 904, False: 37.8k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 210, False: 38.5k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 694, False: 37.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  38.7k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  38.7k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  38.7k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  38.7k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  38.7k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   207k|        } else {                                                                                \
  |  |  |  |  609|   207k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   207k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   207k|        }                                                                                       \
  |  |  |  |  612|   246k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   245k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   245k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   245k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 51.9k, False: 193k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  51.9k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  51.9k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  51.9k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  51.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 949, False: 51.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  51.9k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  51.9k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  51.9k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  51.9k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  51.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  51.0k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|  51.0k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  51.0k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  51.0k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  51.0k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  51.0k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 51.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   193k|        } else {                                                                                \
  |  |  |  |  624|   193k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   193k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   193k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   193k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|   193k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   193k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   193k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   193k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   193k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 193k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   193k|        }                                                                                       \
  |  |  |  |  628|   245k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 244k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  663|   246k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  664|   246k|        n_seq -= 4;                                                                                \
  |  |  665|   244k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (665:14): [Folded, False: 244k]
  |  |  ------------------
  ------------------
 1075|   244k|            continue;
 1076|       |
 1077|   244k|        rollback_fast_4x:
 1078|  8.78k|            t_ptr = t_save;
 1079|  8.78k|            o_ptr = o_save;
 1080|  8.78k|            e_ptr = e_save;
 1081|  8.78k|            d_ptr = d_save;
 1082|  8.78k|            l_ptr = l_save;
 1083|  8.78k|            break;
 1084|   253k|        }
 1085|  24.4k|    } else {
 1086|   313k|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1086:16): [True: 300k, False: 12.2k]
  |  Branch (1086:30): [True: 298k, False: 2.81k]
  |  Branch (1086:52): [True: 292k, False: 5.83k]
  ------------------
 1087|   292k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  ------------------
  |  |  639|   292k|    do {                                                                                           \
  |  |  640|   292k|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  641|   292k|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  642|   292k|        uint64_t offs;                                                                             \
  |  |  643|   292k|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  577|   292k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:18): [True: 20.3k, False: 271k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  644|  20.3k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  645|  20.3k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  646|  20.3k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  647|  20.3k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  648|   271k|        } else {                                                                                   \
  |  |  649|   271k|            offs = zxc_le64(o_ptr);                                                                \
  |  |  650|   271k|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  651|   271k|        }                                                                                          \
  |  |  652|   292k|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  593|   292k|    do {                                                                                        \
  |  |  |  |  594|   292k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   292k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   292k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   292k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 45.6k, False: 246k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  45.6k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  45.6k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  45.6k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  45.6k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  45.6k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  45.6k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  91.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 239, False: 45.4k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 86, False: 45.6k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 153, False: 45.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  45.6k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  45.6k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  45.6k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  45.6k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  45.6k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   246k|        } else {                                                                                \
  |  |  |  |  609|   246k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   246k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   246k|        }                                                                                       \
  |  |  |  |  612|   292k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   291k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   291k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   291k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 62.7k, False: 229k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  62.7k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  62.7k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  62.7k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  62.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 240, False: 62.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  62.7k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  62.7k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  62.7k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  62.7k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  62.5k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  62.5k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  62.5k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  62.5k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  62.5k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  62.5k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  62.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 62.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   229k|        } else {                                                                                \
  |  |  |  |  624|   229k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   229k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   229k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   229k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|   229k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   229k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   229k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   229k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   229k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 229k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   229k|        }                                                                                       \
  |  |  |  |  628|   291k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 291k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  653|   292k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  654|   292k|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  655|   292k|                       DECODE, ON_FAIL);                                                           \
  |  |  656|   292k|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  593|   291k|    do {                                                                                        \
  |  |  |  |  594|   291k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   291k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   291k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   291k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 45.8k, False: 245k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  45.8k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  45.8k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  45.8k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  45.8k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  45.8k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  45.8k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  91.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 244, False: 45.6k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 76, False: 45.7k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 168, False: 45.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  45.8k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  45.8k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  45.8k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  45.8k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  45.8k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   245k|        } else {                                                                                \
  |  |  |  |  609|   245k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   245k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   245k|        }                                                                                       \
  |  |  |  |  612|   291k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   291k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   291k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   291k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 62.5k, False: 228k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  62.5k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  62.5k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  62.5k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  62.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 210, False: 62.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  62.5k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  62.5k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  62.5k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  62.5k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  62.3k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  62.3k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  62.3k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  62.3k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  62.3k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  62.3k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  62.3k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 62.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   228k|        } else {                                                                                \
  |  |  |  |  624|   228k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   228k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   228k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   228k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|   228k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   228k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   228k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   228k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   228k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 228k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   228k|        }                                                                                       \
  |  |  |  |  628|   291k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 291k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  657|   291k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  658|   291k|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  659|   291k|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  593|   291k|    do {                                                                                        \
  |  |  |  |  594|   291k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   291k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   291k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   291k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 46.0k, False: 245k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  46.0k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  46.0k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  46.0k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  46.0k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  46.0k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  46.0k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  91.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 282, False: 45.7k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 110, False: 45.9k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 172, False: 45.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  46.0k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  46.0k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  46.0k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  46.0k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  46.0k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   245k|        } else {                                                                                \
  |  |  |  |  609|   245k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   245k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   245k|        }                                                                                       \
  |  |  |  |  612|   291k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   290k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   290k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   290k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 62.0k, False: 228k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  62.0k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  62.0k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  62.0k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  62.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 280, False: 61.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  62.0k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  62.0k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  62.0k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  62.0k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  61.7k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  61.7k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  61.7k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  61.7k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  61.7k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  61.7k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  61.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 61.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   228k|        } else {                                                                                \
  |  |  |  |  624|   228k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   228k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   228k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   228k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|   228k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   228k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   228k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   228k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   228k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 228k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   228k|        }                                                                                       \
  |  |  |  |  628|   290k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 290k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|   291k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  661|   291k|                       DECODE, ON_FAIL);                                                           \
  |  |  662|   291k|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  593|   290k|    do {                                                                                        \
  |  |  |  |  594|   290k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  595|   290k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  596|   290k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   290k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 45.3k, False: 245k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  597|  45.3k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  598|  45.3k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  599|  45.3k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  600|  45.3k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  601|  45.3k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  602|  45.3k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  90.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 236, False: 45.0k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 105, False: 45.2k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 131, False: 45.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  603|  45.3k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  604|  45.3k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  605|  45.3k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  606|  45.3k|                ON_FAIL;                                                                        \
  |  |  |  |  607|  45.3k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  608|   245k|        } else {                                                                                \
  |  |  |  |  609|   245k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  610|   245k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  611|   245k|        }                                                                                       \
  |  |  |  |  612|   290k|        l_ptr += ll;                                                                            \
  |  |  |  |  613|   290k|        d_ptr += ll;                                                                            \
  |  |  |  |  614|   290k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   290k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 61.6k, False: 228k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  615|  61.6k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  616|  61.6k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  617|  61.6k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  61.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 276, False: 61.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  618|  61.6k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  619|  61.6k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  620|  61.6k|                ON_FAIL;                                                                        \
  |  |  |  |  621|  61.6k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  61.3k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  622|  61.3k|            DECODE(ml, OFF, zxc_decode_copy_match);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  61.3k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  61.3k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  61.3k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  61.3k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  61.3k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 61.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  623|   228k|        } else {                                                                                \
  |  |  |  |  624|   228k|            /* Inline nibble: ml <= ZXC_SPL_MAX_INLINE_ML, so no length ladder. */              \
  |  |  |  |  625|   228k|            ml += ZXC_LZ_MIN_MATCH_LEN;                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   228k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  626|   228k|            DECODE(ml, OFF, zxc_decode_copy_match_short);                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|   228k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|   228k|    do {                                 \
  |  |  |  |  |  |  |  |  562|   228k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|   228k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|   228k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 228k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  627|   228k|        }                                                                                       \
  |  |  |  |  628|   290k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (628:14): [Folded, False: 290k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  663|   290k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  664|   290k|        n_seq -= 4;                                                                                \
  |  |  665|   290k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (665:14): [Folded, False: 290k]
  |  |  ------------------
  ------------------
 1088|   292k|        }
 1089|  22.8k|    }
 1090|       |
 1091|       |    // --- Remaining 1 sequence (Fast Path) ---
 1092|   177k|    while (n_seq > 0 && d_ptr < d_end_safe && l_ptr < l_end_safe_1x) {
  ------------------
  |  Branch (1092:12): [True: 168k, False: 9.01k]
  |  Branch (1092:25): [True: 146k, False: 21.6k]
  |  Branch (1092:47): [True: 138k, False: 8.75k]
  ------------------
 1093|       |        // Save pointers before reading (in case we need to fall back to Safe Path)
 1094|   138k|        const uint8_t* t_save = t_ptr;
 1095|   138k|        const uint8_t* o_save = o_ptr;
 1096|   138k|        const uint8_t* e_save = e_ptr;
 1097|       |
 1098|   138k|        uint8_t token = *t_ptr++;
 1099|   138k|        uint64_t ll = token >> ZXC_TOKEN_LIT_BITS;
  ------------------
  |  |  518|   138k|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
 1100|   138k|        uint64_t ml = token & ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  524|   138k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|   138k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1101|   138k|        uint32_t offset = ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  724|   138k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1102|   138k|        if (SPL_OFF8) {
  ------------------
  |  |  577|   138k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (577:18): [True: 45.2k, False: 92.8k]
  |  |  ------------------
  ------------------
 1103|  45.2k|            offset += *o_ptr++;  // 1-byte offset (biased)
 1104|  92.8k|        } else {
 1105|  92.8k|            offset += zxc_le16(o_ptr);  // 2-byte offset (biased)
 1106|  92.8k|            o_ptr += sizeof(uint16_t);
 1107|  92.8k|        }
 1108|       |
 1109|   138k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {
  ------------------
  |  |  152|   138k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 14.6k, False: 123k]
  |  |  ------------------
  ------------------
 1110|  14.6k|            ll += zxc_read_varint(&e_ptr, e_end);
 1111|  14.6k|            if (UNLIKELY(ll > (size_t)(l_end - l_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  152|  14.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 1.13k, False: 13.5k]
  |  |  ------------------
  ------------------
 1112|  14.6k|        }
 1113|   136k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) ml += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  152|   136k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 43.9k, False: 93.0k]
  |  |  ------------------
  ------------------
 1114|   136k|        ml += ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|   136k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1115|       |
 1116|       |        // Check bounds before wild copies - if too close to end, fall back to Safe Path
 1117|   136k|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr))) {
  ------------------
  |  |  152|   136k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 4.73k, False: 132k]
  |  |  ------------------
  ------------------
 1118|  4.73k|            t_ptr = t_save;
 1119|  4.73k|            o_ptr = o_save;
 1120|  4.73k|            e_ptr = e_save;
 1121|  4.73k|            break;
 1122|  4.73k|        }
 1123|       |
 1124|       |        // Unlike the 4x batch the copy cannot sit in the varint branch's else -
 1125|       |        // the rollback above must run first - so re-test ll instead. Exact:
 1126|       |        // the escape leaves ll >= ZXC_TOKEN_LL_MASK.
 1127|   132k|        if (LIKELY(ll < ZXC_TOKEN_LL_MASK)) {
  ------------------
  |  |  146|   132k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 119k, False: 12.3k]
  |  |  ------------------
  ------------------
 1128|   119k|            zxc_copy16(d_ptr, l_ptr);
 1129|   119k|        } else {
 1130|  12.3k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1131|  12.3k|        }
 1132|   132k|        l_ptr += ll;
 1133|   132k|        d_ptr += ll;
 1134|       |
 1135|   132k|        if (UNLIKELY(d_ptr < d_bounds && (size_t)(d_ptr - d_floor) < offset))
  ------------------
  |  |  152|   228k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 114, False: 132k]
  |  |  |  Branch (152:42): [True: 96.7k, False: 35.5k]
  |  |  |  Branch (152:42): [True: 114, False: 96.6k]
  |  |  ------------------
  ------------------
 1136|    114|            return ZXC_ERROR_BAD_OFFSET;
 1137|       |
 1138|       |        // The loop entry check guarantees ll + ml + ZXC_PAD_SIZE bytes of
 1139|       |        // headroom, so the wild-copy ladder (incl. overlap/fill runs) is safe.
 1140|   132k|        zxc_decode_copy_match_spl(d_ptr, offset, ml);
 1141|   132k|        d_ptr += ml;
 1142|   132k|        n_seq--;
 1143|   132k|    }
 1144|       |
 1145|       |    // --- Safe Path for Remaining Sequences ---
 1146|   198k|    while (n_seq > 0) {
  ------------------
  |  Branch (1146:12): [True: 159k, False: 38.7k]
  ------------------
 1147|   159k|        uint8_t token = *t_ptr++;
 1148|   159k|        uint64_t ll = token >> ZXC_TOKEN_LIT_BITS;
  ------------------
  |  |  518|   159k|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
 1149|   159k|        uint64_t ml = token & ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  524|   159k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  520|   159k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1150|   159k|        uint32_t offset = ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  724|   159k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1151|   159k|        if (SPL_OFF8) {
  ------------------
  |  |  577|   159k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (577:18): [True: 79.6k, False: 79.6k]
  |  |  ------------------
  ------------------
 1152|  79.6k|            offset += *o_ptr++;  // 1-byte offset (biased)
 1153|  79.6k|        } else {
 1154|  79.6k|            offset += zxc_le16(o_ptr);  // 2-byte offset (biased)
 1155|  79.6k|            o_ptr += sizeof(uint16_t);
 1156|  79.6k|        }
 1157|       |
 1158|   159k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) ll += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  152|   159k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 16.6k, False: 142k]
  |  |  ------------------
  ------------------
 1159|   159k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) ml += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  152|   159k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 34.1k, False: 125k]
  |  |  ------------------
  ------------------
 1160|   159k|        ml += ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|   159k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1161|       |
 1162|   159k|        if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  152|   314k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 5.31k, False: 154k]
  |  |  |  Branch (152:42): [True: 4.58k, False: 154k]
  |  |  |  Branch (152:42): [True: 728, False: 154k]
  |  |  ------------------
  ------------------
 1163|  5.31k|            return ZXC_ERROR_OVERFLOW;
 1164|   154k|        ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  168|   154k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1165|   154k|        l_ptr += ll;
 1166|   154k|        d_ptr += ll;
 1167|       |
 1168|   154k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  152|   154k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 109, False: 153k]
  |  |  ------------------
  ------------------
 1169|   153k|        const uint8_t* match_src = d_ptr - offset;
 1170|       |
 1171|   153k|        zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1172|   153k|        d_ptr += ml;
 1173|   153k|        n_seq--;
 1174|   153k|    }
 1175|       |
 1176|       |    // --- Trailing Literals ---
 1177|       |    // Copy remaining literals from source stream (literal exhaustion)
 1178|  38.7k|    if (UNLIKELY(l_ptr > l_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  38.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 38.7k]
  |  |  ------------------
  ------------------
 1179|  38.7k|    if (UNLIKELY(d_ptr > d_end)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  152|  38.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 38.7k]
  |  |  ------------------
  ------------------
 1180|       |
 1181|  38.7k|    const size_t remaining_literals = (size_t)(l_end - l_ptr);
 1182|  38.7k|    if (UNLIKELY(remaining_literals > (size_t)(d_end - d_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  152|  38.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 44, False: 38.6k]
  |  |  ------------------
  ------------------
 1183|  38.6k|    ZXC_MEMCPY(d_ptr, l_ptr, remaining_literals);
  ------------------
  |  |  168|  38.6k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1184|  38.6k|    d_ptr += remaining_literals;
 1185|       |
 1186|  38.6k|    return (int)(d_ptr - dst);
 1187|  38.7k|}
zxc_decompress.c:zxc_decode_block_spl_entropy_safe:
 1474|  7.20k|                                                          const size_t dst_capacity) {
 1475|  7.20k|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 1, 0, 1);
 1476|  7.20k|}
zxc_decompress.c:zxc_decode_block_spl_entropy:
 1456|  7.36k|                                                     const size_t dst_capacity) {
 1457|  7.36k|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 0, 0, 1);
 1458|  7.36k|}
zxc_decompress.c:zxc_decode_lit_pivco:
  745|  7.25k|                                                      const size_t required_size) {
  746|  7.25k|    const int arc = zxc_ensure_entropy_scratch(ctx);
  747|  7.25k|    if (UNLIKELY(arc != ZXC_OK)) return arc;
  ------------------
  |  |  152|  7.25k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 7.25k]
  |  |  ------------------
  ------------------
  748|  7.25k|    if (UNLIKELY(ctx->lit_buffer_cap < required_size + ZXC_PAD_SIZE ||
  ------------------
  |  |  152|  14.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 3, False: 7.25k]
  |  |  |  Branch (152:42): [True: 3, False: 7.25k]
  |  |  |  Branch (152:42): [True: 0, False: 7.25k]
  |  |  ------------------
  ------------------
  749|  7.25k|                 ctx->pivco_scratch_cap < required_size + ZXC_PIVCO_SCRATCH_PAD))
  750|      3|        return ZXC_ERROR_DST_TOO_SMALL;
  751|  7.25k|    return zxc_huf_decode_section(payload, psize, ctx->lit_buffer, required_size,
  ------------------
  |  |   33|  7.25k|#define zxc_huf_decode_section ZXC_CAT(zxc_huf_decode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   25|  7.25k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|  7.25k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|  7.25k|                                  ctx->pivco_scratch);
  753|  7.25k|}
zxc_decompress.c:zxc_ensure_entropy_scratch:
  737|  20.7k|static ZXC_NOINLINE ZXC_COLD int zxc_ensure_entropy_scratch(const zxc_cctx_t* RESTRICT ctx) {
  738|  20.7k|    if (LIKELY(ctx->pivco_scratch)) return ZXC_OK;
  ------------------
  |  |  146|  20.7k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 16.5k, False: 4.24k]
  |  |  ------------------
  ------------------
  739|  4.24k|    return zxc_cctx_alloc_entropy_scratch((zxc_cctx_t*)(uintptr_t)ctx);
  740|  20.7k|}
zxc_decompress.c:zxc_decode_lit_pivco_dict:
  766|     36|                                                           const size_t required_size) {
  767|     36|    if (UNLIKELY(!ctx->dict_huf_tree_ok)) return ZXC_ERROR_DICT_REQUIRED;
  ------------------
  |  |  152|     36|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 36, False: 0]
  |  |  ------------------
  ------------------
  768|      0|    const int arc = zxc_ensure_entropy_scratch(ctx);
  769|      0|    if (UNLIKELY(arc != ZXC_OK)) return arc;
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  770|      0|    if (UNLIKELY(ctx->lit_buffer_cap < required_size + ZXC_PAD_SIZE ||
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  771|      0|                 ctx->pivco_scratch_cap < required_size + ZXC_PIVCO_SCRATCH_PAD))
  772|      0|        return ZXC_ERROR_DST_TOO_SMALL;
  773|      0|    return zxc_huf_decode_section_dict(payload, psize, ctx->lit_buffer, required_size,
  ------------------
  |  |   34|      0|#define zxc_huf_decode_section_dict ZXC_CAT(zxc_huf_decode_section_dict, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   25|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  774|      0|                                       &ctx->dict_huf->tree, ctx->pivco_scratch);
  775|      0|}
zxc_decompress.c:zxc_decode_tok_pivco:
  780|  13.4k|                                                      const size_t psize, const size_t n_tok) {
  781|  13.4k|    const int arc = zxc_ensure_entropy_scratch(ctx);
  782|  13.4k|    if (UNLIKELY(arc != ZXC_OK)) return arc;
  ------------------
  |  |  152|  13.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.4k]
  |  |  ------------------
  ------------------
  783|  13.4k|    if (UNLIKELY(n_tok + ZXC_PAD_SIZE > ctx->tok_buffer_cap ||
  ------------------
  |  |  152|  26.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 13.4k]
  |  |  |  Branch (152:42): [True: 0, False: 13.4k]
  |  |  |  Branch (152:42): [True: 0, False: 13.4k]
  |  |  ------------------
  ------------------
  784|  13.4k|                 n_tok + ZXC_PIVCO_SCRATCH_PAD > ctx->pivco_scratch_cap))
  785|      0|        return ZXC_ERROR_DST_TOO_SMALL;
  786|  13.4k|    return zxc_huf_decode_section(payload, psize, ctx->tok_buffer, n_tok, ctx->pivco_scratch);
  ------------------
  |  |   33|  13.4k|#define zxc_huf_decode_section ZXC_CAT(zxc_huf_decode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   25|  13.4k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   24|  13.4k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  787|  13.4k|}
zxc_decompress.c:zxc_decode_copy_literals:
  426|  5.85M|                                                       const uint64_t ll) {
  427|  5.85M|    zxc_wild_copy32(dst, src, ll);
  428|  5.85M|}
zxc_decompress.c:zxc_wild_copy32:
  393|  10.7M|static ZXC_ALWAYS_INLINE void zxc_wild_copy32(uint8_t* dst, const uint8_t* src, const size_t len) {
  394|  10.7M|    zxc_copy32(dst, src);
  395|  10.7M|    if (UNLIKELY(len > 32)) {
  ------------------
  |  |  152|  10.7M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 3.24M, False: 7.50M]
  |  |  ------------------
  ------------------
  396|  3.24M|        size_t rem = len - 32;
  397|  3.24M|        dst += 32;
  398|  3.24M|        src += 32;
  399|  29.7M|        while (rem > 32) {
  ------------------
  |  Branch (399:16): [True: 26.4M, False: 3.24M]
  ------------------
  400|  26.4M|            zxc_copy32(dst, src);
  401|  26.4M|            dst += 32;
  402|  26.4M|            src += 32;
  403|  26.4M|            rem -= 32;
  404|  26.4M|        }
  405|  3.24M|        zxc_copy32(dst, src);
  406|  3.24M|    }
  407|  10.7M|}
zxc_decompress.c:zxc_decode_copy_match:
  454|  6.32M|                                                    const uint64_t ml) {
  455|  6.32M|    const uint8_t* match_src = d_ptr - off;
  456|  6.32M|    if (LIKELY(off >= 32)) {
  ------------------
  |  |  146|  6.32M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 4.89M, False: 1.42M]
  |  |  ------------------
  ------------------
  457|  4.89M|        zxc_wild_copy32(d_ptr, match_src, ml);
  458|  4.89M|    } else if (off == 1) {
  ------------------
  |  Branch (458:16): [True: 531k, False: 896k]
  ------------------
  459|   531k|        zxc_decode_fill_run(d_ptr, match_src[0], ml);
  460|   896k|    } else {
  461|   896k|        zxc_decode_copy_overlap_run32(d_ptr, off, ml);
  462|   896k|    }
  463|  6.32M|}
zxc_decompress.c:zxc_decode_fill_run:
  331|  1.02M|                                                  const uint64_t ml) {
  332|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  333|       |    const __m256i v = _mm256_set1_epi8((char)byte);
  334|       |    _mm256_storeu_si256((__m256i*)dst, v);
  335|       |    if (UNLIKELY(ml > 32)) {
  336|       |        uint8_t* p = dst;
  337|       |        const uint8_t* const last = dst + ml - 32;
  338|       |        do {
  339|       |            p += 32;
  340|       |            _mm256_storeu_si256((__m256i*)p, v);
  341|       |        } while (p < last);
  342|       |    }
  343|       |#elif defined(ZXC_USE_SSE2)
  344|       |    const __m128i v = _mm_set1_epi8((char)byte);
  345|  1.02M|    _mm_storeu_si128((__m128i*)dst, v);
  346|  1.02M|    _mm_storeu_si128((__m128i*)(dst + 16), v);
  347|  1.02M|    if (UNLIKELY(ml > 32)) {
  ------------------
  |  |  152|  1.02M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 362k, False: 660k]
  |  |  ------------------
  ------------------
  348|   362k|        uint8_t* p = dst;
  349|   362k|        const uint8_t* const last = dst + ml - 32;
  350|  6.77M|        do {
  351|  6.77M|            p += 32;
  352|  6.77M|            _mm_storeu_si128((__m128i*)p, v);
  353|  6.77M|            _mm_storeu_si128((__m128i*)(p + 16), v);
  354|  6.77M|        } while (p < last);
  ------------------
  |  Branch (354:18): [True: 6.41M, False: 362k]
  ------------------
  355|   362k|    }
  356|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
  357|       |    const uint8x16_t v = vdupq_n_u8(byte);
  358|       |    vst1q_u8(dst, v);
  359|       |    vst1q_u8(dst + 16, v);
  360|       |    if (UNLIKELY(ml > 32)) {
  361|       |        uint8_t* p = dst;
  362|       |        const uint8_t* const last = dst + ml - 32;
  363|       |        do {
  364|       |            p += 32;
  365|       |            vst1q_u8(p, v);
  366|       |            vst1q_u8(p + 16, v);
  367|       |        } while (p < last);
  368|       |    }
  369|       |#else
  370|       |    ZXC_MEMSET(dst, byte, ml);
  371|       |#endif
  372|  1.02M|}
zxc_decompress.c:zxc_decode_copy_overlap_run32:
  152|   896k|                                                            const uint64_t ml) {
  153|   896k|    const size_t stride = zxc_overlap_strides32[off];
  154|   896k|    size_t copied = 0;
  155|       |    // MSan keeps the shadow of the bytes a shuffle loads but never selects.
  156|   896k|    ZXC_MSAN_UNPOISON(dst, 32 - off);
  ------------------
  |  |  268|   896k|#define ZXC_MSAN_UNPOISON(p, n) ((void)0)
  ------------------
  157|       |#if defined(ZXC_USE_NEON64)
  158|       |    uint8x16x2_t tbl;
  159|       |    tbl.val[0] = vld1q_u8(dst - off);
  160|       |    tbl.val[1] = vld1q_u8(dst - off + 16);
  161|       |    const uint8x16_t pat_lo = vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off]));
  162|       |    const uint8x16_t pat_hi = vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off] + 16));
  163|       |    do {
  164|       |        vst1q_u8(dst + copied, pat_lo);
  165|       |        vst1q_u8(dst + copied + 16, pat_hi);
  166|       |        copied += stride;
  167|       |    } while (copied < ml);
  168|       |
  169|       |#elif defined(ZXC_USE_NEON32)
  170|       |    // VTBL reaches 8 bytes per lookup from a 4-register (32-byte) table, so the
  171|       |    // pattern takes four lookups instead of NEON64's two.
  172|       |    uint8x8x4_t tbl;
  173|       |    tbl.val[0] = vld1_u8(dst - off);
  174|       |    tbl.val[1] = vld1_u8(dst - off + 8);
  175|       |    tbl.val[2] = vld1_u8(dst - off + 16);
  176|       |    tbl.val[3] = vld1_u8(dst - off + 24);
  177|       |    const uint8_t* const m = zxc_overlap_masks32[off];
  178|       |    const uint8x8_t p0 = vtbl4_u8(tbl, vld1_u8(m));
  179|       |    const uint8x8_t p1 = vtbl4_u8(tbl, vld1_u8(m + 8));
  180|       |    const uint8x8_t p2 = vtbl4_u8(tbl, vld1_u8(m + 16));
  181|       |    const uint8x8_t p3 = vtbl4_u8(tbl, vld1_u8(m + 24));
  182|       |    do {
  183|       |        vst1_u8(dst + copied, p0);
  184|       |        vst1_u8(dst + copied + 8, p1);
  185|       |        vst1_u8(dst + copied + 16, p2);
  186|       |        vst1_u8(dst + copied + 24, p3);
  187|       |        copied += stride;
  188|       |    } while (copied < ml);
  189|       |
  190|       |#elif defined(ZXC_USE_AVX512) && defined(__AVX512VBMI__) && defined(__AVX512VL__)
  191|       |    // vpermb indexes all 32 bytes, so the table needs no emulation.
  192|       |    const __m256i pat =
  193|       |        _mm256_permutexvar_epi8(_mm256_load_si256((const __m256i*)zxc_overlap_masks32[off]),
  194|       |                                _mm256_loadu_si256((const __m256i*)(dst - off)));
  195|       |    do {
  196|       |        _mm256_storeu_si256((__m256i*)(dst + copied), pat);
  197|       |        copied += stride;
  198|       |    } while (copied < ml);
  199|       |
  200|       |#elif defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  201|       |    // pshufb only reaches 16 bytes per lane, so the 32-byte table is emulated:
  202|       |    // shuffle both halves, then pick per byte on bit 4 of the index.
  203|       |    const __m128i t0 = _mm_loadu_si128((const __m128i*)(dst - off));
  204|       |    const __m128i t1 = _mm_loadu_si128((const __m128i*)(dst - off + 16));
  205|       |    const __m128i sixteen = _mm_set1_epi8(16);
  206|       |    const __m128i m_lo = _mm_load_si128((const __m128i*)zxc_overlap_masks32[off]);
  207|       |    const __m128i m_hi = _mm_load_si128((const __m128i*)(zxc_overlap_masks32[off] + 16));
  208|       |    const __m128i pat_lo =
  209|       |        _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_lo),
  210|       |                        _mm_shuffle_epi8(t1, _mm_sub_epi8(m_lo, sixteen)), _mm_slli_epi16(m_lo, 3));
  211|       |    const __m128i pat_hi =
  212|       |        _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_hi),
  213|       |                        _mm_shuffle_epi8(t1, _mm_sub_epi8(m_hi, sixteen)), _mm_slli_epi16(m_hi, 3));
  214|       |    do {
  215|       |        _mm_storeu_si128((__m128i*)(dst + copied), pat_lo);
  216|       |        _mm_storeu_si128((__m128i*)(dst + copied + 16), pat_hi);
  217|       |        copied += stride;
  218|       |    } while (copied < ml);
  219|       |
  220|       |#else
  221|       |    // SSE2 (no PSHUFB) and non-SIMD tiers: build the 32-byte pattern with a
  222|       |    // wrap counter (no per-byte modulo), then store it as two 16-byte halves.
  223|   896k|    const uint8_t* src = dst - off;
  224|   896k|    uint8_t pat[32];
  225|   896k|    uint32_t k = 0;
  226|  29.5M|    for (size_t i = 0; i < 32; i++) {
  ------------------
  |  Branch (226:24): [True: 28.7M, False: 896k]
  ------------------
  227|  28.7M|        pat[i] = src[k];
  228|  28.7M|        if (++k == off) k = 0;
  ------------------
  |  Branch (228:13): [True: 2.22M, False: 26.4M]
  ------------------
  229|  28.7M|    }
  230|  2.53M|    do {
  231|  2.53M|        zxc_copy16(dst + copied, pat);
  232|  2.53M|        zxc_copy16(dst + copied + 16, pat + 16);
  233|  2.53M|        copied += stride;
  234|  2.53M|    } while (copied < ml);
  ------------------
  |  Branch (234:14): [True: 1.64M, False: 896k]
  ------------------
  235|   896k|#endif
  236|   896k|}
zxc_decompress.c:zxc_decode_copy_match_short:
  481|  11.1M|                                                          const uint32_t off, const uint64_t ml) {
  482|  11.1M|    const uint8_t* match_src = d_ptr - off;
  483|  11.1M|    if (LIKELY(off >= 32)) {
  ------------------
  |  |  146|  11.1M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 9.45M, False: 1.70M]
  |  |  ------------------
  ------------------
  484|  9.45M|        zxc_copy32(d_ptr, match_src);
  485|  9.45M|    } else if (off == 1) {
  ------------------
  |  Branch (485:16): [True: 492k, False: 1.21M]
  ------------------
  486|   492k|        zxc_decode_fill_run(d_ptr, match_src[0], ml);
  487|  1.21M|    } else {
  488|  1.21M|        zxc_decode_copy_overlap_short(d_ptr, off, ml);
  489|  1.21M|    }
  490|  11.1M|}
zxc_decompress.c:zxc_decode_copy_overlap_short:
  259|  1.21M|                                                            const uint64_t ml) {
  260|  1.21M|    ZXC_MSAN_UNPOISON(dst, ml > 16 ? 32 - off : (off < 16 ? 16 - off : 0));
  ------------------
  |  |  268|  1.21M|#define ZXC_MSAN_UNPOISON(p, n) ((void)0)
  ------------------
  261|       |#if defined(ZXC_USE_NEON64)
  262|       |    const uint8x16_t s0 = vld1q_u8(dst - off);
  263|       |    vst1q_u8(dst, vqtbl1q_u8(s0, vld1q_u8(zxc_overlap_masks32[off])));
  264|       |    if (UNLIKELY(ml > 16)) {
  265|       |        uint8x16x2_t tbl;
  266|       |        tbl.val[0] = s0;
  267|       |        tbl.val[1] = vld1q_u8(dst - off + 16);
  268|       |        vst1q_u8(dst + 16, vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off] + 16)));
  269|       |    }
  270|       |
  271|       |#elif defined(ZXC_USE_NEON32)
  272|       |    uint8x8x2_t lo_tbl;
  273|       |    lo_tbl.val[0] = vld1_u8(dst - off);
  274|       |    lo_tbl.val[1] = vld1_u8(dst - off + 8);
  275|       |    const uint8_t* const m = zxc_overlap_masks32[off];
  276|       |    vst1_u8(dst, vtbl2_u8(lo_tbl, vld1_u8(m)));
  277|       |    vst1_u8(dst + 8, vtbl2_u8(lo_tbl, vld1_u8(m + 8)));
  278|       |    if (UNLIKELY(ml > 16)) {
  279|       |        uint8x8x4_t tbl;
  280|       |        tbl.val[0] = lo_tbl.val[0];
  281|       |        tbl.val[1] = lo_tbl.val[1];
  282|       |        tbl.val[2] = vld1_u8(dst - off + 16);
  283|       |        tbl.val[3] = vld1_u8(dst - off + 24);
  284|       |        vst1_u8(dst + 16, vtbl4_u8(tbl, vld1_u8(m + 16)));
  285|       |        vst1_u8(dst + 24, vtbl4_u8(tbl, vld1_u8(m + 24)));
  286|       |    }
  287|       |
  288|       |#elif defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  289|       |    // pshufb reaches 16 bytes, so only the upper half needs two tables: shuffle
  290|       |    // both and pick per byte on bit 4 of the index.
  291|       |    const __m128i t0 = _mm_loadu_si128((const __m128i*)(dst - off));
  292|       |    _mm_storeu_si128(
  293|       |        (__m128i*)dst,
  294|       |        _mm_shuffle_epi8(t0, _mm_load_si128((const __m128i*)zxc_overlap_masks32[off])));
  295|       |    if (UNLIKELY(ml > 16)) {
  296|       |        const __m128i t1 = _mm_loadu_si128((const __m128i*)(dst - off + 16));
  297|       |        const __m128i m_hi = _mm_load_si128((const __m128i*)(zxc_overlap_masks32[off] + 16));
  298|       |        _mm_storeu_si128(
  299|       |            (__m128i*)(dst + 16),
  300|       |            _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_hi),
  301|       |                            _mm_shuffle_epi8(t1, _mm_sub_epi8(m_hi, _mm_set1_epi8(16))),
  302|       |                            _mm_slli_epi16(m_hi, 3)));
  303|       |    }
  304|       |
  305|       |#else
  306|  1.21M|    const uint8_t* src = dst - off;
  307|  1.21M|    const size_t n = (ml > 16) ? 32 : 16;
  ------------------
  |  Branch (307:22): [True: 65.2k, False: 1.15M]
  ------------------
  308|  1.21M|    uint32_t k = 0;
  309|  21.7M|    for (size_t i = 0; i < n; i++) {
  ------------------
  |  Branch (309:24): [True: 20.4M, False: 1.21M]
  ------------------
  310|  20.4M|        dst[i] = src[k];
  311|  20.4M|        if (++k == off) k = 0;
  ------------------
  |  Branch (311:13): [True: 1.22M, False: 19.2M]
  ------------------
  312|  20.4M|    }
  313|  1.21M|#endif
  314|  1.21M|}
zxc_decompress.c:zxc_decode_copy_match_spl:
  503|   132k|                                                        const uint64_t ml) {
  504|   132k|    if (LIKELY(ml <= ZXC_SPL_MAX_INLINE_ML)) {
  ------------------
  |  |  146|   132k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 92.4k, False: 39.6k]
  |  |  ------------------
  ------------------
  505|  92.4k|        zxc_decode_copy_match_short(d_ptr, off, ml);
  506|  92.4k|    } else {
  507|  39.6k|        zxc_decode_copy_match(d_ptr, off, ml);
  508|  39.6k|    }
  509|   132k|}
zxc_decompress.c:zxc_decode_copy_match_exact:
  528|   208k|                                                     const size_t off, const size_t ml) {
  529|   208k|    if (off >= ml) {
  ------------------
  |  Branch (529:9): [True: 163k, False: 45.3k]
  ------------------
  530|   163k|        ZXC_MEMCPY(d_ptr, match_src, ml);
  ------------------
  |  |  168|   163k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  531|   163k|    } else if (ml < 16) {
  ------------------
  |  Branch (531:16): [True: 21.9k, False: 23.3k]
  ------------------
  532|   205k|        for (size_t i = 0; i < ml; i++) d_ptr[i] = match_src[i];
  ------------------
  |  Branch (532:28): [True: 183k, False: 21.9k]
  ------------------
  533|  23.3k|    } else {
  534|  23.3k|        size_t n = off;
  535|  23.3k|        ZXC_MEMCPY(d_ptr, match_src, n);
  ------------------
  |  |  168|  23.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  536|   117k|        while (n <= ml - n) {
  ------------------
  |  Branch (536:16): [True: 93.8k, False: 23.3k]
  ------------------
  537|  93.8k|            ZXC_MEMCPY(d_ptr + n, d_ptr, n);
  ------------------
  |  |  168|  93.8k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  538|  93.8k|            n <<= 1;
  539|  93.8k|        }
  540|  23.3k|        ZXC_MEMCPY(d_ptr + n, d_ptr, ml - n);
  ------------------
  |  |  168|  23.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  541|  23.3k|    }
  542|   208k|}
zxc_decompress.c:zxc_decode_block_spl:
 1493|  27.2k|                                const size_t dst_capacity) {
 1494|  27.2k|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 0, 0, 0);
 1495|  27.2k|}
zxc_decompress.c:zxc_decode_block_pak_safe:
 1598|  7.71k|                                                  const size_t dst_capacity) {
 1599|  7.71k|    return zxc_decode_block_pak_impl(ctx, src, src_size, dst, dst_capacity, 1, 0);
 1600|  7.71k|}
zxc_decompress.c:zxc_decode_block_pak_impl:
 1213|  15.6k|                                                       const int has_dict) {
 1214|  15.6k|    zxc_gnr_header_t gh;
 1215|       |
 1216|       |    // 0 when !has_dict (safe path) -> folds `d_floor` to `dst`.
 1217|  15.6k|    const size_t dict_size = has_dict ? ctx->dict_size : 0;
  ------------------
  |  Branch (1217:30): [True: 0, False: 15.6k]
  ------------------
 1218|       |
 1219|  15.6k|    if (UNLIKELY(zxc_read_pak_header(src, src_size, &gh) != ZXC_OK)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  152|  15.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 6, False: 15.6k]
  |  |  ------------------
  ------------------
 1220|  15.6k|    if (UNLIKELY(gh.enc_lit != ZXC_SECTION_ENCODING_RAW || gh.enc_tok != 0))
  ------------------
  |  |  152|  31.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 45, False: 15.5k]
  |  |  |  Branch (152:42): [True: 23, False: 15.5k]
  |  |  |  Branch (152:42): [True: 22, False: 15.5k]
  |  |  ------------------
  ------------------
 1221|     45|        return ZXC_ERROR_CORRUPT_DATA;
 1222|       |
 1223|  15.5k|    const uint8_t* const p_data = src + ZXC_PAK_HEADER_BINARY_SIZE;
  ------------------
  |  |  445|  15.5k|#define ZXC_PAK_HEADER_BINARY_SIZE 12
  ------------------
 1224|  15.5k|    const uint8_t* p_curr = p_data;
 1225|       |
 1226|       |    // --- Stream Pointers & Validation ---
 1227|       |    // PAK carries no section descriptors: literals are always RAW, the sequence
 1228|       |    // stream is four bytes per sequence, and extras run to the payload end.
 1229|  15.5k|    const size_t sz_lit = gh.n_literals;
 1230|  15.5k|    const uint64_t sz_seqs = (uint64_t)gh.n_sequences * sizeof(uint32_t);
 1231|       |
 1232|  15.5k|    const size_t payload_avail = (size_t)(src + src_size - p_data);
 1233|  15.5k|    const uint64_t consumed = (uint64_t)sz_lit + sz_seqs;
 1234|  15.5k|    if (UNLIKELY(consumed > (uint64_t)payload_avail)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  15.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 182, False: 15.3k]
  |  |  ------------------
  ------------------
 1235|  15.3k|    const size_t sz_exts = payload_avail - (size_t)consumed; /* slack padding included */
 1236|       |
 1237|       |    // PAK literals are always RAW, so the slack is always load-bearing here.
 1238|       |    // No underflow: sz_lit <= consumed <= payload_avail.
 1239|  15.3k|    if (UNLIKELY(payload_avail - sz_lit < ZXC_BLOCK_LIT_SLACK)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  15.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 6, False: 15.3k]
  |  |  ------------------
  ------------------
 1240|       |
 1241|  15.3k|    const uint8_t* l_ptr = p_curr;
 1242|  15.3k|    const uint8_t* l_end = l_ptr + sz_lit;
 1243|  15.3k|    p_curr += sz_lit;
 1244|       |
 1245|  15.3k|    const uint8_t* seq_ptr = p_curr;
 1246|  15.3k|    const uint8_t* extras_ptr = p_curr + (size_t)sz_seqs;
 1247|  15.3k|    const uint8_t* const extras_end = extras_ptr + sz_exts;
 1248|       |
 1249|  15.3k|    uint8_t* d_ptr = dst;
 1250|  15.3k|    const uint8_t* const d_end = dst + dst_capacity;
 1251|       |    // Lowest address a match may reach: the dictionary prefix if any, else dst.
 1252|  15.3k|    const uint8_t* const d_floor = dst - dict_size;
 1253|  15.3k|    const uint8_t* const d_end_safe =
 1254|  15.3k|        (dst_capacity > ZXC_PAD_SIZE * 4) ? d_end - (ZXC_PAD_SIZE * 4) : dst;  // 128
  ------------------
  |  |  342|  15.3k|#define ZXC_PAD_SIZE 32
  ------------------
                      (dst_capacity > ZXC_PAD_SIZE * 4) ? d_end - (ZXC_PAD_SIZE * 4) : dst;  // 128
  ------------------
  |  |  342|  14.2k|#define ZXC_PAD_SIZE 32
  ------------------
  |  Branch (1254:9): [True: 14.2k, False: 1.10k]
  ------------------
 1255|       |    // 4x loop margin: four sequences of inline output (ll <= 254, ml <= 254 + 5,
 1256|       |    // longer ones escape and check themselves) plus the wild-copy overshoot:
 1257|       |    // 4 x 513 + 32 = 2084, all of ZXC_DECOMPRESS_TAIL_PAD.
 1258|  15.3k|    const uint8_t* const d_end_fast =
 1259|  15.3k|        (dst_capacity > ZXC_DECOMPRESS_TAIL_PAD) ? d_end - ZXC_DECOMPRESS_TAIL_PAD : dst;
  ------------------
  |  |  372|  15.3k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|  15.3k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  15.3k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|  15.3k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  15.3k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  15.3k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  15.3k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|  15.3k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
                      (dst_capacity > ZXC_DECOMPRESS_TAIL_PAD) ? d_end - ZXC_DECOMPRESS_TAIL_PAD : dst;
  ------------------
  |  |  372|  11.0k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|  11.0k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  11.0k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|  11.0k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  11.0k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  11.0k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  11.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|  11.0k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (1259:9): [True: 11.0k, False: 4.30k]
  ------------------
 1260|       |
 1261|       |    // Literal margin for the PAK loops: without a varint, ll <= 254 per sequence,
 1262|       |    // so 4 * 254 = 1016. Past that only the cold varint path checks l_ptr.
 1263|  15.3k|    const size_t pak_margin_4x = 4 * (ZXC_SEQ_LL_MASK - 1);  // 1016
  ------------------
  |  |  539|  15.3k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  533|  15.3k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
 1264|  15.3k|    const size_t pak_margin_1x = ZXC_SEQ_LL_MASK - 1;        // 254
  ------------------
  |  |  539|  15.3k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  533|  15.3k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
 1265|  15.3k|    const uint8_t* const l_end_safe_4x = (sz_lit > pak_margin_4x) ? l_end - pak_margin_4x : l_ptr;
  ------------------
  |  Branch (1265:42): [True: 11.1k, False: 4.18k]
  ------------------
 1266|  15.3k|    const uint8_t* const l_end_safe_1x = (sz_lit > pak_margin_1x) ? l_end - pak_margin_1x : l_ptr;
  ------------------
  |  Branch (1266:42): [True: 11.9k, False: 3.39k]
  ------------------
 1267|       |
 1268|  15.3k|    uint32_t n_seq = gh.n_sequences;
 1269|       |
 1270|       |    // Same handover as SPL, but the PAK offset is inline in the sequence word and
 1271|       |    // always 16 bits -- enc_off is not a width here, so the span is fixed.
 1272|  15.3k|    const size_t off_span = 1U << 16;
 1273|  15.3k|    const size_t span = (dict_size >= off_span) ? 0 : off_span - dict_size;
  ------------------
  |  Branch (1273:25): [True: 0, False: 15.3k]
  ------------------
 1274|  15.3k|    const uint8_t* const d_bounds = (span >= dst_capacity) ? d_end : dst + span;
  ------------------
  |  Branch (1274:37): [True: 10.0k, False: 5.33k]
  ------------------
 1275|       |
 1276|       |    // --- SAFE loop: validate offsets until d_bounds (4x unroll) ---
 1277|  15.3k|    if (safe) {
  ------------------
  |  Branch (1277:9): [True: 7.55k, False: 7.82k]
  ------------------
 1278|       |        // SAFE variant: save per-batch state so an OVERFLOW can rollback and
 1279|       |        // hand over to the 1x loop / Safe Path. Wild writes already committed
 1280|       |        // are deterministically overwritten when the 1x loop replays.
 1281|   383k|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1281:16): [True: 382k, False: 960]
  |  Branch (1281:30): [True: 379k, False: 3.06k]
  |  Branch (1281:52): [True: 378k, False: 704]
  |  Branch (1281:77): [True: 376k, False: 1.54k]
  ------------------
 1282|   376k|            const uint8_t* const t_save = seq_ptr;
 1283|   376k|            const uint8_t* const e_save = extras_ptr;
 1284|   376k|            uint8_t* const d_save = d_ptr;
 1285|   376k|            const uint8_t* const l_save = l_ptr;
 1286|   376k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  ------------------
  |  |  706|   376k|    do {                                                                                        \
  |  |  707|   376k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  708|   376k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  709|   376k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  710|   376k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  711|   376k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  712|   376k|        PREFETCH;                                                                               \
  |  |  713|   376k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  673|   376k|    do {                                                                                     \
  |  |  |  |  674|   376k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   376k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   376k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   376k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   376k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   376k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   376k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   376k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   376k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   376k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 7.61k, False: 369k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  7.61k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  7.61k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  7.61k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  7.61k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  15.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 233, False: 7.38k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 51, False: 7.56k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 182, False: 7.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  7.61k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  7.61k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  7.61k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  7.61k|        }                                                                                    \
  |  |  |  |  686|   376k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 15.6k, False: 361k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  15.6k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  15.6k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  15.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 239, False: 15.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  15.6k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  15.6k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  15.6k|        }                                                                                    \
  |  |  |  |  692|   376k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   376k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   376k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   376k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   376k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   376k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   376k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   376k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1286|   376k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   376k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   376k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 60, False: 376k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   376k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   376k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   376k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 376k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   376k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 376k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  714|   376k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  715|   376k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  716|   376k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  673|   376k|    do {                                                                                     \
  |  |  |  |  674|   376k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   376k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   376k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   376k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   376k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   376k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   376k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   376k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   376k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   376k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 7.07k, False: 369k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  7.07k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  7.07k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  7.07k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  7.07k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  14.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 112, False: 6.96k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 38, False: 7.03k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 74, False: 6.96k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  7.07k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  7.07k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  7.07k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  7.07k|        }                                                                                    \
  |  |  |  |  686|   376k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 15.1k, False: 361k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  15.1k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  15.1k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  15.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 103, False: 14.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  15.1k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  15.1k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  15.1k|        }                                                                                    \
  |  |  |  |  692|   376k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   376k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   376k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   376k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   376k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   376k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   376k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   376k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1286|   376k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   376k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   376k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 42, False: 376k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   376k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   376k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   376k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 376k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   376k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 376k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  717|   376k|                       ON_FAIL);                                                                \
  |  |  718|   376k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  673|   376k|    do {                                                                                     \
  |  |  |  |  674|   376k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   376k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   376k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   376k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   376k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   376k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   376k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   376k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   376k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   376k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   376k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 7.12k, False: 369k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  7.12k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  7.12k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  7.12k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  7.12k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  14.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 143, False: 6.97k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 57, False: 7.06k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 86, False: 6.97k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  7.12k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  7.12k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  7.12k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  7.12k|        }                                                                                    \
  |  |  |  |  686|   376k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   376k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 14.9k, False: 361k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  14.9k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  14.9k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  14.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 83, False: 14.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  14.9k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  14.9k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  14.9k|        }                                                                                    \
  |  |  |  |  692|   376k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   375k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   375k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   375k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   375k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   375k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   375k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   375k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   375k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1286|   375k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   375k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   375k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   375k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 46, False: 375k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   375k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   375k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   375k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 375k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   375k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 375k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  719|   376k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  673|   375k|    do {                                                                                     \
  |  |  |  |  674|   375k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   375k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   375k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   375k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   375k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   375k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   375k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   375k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   375k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   375k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   375k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   375k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   375k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 7.16k, False: 368k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  7.16k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  7.16k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  7.16k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  7.16k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  14.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 80, False: 7.08k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 40, False: 7.12k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 40, False: 7.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  7.16k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  7.16k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  7.16k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  7.16k|        }                                                                                    \
  |  |  |  |  686|   375k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   375k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 15.5k, False: 360k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  15.5k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  15.5k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  15.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 90, False: 15.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  15.5k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  15.5k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  15.5k|        }                                                                                    \
  |  |  |  |  692|   375k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   375k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   375k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   375k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   375k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   375k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   375k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   375k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   375k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1286|   375k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   375k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   375k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   375k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 51, False: 375k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   375k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   375k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   375k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 375k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   375k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 375k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  720|   375k|        n_seq -= 4;                                                                             \
  |  |  721|   375k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (721:14): [Folded, False: 375k]
  |  |  ------------------
  ------------------
 1287|   375k|            continue;
 1288|       |
 1289|   375k|        rollback_safe_4x:
 1290|  1.08k|            seq_ptr = t_save;
 1291|  1.08k|            extras_ptr = e_save;
 1292|  1.08k|            d_ptr = d_save;
 1293|  1.08k|            l_ptr = l_save;
 1294|  1.08k|            break;
 1295|   376k|        }
 1296|  7.82k|    } else {
 1297|   435k|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1297:16): [True: 433k, False: 1.45k]
  |  Branch (1297:30): [True: 432k, False: 1.52k]
  |  Branch (1297:52): [True: 430k, False: 1.98k]
  |  Branch (1297:77): [True: 428k, False: 1.97k]
  ------------------
 1298|   428k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  ------------------
  |  |  706|   428k|    do {                                                                                        \
  |  |  707|   428k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  708|   428k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  709|   428k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  710|   428k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  711|   428k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  712|   428k|        PREFETCH;                                                                               \
  |  |  713|   428k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  673|   428k|    do {                                                                                     \
  |  |  |  |  674|   428k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   428k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   428k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   428k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   428k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   428k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   428k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   428k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   428k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   428k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   428k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   428k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   428k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 9.09k, False: 419k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  9.09k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  9.09k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  9.09k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  9.09k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  18.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 160, False: 8.93k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 69, False: 9.02k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 91, False: 8.93k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  9.09k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  9.09k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  9.09k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  9.09k|        }                                                                                    \
  |  |  |  |  686|   428k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   428k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 18.2k, False: 409k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  18.2k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  18.2k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  18.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 87, False: 18.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  18.2k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  18.2k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  18.2k|        }                                                                                    \
  |  |  |  |  692|   428k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   428k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   428k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   428k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   428k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   428k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   428k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   428k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   428k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1298|   428k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   428k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   428k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   428k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 36, False: 428k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   428k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   428k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   428k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 428k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  714|   428k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  715|   428k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  716|   428k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  673|   428k|    do {                                                                                     \
  |  |  |  |  674|   428k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   428k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   428k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   428k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   428k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   428k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   428k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   428k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   428k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   428k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   428k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   428k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   428k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 8.27k, False: 419k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  8.27k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  8.27k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  8.27k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  8.27k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  16.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 86, False: 8.19k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 49, False: 8.22k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 37, False: 8.19k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  8.27k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  8.27k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  8.27k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  8.27k|        }                                                                                    \
  |  |  |  |  686|   428k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 17.6k, False: 410k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  17.6k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  17.6k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 57, False: 17.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  17.6k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  17.6k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  17.6k|        }                                                                                    \
  |  |  |  |  692|   427k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   427k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   427k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   427k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   427k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   427k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   427k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   427k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   427k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1298|   427k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   427k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   427k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 29, False: 427k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   427k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   427k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   427k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 427k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   427k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 427k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  717|   428k|                       ON_FAIL);                                                                \
  |  |  718|   428k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  673|   427k|    do {                                                                                     \
  |  |  |  |  674|   427k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   427k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   427k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   427k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   427k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   427k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   427k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   427k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   427k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   427k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   427k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   427k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 8.34k, False: 419k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  8.34k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  8.34k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  8.34k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  8.34k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  16.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 122, False: 8.22k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 79, False: 8.26k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 43, False: 8.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  8.34k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  8.34k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  8.34k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  8.34k|        }                                                                                    \
  |  |  |  |  686|   427k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 17.6k, False: 410k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  17.6k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  17.6k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 80, False: 17.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  17.6k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  17.6k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  17.6k|        }                                                                                    \
  |  |  |  |  692|   427k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   427k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   427k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   427k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   427k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   427k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   427k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   427k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   427k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1298|   427k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   427k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   427k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 45, False: 427k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   427k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   427k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   427k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 427k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   427k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 427k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  719|   427k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  673|   427k|    do {                                                                                     \
  |  |  |  |  674|   427k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|   427k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   427k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   427k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|   427k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|   427k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   427k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|   427k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|   427k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|   427k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|   427k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|   427k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 8.28k, False: 419k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  8.28k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  8.28k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  8.28k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  8.28k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  16.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 77, False: 8.20k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 57, False: 8.22k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 20, False: 8.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  8.28k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  8.28k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  8.28k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  8.28k|        }                                                                                    \
  |  |  |  |  686|   427k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 18.1k, False: 409k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  18.1k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  18.1k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  18.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 61, False: 18.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  18.1k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  18.1k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  18.1k|        }                                                                                    \
  |  |  |  |  692|   427k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|   427k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   427k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|   427k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|   427k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|   427k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|   427k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|   427k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|   427k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1298|   427k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  552|   427k|    do {                                                                              \
  |  |  |  |  |  |  |  |  553|   427k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  152|   427k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (152:21): [True: 36, False: 427k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  554|   427k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  555|   427k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  556|   427k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (556:14): [Folded, False: 427k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|   427k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 427k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  720|   427k|        n_seq -= 4;                                                                             \
  |  |  721|   427k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (721:14): [Folded, False: 427k]
  |  |  ------------------
  ------------------
 1299|   428k|        }
 1300|  7.82k|    }
 1301|       |
 1302|       |    // --- SAFE Loop tail: remaining sequences with offset validation (1x) ---
 1303|   182k|    while (n_seq > 0 && d_ptr < d_end_safe && d_ptr < d_bounds) {
  ------------------
  |  Branch (1303:12): [True: 178k, False: 3.88k]
  |  Branch (1303:25): [True: 174k, False: 4.50k]
  |  Branch (1303:47): [True: 169k, False: 4.64k]
  ------------------
 1304|   169k|        uint32_t seq = zxc_le32(seq_ptr);
 1305|   169k|        seq_ptr += sizeof(uint32_t);
 1306|       |
 1307|   169k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  545|   169k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  535|   169k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  537|   169k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1308|   169k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) ll += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  152|   169k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 5.28k, False: 164k]
  |  |  ------------------
  ------------------
 1309|       |
 1310|   169k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  547|   169k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  537|   169k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  541|   169k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  535|   169k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1311|   169k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|   169k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1312|   169k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  152|   169k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 8.91k, False: 160k]
  |  |  ------------------
  ------------------
 1313|       |
 1314|   169k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  543|   169k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  537|   169k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  724|   169k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1315|       |
 1316|       |        // Strict bounds check: sequence must fit, AND wild copies must not overshoot
 1317|       |        // Check both destination (d_ptr) and source literal stream (l_ptr)
 1318|   169k|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr) ||
  ------------------
  |  |  152|   337k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 16.7k, False: 153k]
  |  |  |  Branch (152:42): [True: 1.82k, False: 167k]
  |  |  |  Branch (152:42): [True: 14.9k, False: 153k]
  |  |  ------------------
  ------------------
 1319|   169k|                     ll + ZXC_PAD_SIZE > (size_t)(l_end - l_ptr))) {
 1320|       |            // Fallback to exact copy (slow but safe)
 1321|  16.7k|            if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  152|  32.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 1.06k, False: 15.6k]
  |  |  |  Branch (152:42): [True: 875, False: 15.8k]
  |  |  |  Branch (152:42): [True: 186, False: 15.6k]
  |  |  ------------------
  ------------------
 1322|  1.06k|                return ZXC_ERROR_OVERFLOW;
 1323|  15.6k|            ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  168|  15.6k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1324|  15.6k|            l_ptr += ll;
 1325|  15.6k|            d_ptr += ll;
 1326|       |
 1327|  15.6k|            if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  152|  15.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 30, False: 15.6k]
  |  |  ------------------
  ------------------
 1328|  15.6k|            const uint8_t* match_src = d_ptr - offset;
 1329|       |
 1330|  15.6k|            zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1331|  15.6k|            d_ptr += ml;
 1332|   153k|        } else {
 1333|   153k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1334|   153k|            l_ptr += ll;
 1335|   153k|            d_ptr += ll;
 1336|   153k|            DECODE_MATCH_SAFE(ml, offset, zxc_decode_copy_match);
  ------------------
  |  |  552|   153k|    do {                                                                              \
  |  |  553|   153k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  ------------------
  |  |  |  |  152|   153k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (152:21): [True: 176, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  554|   153k|        COPY(d_ptr, off, ml);                                                         \
  |  |  555|   152k|        d_ptr += ml;                                                                  \
  |  |  556|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (556:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
 1337|   153k|        }
 1338|   168k|        n_seq--;
 1339|   168k|    }
 1340|       |
 1341|       |    // --- FAST Loop: After threshold, check large margin to avoid individual bounds checks ---
 1342|  13.0k|    if (safe) {
  ------------------
  |  Branch (1342:9): [True: 6.42k, False: 6.61k]
  ------------------
 1343|  63.3k|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1343:16): [True: 60.0k, False: 3.28k]
  |  Branch (1343:30): [True: 57.7k, False: 2.30k]
  |  Branch (1343:52): [True: 57.5k, False: 238]
  ------------------
 1344|  57.5k|            const uint8_t* const t_save = seq_ptr;
 1345|  57.5k|            const uint8_t* const e_save = extras_ptr;
 1346|  57.5k|            uint8_t* const d_save = d_ptr;
 1347|  57.5k|            const uint8_t* const l_save = l_ptr;
 1348|  57.5k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  ------------------
  |  |  706|  57.5k|    do {                                                                                        \
  |  |  707|  57.5k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  708|  57.5k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  709|  57.5k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  710|  57.5k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  711|  57.5k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  712|  57.5k|        PREFETCH;                                                                               \
  |  |  713|  57.5k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  673|  57.5k|    do {                                                                                     \
  |  |  |  |  674|  57.5k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  57.5k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  57.5k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.5k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  57.5k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  57.5k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.5k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  57.5k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  57.5k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  57.5k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  57.5k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  57.5k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  57.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.79k, False: 55.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  1.79k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  1.79k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  1.79k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  1.79k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.59k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 170, False: 1.62k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 0, False: 1.79k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 170, False: 1.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  1.79k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  1.79k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  1.79k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  1.79k|        }                                                                                    \
  |  |  |  |  686|  57.5k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  57.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.50k, False: 54.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  2.50k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  2.50k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.50k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 32, False: 2.46k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  2.50k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  2.50k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  2.50k|        }                                                                                    \
  |  |  |  |  692|  57.3k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  57.2k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  57.2k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  57.2k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  57.2k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  57.2k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  57.2k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  57.2k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1348|  57.2k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  57.2k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  57.2k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  57.2k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  57.2k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 57.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  57.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 57.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  714|  57.5k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  715|  57.5k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  716|  57.5k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  673|  57.2k|    do {                                                                                     \
  |  |  |  |  674|  57.2k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  57.2k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  57.2k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  57.2k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  57.2k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  57.2k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  57.2k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  57.2k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  57.2k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  57.2k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  57.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.74k, False: 55.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  1.74k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  1.74k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  1.74k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  1.74k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.49k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 149, False: 1.59k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 1, False: 1.74k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 148, False: 1.59k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  1.74k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  1.74k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  1.74k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  1.74k|        }                                                                                    \
  |  |  |  |  686|  57.2k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  57.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.40k, False: 54.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  2.40k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  2.40k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.40k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 26, False: 2.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  2.40k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  2.40k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  2.40k|        }                                                                                    \
  |  |  |  |  692|  57.1k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  57.1k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.1k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  57.1k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  57.1k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  57.1k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  57.1k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  57.1k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  57.1k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1348|  57.1k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  57.1k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  57.1k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  57.1k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  57.1k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 57.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  57.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 57.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  717|  57.2k|                       ON_FAIL);                                                                \
  |  |  718|  57.2k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  673|  57.1k|    do {                                                                                     \
  |  |  |  |  674|  57.1k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  57.1k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  57.1k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.1k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  57.1k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  57.1k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  57.1k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  57.1k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  57.1k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  57.1k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  57.1k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  57.1k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  57.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.67k, False: 55.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  1.67k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  1.67k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  1.67k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  1.67k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.34k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 132, False: 1.54k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 0, False: 1.67k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 132, False: 1.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  1.67k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  1.67k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  1.67k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  1.67k|        }                                                                                    \
  |  |  |  |  686|  57.1k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  56.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.48k, False: 54.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  2.48k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  2.48k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.48k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 28, False: 2.45k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  2.48k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  2.48k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  2.48k|        }                                                                                    \
  |  |  |  |  692|  56.9k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  56.9k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  56.9k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  56.9k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  56.9k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  56.9k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  56.9k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  56.9k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  56.9k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1348|  56.9k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  56.9k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  56.9k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  56.9k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  56.9k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 56.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  56.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 56.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  719|  57.1k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  673|  56.9k|    do {                                                                                     \
  |  |  |  |  674|  56.9k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  56.9k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  56.9k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  56.9k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  56.9k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  56.9k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  56.9k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  56.9k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  56.9k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  56.9k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  56.9k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  56.9k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  56.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 1.61k, False: 55.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  1.61k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  1.61k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  1.61k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  1.61k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.22k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 46, False: 1.56k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 0, False: 1.61k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 46, False: 1.56k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  1.61k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  1.61k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  1.61k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  1.61k|        }                                                                                    \
  |  |  |  |  686|  56.9k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  56.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.49k, False: 54.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  2.49k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  2.49k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.49k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 8, False: 2.49k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  2.49k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  2.49k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  2.49k|        }                                                                                    \
  |  |  |  |  692|  56.9k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  56.9k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  56.9k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  56.9k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  56.9k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  56.9k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  56.9k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  56.9k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  56.9k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1348|  56.9k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  56.9k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  56.9k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  56.9k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  56.9k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 56.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  56.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 56.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  720|  56.9k|        n_seq -= 4;                                                                             \
  |  |  721|  56.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (721:14): [Folded, False: 56.9k]
  |  |  ------------------
  ------------------
 1349|  57.5k|                                ZXC_PREFETCH_READ(l_ptr + ZXC_CACHE_LINE_SIZE));
 1350|  56.9k|            continue;
 1351|       |
 1352|  56.9k|        rollback_fast_4x:
 1353|    591|            seq_ptr = t_save;
 1354|    591|            extras_ptr = e_save;
 1355|    591|            d_ptr = d_save;
 1356|    591|            l_ptr = l_save;
 1357|    591|            break;
 1358|  57.5k|        }
 1359|  6.61k|    } else {
 1360|  75.6k|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1360:16): [True: 71.3k, False: 4.35k]
  |  Branch (1360:30): [True: 70.2k, False: 1.07k]
  |  Branch (1360:52): [True: 69.3k, False: 895]
  ------------------
 1361|  69.3k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  ------------------
  |  |  706|  69.3k|    do {                                                                                        \
  |  |  707|  69.3k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  708|  69.3k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  709|  69.3k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  710|  69.3k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  711|  69.3k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  712|  69.3k|        PREFETCH;                                                                               \
  |  |  713|  69.3k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  673|  69.3k|    do {                                                                                     \
  |  |  |  |  674|  69.3k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  69.3k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.3k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.3k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  69.3k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  69.3k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.3k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  69.3k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.3k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  69.3k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  69.3k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  69.3k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.30k, False: 67.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  2.30k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  2.30k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  2.30k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  2.30k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.61k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 82, False: 2.22k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 0, False: 2.30k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 82, False: 2.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  2.30k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  2.30k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  2.30k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  2.30k|        }                                                                                    \
  |  |  |  |  686|  69.3k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 3.13k, False: 66.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  3.13k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  3.13k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.13k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 16, False: 3.11k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  3.13k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  3.13k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  3.13k|        }                                                                                    \
  |  |  |  |  692|  69.2k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  69.2k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  69.2k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  69.2k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  69.2k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  69.2k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  69.2k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  69.2k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1361|  69.2k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  69.2k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  69.2k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  69.2k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  69.2k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 69.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  69.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 69.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  714|  69.3k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  715|  69.3k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  716|  69.3k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  673|  69.2k|    do {                                                                                     \
  |  |  |  |  674|  69.2k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  69.2k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.2k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  69.2k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  69.2k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  69.2k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.2k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  69.2k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  69.2k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  69.2k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.25k, False: 67.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  2.25k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  2.25k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  2.25k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  2.25k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.50k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 73, False: 2.17k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 0, False: 2.25k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 73, False: 2.17k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  2.25k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  2.25k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  2.25k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  2.25k|        }                                                                                    \
  |  |  |  |  686|  69.2k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 3.05k, False: 66.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  3.05k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  3.05k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.05k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 13, False: 3.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  3.05k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  3.05k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  3.05k|        }                                                                                    \
  |  |  |  |  692|  69.1k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  69.1k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.1k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  69.1k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  69.1k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  69.1k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  69.1k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  69.1k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  69.1k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1361|  69.1k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  69.1k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  69.1k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  69.1k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  69.1k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 69.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  69.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 69.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  717|  69.2k|                       ON_FAIL);                                                                \
  |  |  718|  69.2k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  673|  69.1k|    do {                                                                                     \
  |  |  |  |  674|  69.1k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  69.1k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.1k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.1k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  69.1k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  69.1k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.1k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  69.1k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.1k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  69.1k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  69.1k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  69.1k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.15k, False: 67.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  2.15k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  2.15k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  2.15k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  2.15k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.31k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 66, False: 2.09k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 0, False: 2.15k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 66, False: 2.09k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  2.15k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  2.15k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  2.15k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  2.15k|        }                                                                                    \
  |  |  |  |  686|  69.1k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 3.16k, False: 65.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  3.16k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  3.16k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.16k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 13, False: 3.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  3.16k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  3.16k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  3.16k|        }                                                                                    \
  |  |  |  |  692|  69.1k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  69.0k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.0k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  69.0k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  69.0k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  69.0k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  69.0k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  69.0k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  69.0k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1361|  69.0k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  69.0k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  69.0k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  69.0k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  69.0k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 69.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  69.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 69.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  719|  69.1k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  673|  69.0k|    do {                                                                                     \
  |  |  |  |  674|  69.0k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  545|  69.0k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.0k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.0k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  675|  69.0k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  547|  69.0k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.0k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  69.0k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  69.0k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  676|  69.0k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  69.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  677|  69.0k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 2.03k, False: 67.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  678|  2.03k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  679|  2.03k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  680|  2.03k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  681|  2.03k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.07k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 23, False: 2.01k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 0, False: 2.03k]
  |  |  |  |  |  |  |  Branch (152:42): [True: 23, False: 2.01k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  682|  2.03k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  683|  2.03k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  684|  2.03k|                ON_FAIL;                                                                     \
  |  |  |  |  685|  2.03k|        }                                                                                    \
  |  |  |  |  686|  69.0k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 3.12k, False: 65.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  687|  3.12k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  688|  3.12k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.12k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (152:21): [True: 4, False: 3.11k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  689|  3.12k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  690|  3.12k|                ON_FAIL;                                                                     \
  |  |  |  |  691|  3.12k|        }                                                                                    \
  |  |  |  |  692|  69.0k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  543|  69.0k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  69.0k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  724|  69.0k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  693|  69.0k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  694|  69.0k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  695|  69.0k|        l_ptr += ll;                                                                         \
  |  |  |  |  696|  69.0k|        d_ptr += ll;                                                                         \
  |  |  |  |  697|  69.0k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1361|  69.0k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  561|  69.0k|    do {                                 \
  |  |  |  |  |  |  |  |  562|  69.0k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  563|  69.0k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  564|  69.0k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (564:14): [Folded, False: 69.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  698|  69.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (698:14): [Folded, False: 69.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  720|  69.0k|        n_seq -= 4;                                                                             \
  |  |  721|  69.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (721:14): [Folded, False: 69.0k]
  |  |  ------------------
  ------------------
 1362|  69.3k|                                ZXC_PREFETCH_READ(l_ptr + ZXC_CACHE_LINE_SIZE));
 1363|  69.3k|        }
 1364|  6.61k|    }
 1365|       |
 1366|       |    // --- Remaining 1 sequence (Fast Path) ---
 1367|  76.1k|    while (n_seq > 0 && d_ptr < d_end_safe && l_ptr < l_end_safe_1x) {
  ------------------
  |  Branch (1367:12): [True: 71.6k, False: 4.47k]
  |  Branch (1367:25): [True: 66.8k, False: 4.81k]
  |  Branch (1367:47): [True: 64.2k, False: 2.53k]
  ------------------
 1368|       |        // Save state for fallback
 1369|  64.2k|        const uint8_t* seq_save = seq_ptr;
 1370|  64.2k|        const uint8_t* ext_save = extras_ptr;
 1371|       |
 1372|  64.2k|        const uint32_t seq = zxc_le32(seq_ptr);
 1373|  64.2k|        seq_ptr += sizeof(uint32_t);
 1374|       |
 1375|  64.2k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  545|  64.2k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  535|  64.2k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  537|  64.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1376|  64.2k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {
  ------------------
  |  |  152|  64.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 3.21k, False: 61.0k]
  |  |  ------------------
  ------------------
 1377|  3.21k|            ll += zxc_read_varint(&extras_ptr, extras_end);
 1378|  3.21k|            if (UNLIKELY(ll > (size_t)(l_end - l_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  152|  3.21k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 33, False: 3.18k]
  |  |  ------------------
  ------------------
 1379|  3.21k|        }
 1380|       |
 1381|  64.2k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  547|  64.2k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  537|  64.2k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  541|  64.2k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  535|  64.2k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1382|  64.2k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|  64.2k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1383|  64.2k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  152|  64.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 2.55k, False: 61.7k]
  |  |  ------------------
  ------------------
 1384|       |
 1385|       |        // Strict bounds checks (including wild copy overrun safety)
 1386|  64.2k|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr) ||
  ------------------
  |  |  152|   128k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 893, False: 63.3k]
  |  |  |  Branch (152:42): [True: 417, False: 63.8k]
  |  |  |  Branch (152:42): [True: 476, False: 63.3k]
  |  |  ------------------
  ------------------
 1387|  64.2k|                     ll + ZXC_PAD_SIZE > (size_t)(l_end - l_ptr))) {
 1388|    893|            seq_ptr = seq_save;
 1389|    893|            extras_ptr = ext_save;
 1390|    893|            break;
 1391|    893|        }
 1392|  63.3k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  543|  63.3k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  537|  63.3k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  724|  63.3k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1393|       |
 1394|  63.3k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1395|  63.3k|        l_ptr += ll;
 1396|  63.3k|        d_ptr += ll;
 1397|       |
 1398|  63.3k|        if (UNLIKELY(d_ptr < d_bounds && (size_t)(d_ptr - d_floor) < offset))
  ------------------
  |  |  152|  63.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 63.3k]
  |  |  |  Branch (152:42): [True: 0, False: 63.3k]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1399|      0|            return ZXC_ERROR_BAD_OFFSET;
 1400|       |
 1401|       |        // The loop entry check guarantees ll + ml + ZXC_PAD_SIZE bytes of
 1402|       |        // headroom, so the wild-copy ladder (incl. overlap/fill runs) is safe.
 1403|  63.3k|        zxc_decode_copy_match(d_ptr, offset, ml);
 1404|  63.3k|        d_ptr += ml;
 1405|  63.3k|        n_seq--;
 1406|  63.3k|    }
 1407|       |
 1408|       |    // --- Safe Path for Remaining Sequences ---
 1409|  51.7k|    while (n_seq > 0) {
  ------------------
  |  Branch (1409:12): [True: 39.3k, False: 12.3k]
  ------------------
 1410|  39.3k|        uint32_t seq = zxc_le32(seq_ptr);
 1411|  39.3k|        seq_ptr += sizeof(uint32_t);
 1412|       |
 1413|  39.3k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  545|  39.3k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  535|  39.3k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  537|  39.3k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1414|  39.3k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) ll += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  152|  39.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 1.01k, False: 38.3k]
  |  |  ------------------
  ------------------
 1415|       |
 1416|  39.3k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  547|  39.3k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  537|  39.3k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  541|  39.3k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  535|  39.3k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1417|  39.3k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  586|  39.3k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1418|  39.3k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  152|  39.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 2.34k, False: 37.0k]
  |  |  ------------------
  ------------------
 1419|  39.3k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  543|  39.3k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  537|  39.3k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  724|  39.3k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1420|       |
 1421|  39.3k|        if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  152|  78.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 286, False: 39.0k]
  |  |  |  Branch (152:42): [True: 223, False: 39.1k]
  |  |  |  Branch (152:42): [True: 63, False: 39.0k]
  |  |  ------------------
  ------------------
 1422|    286|            return ZXC_ERROR_OVERFLOW;
 1423|  39.0k|        ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  168|  39.0k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1424|  39.0k|        l_ptr += ll;
 1425|  39.0k|        d_ptr += ll;
 1426|       |
 1427|  39.0k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  152|  39.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 37, False: 39.0k]
  |  |  ------------------
  ------------------
 1428|  39.0k|        const uint8_t* match_src = d_ptr - offset;
 1429|       |
 1430|  39.0k|        zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1431|  39.0k|        d_ptr += ml;
 1432|  39.0k|        n_seq--;
 1433|  39.0k|    }
 1434|       |
 1435|       |    // --- Trailing Literals ---
 1436|       |    // Copy remaining literals from source stream (literal exhaustion)
 1437|  12.3k|    if (UNLIKELY(l_ptr > l_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  12.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 12.3k]
  |  |  ------------------
  ------------------
 1438|  12.3k|    if (UNLIKELY(d_ptr > d_end)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  152|  12.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 12.3k]
  |  |  ------------------
  ------------------
 1439|       |
 1440|  12.3k|    const size_t remaining_literals = (size_t)(l_end - l_ptr);
 1441|  12.3k|    if (UNLIKELY(remaining_literals > (size_t)(d_end - d_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  152|  12.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 24, False: 12.3k]
  |  |  ------------------
  ------------------
 1442|  12.3k|    ZXC_MEMCPY(d_ptr, l_ptr, remaining_literals);
  ------------------
  |  |  168|  12.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1443|  12.3k|    d_ptr += remaining_literals;
 1444|       |
 1445|  12.3k|    return (int)(d_ptr - dst);
 1446|  12.3k|}
zxc_decompress.c:zxc_decode_block_pak:
 1511|  7.90k|                                const size_t dst_capacity) {
 1512|  7.90k|    return zxc_decode_block_pak_impl(ctx, src, src_size, dst, dst_capacity, 0, 0);
 1513|  7.90k|}

zxc_common.c:zxc_aligned_malloc:
  113|  54.6k|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|  54.6k|    void* ptr = NULL;
  118|  54.6k|    if (posix_memalign(&ptr, alignment, size) != 0) return NULL;
  ------------------
  |  Branch (118:9): [True: 0, False: 54.6k]
  ------------------
  119|  54.6k|    return ptr;
  120|  54.6k|#endif
  121|  54.6k|}
zxc_common.c:zxc_aligned_free:
  124|  54.6k|static inline void zxc_aligned_free(void* ptr) {
  125|       |#if defined(_WIN32)
  126|       |    _aligned_free(ptr);
  127|       |#else
  128|  54.6k|    free(ptr);
  129|  54.6k|#endif
  130|  54.6k|}

zxc_decompress_chunk_wrapper:
  520|  72.8k|                                 const uint64_t block_index) {
  521|       |    // dict_size is constant for a stream; this per-block branch (outside the decode
  522|       |    // loop) routes to the dict variant only when a dictionary is active, so the
  523|       |    // no-dict path runs the dict-free chunk wrapper (identical codegen to main).
  524|  72.8k|    const zxc_variant_set_t* v = zxc_variants();
  525|       |#ifdef ZXC_NO_DICT
  526|       |    // dict_size is always 0.
  527|       |    return v->decompress(ctx, src, src_sz, dst, dst_cap, block_index);
  528|       |#else
  529|  72.8k|    return (ctx->dict_size ? v->decompress_dict : v->decompress)(ctx, src, src_sz, dst, dst_cap,
  ------------------
  |  Branch (529:13): [True: 0, False: 72.8k]
  ------------------
  530|  72.8k|                                                                 block_index);
  531|  72.8k|#endif
  532|  72.8k|}
zxc_compress_chunk_wrapper:
  556|  17.6k|                               const uint64_t block_index) {
  557|  17.6k|    return zxc_variants()->compress(ctx, src, src_sz, dst, dst_cap, block_index);
  558|  17.6k|}
zxc_create_cctx:
 1176|  17.6k|zxc_cctx* zxc_create_cctx(void) {
 1177|  17.6k|    zxc_cctx* const cctx = (zxc_cctx*)ZXC_CALLOC(1, sizeof(zxc_cctx));
  ------------------
  |  |   74|  17.6k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
 1178|  17.6k|    if (UNLIKELY(!cctx)) return NULL;  // LCOV_EXCL_LINE
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1179|  17.6k|    cctx->params = zxc_cparams_defaults();
 1180|  17.6k|    cctx->init_level = ZXC_LEVEL_DEFAULT;
 1181|  17.6k|    return cctx;
 1182|  17.6k|}
zxc_cparam_bounds:
 1186|  52.9k|int zxc_cparam_bounds(const zxc_cparam_t param, int64_t* min, int64_t* max) {
 1187|  52.9k|    int64_t lo, hi;
 1188|  52.9k|    switch (param) {
 1189|  17.6k|        case ZXC_C_LEVEL:
  ------------------
  |  Branch (1189:9): [True: 17.6k, False: 35.2k]
  ------------------
 1190|  17.6k|            lo = ZXC_LEVEL_FASTEST;
 1191|  17.6k|            hi = ZXC_LEVEL_ULTRA;
 1192|  17.6k|            break;
 1193|  17.6k|        case ZXC_C_BLOCK_SIZE:
  ------------------
  |  Branch (1193:9): [True: 17.6k, False: 35.2k]
  ------------------
 1194|  17.6k|            lo = ZXC_BLOCK_SIZE_MIN;
  ------------------
  |  |   73|  17.6k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  17.6k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
 1195|  17.6k|            hi = ZXC_BLOCK_SIZE_MAX;
  ------------------
  |  |   75|  17.6k|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  ------------------
  |  |  |  |   69|  17.6k|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  ------------------
  ------------------
 1196|  17.6k|            break;
 1197|      0|        case ZXC_C_THREADS:
  ------------------
  |  Branch (1197:9): [True: 0, False: 52.9k]
  ------------------
 1198|      0|            lo = 0;
 1199|      0|            hi = ZXC_MAX_THREADS;
  ------------------
  |  |  113|      0|#define ZXC_MAX_THREADS 512
  ------------------
 1200|      0|            break;
 1201|  17.6k|        case ZXC_C_CHECKSUM:
  ------------------
  |  Branch (1201:9): [True: 17.6k, False: 35.2k]
  ------------------
 1202|  17.6k|        case ZXC_C_SEEKABLE:
  ------------------
  |  Branch (1202:9): [True: 0, False: 52.9k]
  ------------------
 1203|  17.6k|            lo = 0;
 1204|  17.6k|            hi = 1;
 1205|  17.6k|            break;
 1206|      0|        case ZXC_C_FAVOR_DECODE_SPEED:
  ------------------
  |  Branch (1206:9): [True: 0, False: 52.9k]
  ------------------
 1207|      0|            lo = 1;
 1208|      0|            hi = ZXC_FAVOR_DECODE_SPEED_MAX;
  ------------------
  |  |   82|      0|#define ZXC_FAVOR_DECODE_SPEED_MAX 100
  ------------------
 1209|      0|            break;
 1210|      0|        default:
  ------------------
  |  Branch (1210:9): [True: 0, False: 52.9k]
  ------------------
 1211|      0|            return ZXC_ERROR_BAD_PARAM;
 1212|  52.9k|    }
 1213|  52.9k|    if (min) *min = lo;
  ------------------
  |  Branch (1213:9): [True: 52.9k, False: 0]
  ------------------
 1214|  52.9k|    if (max) *max = hi;
  ------------------
  |  Branch (1214:9): [True: 52.9k, False: 0]
  ------------------
 1215|  52.9k|    return ZXC_OK;
 1216|  52.9k|}
zxc_cctx_set_param:
 1225|  52.9k|int zxc_cctx_set_param(zxc_cctx* cctx, const zxc_cparam_t param, const int64_t value) {
 1226|  52.9k|    if (UNLIKELY(!cctx)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  152|  52.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 52.9k]
  |  |  ------------------
  ------------------
 1227|  52.9k|    int64_t lo, hi;
 1228|  52.9k|    const int rc = zxc_cparam_bounds(param, &lo, &hi);
 1229|  52.9k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  52.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 52.9k]
  |  |  ------------------
  ------------------
 1230|  52.9k|    if (value != 0 && (value < lo || value > hi)) {
  ------------------
  |  Branch (1230:9): [True: 45.1k, False: 7.74k]
  |  Branch (1230:24): [True: 0, False: 45.1k]
  |  Branch (1230:38): [True: 0, False: 45.1k]
  ------------------
 1231|      0|        if (param == ZXC_C_LEVEL) return ZXC_ERROR_BAD_LEVEL;
  ------------------
  |  Branch (1231:13): [True: 0, False: 0]
  ------------------
 1232|      0|        return param == ZXC_C_BLOCK_SIZE ? ZXC_ERROR_BAD_BLOCK_SIZE : ZXC_ERROR_BAD_PARAM;
  ------------------
  |  Branch (1232:16): [True: 0, False: 0]
  ------------------
 1233|      0|    }
 1234|       |
 1235|  52.9k|    zxc_cparams_t* const p = &cctx->params;
 1236|  52.9k|    switch (param) {
 1237|  17.6k|        case ZXC_C_LEVEL: {
  ------------------
  |  Branch (1237:9): [True: 17.6k, False: 35.2k]
  ------------------
 1238|       |            // 0 restores the default: on a static workspace, the pinned level.
 1239|  17.6k|            const int level = value != 0             ? (int)value
  ------------------
  |  Branch (1239:31): [True: 17.6k, False: 0]
  ------------------
 1240|  17.6k|                              : cctx->owns_workspace ? cctx->init_level
  ------------------
  |  Branch (1240:33): [True: 0, False: 0]
  ------------------
 1241|      0|                                                     : ZXC_LEVEL_DEFAULT;
 1242|       |            // A static workspace carved below the optimal-parser tier cannot grow into it.
 1243|  17.6k|            if (UNLIKELY(cctx->owns_workspace && level >= ZXC_LEVEL_DENSITY &&
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1244|  17.6k|                         !cctx->inner.opt_scratch))
 1245|      0|                return ZXC_ERROR_BAD_LEVEL;
 1246|  17.6k|            p->level = level;
 1247|  17.6k|            break;
 1248|  17.6k|        }
 1249|  17.6k|        case ZXC_C_BLOCK_SIZE: {
  ------------------
  |  Branch (1249:9): [True: 17.6k, False: 35.2k]
  ------------------
 1250|  17.6k|            const size_t block_size = value != 0             ? (size_t)value
  ------------------
  |  Branch (1250:39): [True: 17.6k, False: 0]
  ------------------
 1251|  17.6k|                                      : cctx->owns_workspace ? cctx->last_block_size
  ------------------
  |  Branch (1251:41): [True: 0, False: 0]
  ------------------
 1252|      0|                                                             : ZXC_BLOCK_SIZE_DEFAULT;
  ------------------
  |  |   71|      0|#define ZXC_BLOCK_SIZE_DEFAULT (512 * 1024)
  ------------------
 1253|  17.6k|            if (UNLIKELY(!zxc_validate_block_size(block_size))) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1254|  17.6k|            if (UNLIKELY(cctx->owns_workspace && block_size != cctx->last_block_size))
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1255|      0|                return ZXC_ERROR_BAD_BLOCK_SIZE;
 1256|  17.6k|            p->block_size = block_size;
 1257|  17.6k|            break;
 1258|  17.6k|        }
 1259|      0|        case ZXC_C_THREADS:
  ------------------
  |  Branch (1259:9): [True: 0, False: 52.9k]
  ------------------
 1260|      0|            p->n_threads = (int)value;
 1261|      0|            break;
 1262|  17.6k|        case ZXC_C_CHECKSUM:
  ------------------
  |  Branch (1262:9): [True: 17.6k, False: 35.2k]
  ------------------
 1263|  17.6k|            p->checksum_enabled = (int)value;
 1264|  17.6k|            break;
 1265|      0|        case ZXC_C_SEEKABLE:
  ------------------
  |  Branch (1265:9): [True: 0, False: 52.9k]
  ------------------
 1266|      0|            p->seekable = (int)value;
 1267|      0|            break;
 1268|      0|        case ZXC_C_FAVOR_DECODE_SPEED:
  ------------------
  |  Branch (1268:9): [True: 0, False: 52.9k]
  ------------------
 1269|      0|            p->favor_decode_speed = (int)value;
 1270|      0|            break;
 1271|      0|        default:
  ------------------
  |  Branch (1271:9): [True: 0, False: 52.9k]
  ------------------
 1272|      0|            return ZXC_ERROR_BAD_PARAM;  // LCOV_EXCL_LINE: bounds already refused it
 1273|  52.9k|    }
 1274|  52.9k|    return ZXC_OK;
 1275|  52.9k|}
zxc_free_cctx:
 1348|  17.6k|void zxc_free_cctx(zxc_cctx* cctx) {
 1349|  17.6k|    if (UNLIKELY(!cctx)) return;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1350|       |    // Static cctx: handle + inner buffers live inside the caller's workspace,
 1351|       |    // which we do not own. Free is a no-op; the caller owns the workspace.
 1352|  17.6k|    if (cctx->owns_workspace) return;
  ------------------
  |  Branch (1352:9): [True: 0, False: 17.6k]
  ------------------
 1353|  17.6k|    if (cctx->initialized) zxc_cctx_free(&cctx->inner);
  ------------------
  |  Branch (1353:9): [True: 17.6k, False: 0]
  ------------------
 1354|  17.6k|    ZXC_FREE(cctx->dict_copy.data);
  ------------------
  |  |   86|  17.6k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1355|  17.6k|    ZXC_FREE(cctx);
  ------------------
  |  |   86|  17.6k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1356|  17.6k|}
zxc_create_dctx:
 1517|  17.6k|zxc_dctx* zxc_create_dctx(void) {
 1518|  17.6k|    zxc_dctx* const dctx = (zxc_dctx*)ZXC_CALLOC(1, sizeof(zxc_dctx));
  ------------------
  |  |   74|  17.6k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
 1519|  17.6k|    return dctx;
 1520|  17.6k|}
zxc_dparam_bounds:
 1524|  52.9k|int zxc_dparam_bounds(const zxc_dparam_t param, int64_t* min, int64_t* max) {
 1525|  52.9k|    int64_t lo, hi;
 1526|  52.9k|    switch (param) {
 1527|      0|        case ZXC_D_THREADS:
  ------------------
  |  Branch (1527:9): [True: 0, False: 52.9k]
  ------------------
 1528|      0|            lo = 0;
 1529|      0|            hi = ZXC_MAX_THREADS;
  ------------------
  |  |  113|      0|#define ZXC_MAX_THREADS 512
  ------------------
 1530|      0|            break;
 1531|  52.9k|        case ZXC_D_CHECKSUM:
  ------------------
  |  Branch (1531:9): [True: 52.9k, False: 0]
  ------------------
 1532|  52.9k|            lo = 0;
 1533|  52.9k|            hi = 1;
 1534|  52.9k|            break;
 1535|      0|        default:
  ------------------
  |  Branch (1535:9): [True: 0, False: 52.9k]
  ------------------
 1536|      0|            return ZXC_ERROR_BAD_PARAM;
 1537|  52.9k|    }
 1538|  52.9k|    if (min) *min = lo;
  ------------------
  |  Branch (1538:9): [True: 52.9k, False: 0]
  ------------------
 1539|  52.9k|    if (max) *max = hi;
  ------------------
  |  Branch (1539:9): [True: 52.9k, False: 0]
  ------------------
 1540|  52.9k|    return ZXC_OK;
 1541|  52.9k|}
zxc_dctx_set_param:
 1543|  52.9k|int zxc_dctx_set_param(zxc_dctx* dctx, const zxc_dparam_t param, const int64_t value) {
 1544|  52.9k|    if (UNLIKELY(!dctx)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  152|  52.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 52.9k]
  |  |  ------------------
  ------------------
 1545|  52.9k|    int64_t lo, hi;
 1546|  52.9k|    const int rc = zxc_dparam_bounds(param, &lo, &hi);
 1547|  52.9k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  52.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 52.9k]
  |  |  ------------------
  ------------------
 1548|  52.9k|    if (value != 0 && (value < lo || value > hi)) return ZXC_ERROR_BAD_PARAM;
  ------------------
  |  Branch (1548:9): [True: 29.6k, False: 23.2k]
  |  Branch (1548:24): [True: 0, False: 29.6k]
  |  Branch (1548:38): [True: 0, False: 29.6k]
  ------------------
 1549|  52.9k|    switch (param) {
 1550|      0|        case ZXC_D_THREADS:
  ------------------
  |  Branch (1550:9): [True: 0, False: 52.9k]
  ------------------
 1551|      0|            dctx->params.n_threads = (int)value;
 1552|      0|            break;
 1553|  52.9k|        case ZXC_D_CHECKSUM:
  ------------------
  |  Branch (1553:9): [True: 52.9k, False: 0]
  ------------------
 1554|  52.9k|            dctx->params.checksum_enabled = (int)value;
 1555|  52.9k|            break;
 1556|      0|        default:
  ------------------
  |  Branch (1556:9): [True: 0, False: 52.9k]
  ------------------
 1557|      0|            return ZXC_ERROR_BAD_PARAM;  // LCOV_EXCL_LINE: bounds already refused it
 1558|  52.9k|    }
 1559|  52.9k|    return ZXC_OK;
 1560|  52.9k|}
zxc_free_dctx:
 1613|  17.6k|void zxc_free_dctx(zxc_dctx* dctx) {
 1614|  17.6k|    if (UNLIKELY(!dctx)) return;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1615|       |    // Static dctx: handle + inner buffers live inside the caller's workspace,
 1616|       |    // which we do not own. Free is a no-op; the caller owns the workspace.
 1617|  17.6k|    if (dctx->owns_workspace) return;
  ------------------
  |  Branch (1617:9): [True: 0, False: 17.6k]
  ------------------
 1618|  17.6k|    if (dctx->initialized) zxc_cctx_free(&dctx->inner);
  ------------------
  |  Branch (1618:9): [True: 17.6k, False: 0]
  ------------------
 1619|  17.6k|    ZXC_FREE(dctx->dict_copy.data);
  ------------------
  |  |   86|  17.6k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1620|  17.6k|    ZXC_FREE(dctx);
  ------------------
  |  |   86|  17.6k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1621|  17.6k|}
zxc_compress_block:
 2012|  17.6k|                           void* RESTRICT dst, const size_t dst_capacity) {
 2013|       |    return zxc_compress_block_at(cctx, src, src_size, dst, dst_capacity, NULL, 0);
 2014|  17.6k|}
zxc_compress_block_at:
 2018|  17.6k|                              const zxc_cparams_t* opts, const uint64_t block_index) {
 2019|  17.6k|    if (UNLIKELY(!cctx || !src || !dst || src_size == 0 || dst_capacity == 0))
  ------------------
  |  |  152|   141k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 2020|      0|        return ZXC_ERROR_NULL_INPUT;
 2021|  17.6k|    if (UNLIKELY(src_size > ZXC_BLOCK_SIZE_MAX)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 2022|       |
 2023|  17.6k|    const zxc_cparams_t* const cp = opts ? opts : &cctx->params;
  ------------------
  |  Branch (2023:37): [True: 0, False: 17.6k]
  ------------------
 2024|  17.6k|    zxc_cctx_opts_t carve = zxc_cparams_resolve(cp);
 2025|       |    // Carve for the source if block_size is smaller; remember block_size as asked.
 2026|  17.6k|    const size_t min_bs = zxc_block_size_ceil(src_size);
 2027|  17.6k|    if (carve.block_size < min_bs) carve.block_size = min_bs;
  ------------------
  |  Branch (2027:9): [True: 0, False: 17.6k]
  ------------------
 2028|       |
 2029|  17.6k|    const uint8_t* chunk;
 2030|  17.6k|    size_t chunk_sz;
 2031|  17.6k|    const int rc = zxc_cctx_prepare_block(cctx, src, src_size, carve, cp, &chunk, &chunk_sz);
 2032|  17.6k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 2033|  17.6k|    const int res = zxc_compress_chunk_wrapper(&cctx->inner, chunk, chunk_sz, (uint8_t*)dst,
 2034|  17.6k|                                               dst_capacity, block_index);
 2035|  17.6k|    if (UNLIKELY(res < 0)) return res;
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 2036|  17.6k|    return (int64_t)res;
 2037|  17.6k|}
zxc_decompress_block:
 2212|  67.1k|                             void* RESTRICT dst, const size_t dst_capacity) {
 2213|  67.1k|    const zxc_dparams_t* const opts = dctx ? &dctx->params : NULL;
  ------------------
  |  Branch (2213:39): [True: 67.1k, False: 0]
  ------------------
 2214|  67.1k|    if (UNLIKELY(!dctx || !src || !dst || src_size < ZXC_BLOCK_HEADER_SIZE || dst_capacity == 0))
  ------------------
  |  |  152|   536k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 100, False: 67.0k]
  |  |  |  Branch (152:42): [True: 0, False: 67.1k]
  |  |  |  Branch (152:42): [True: 0, False: 67.1k]
  |  |  |  Branch (152:42): [True: 0, False: 67.1k]
  |  |  |  Branch (152:42): [True: 100, False: 67.0k]
  |  |  |  Branch (152:42): [True: 0, False: 67.0k]
  |  |  ------------------
  ------------------
 2215|    100|        return ZXC_ERROR_NULL_INPUT;
 2216|       |
 2217|       |    // One format-conformant block, so the payload cannot exceed
 2218|       |    // ZXC_BLOCK_SIZE_MAX; dst_capacity is bounded to that plus the tail-pad the
 2219|       |    // wild copies need. Larger outputs belong to the frame or streaming APIs.
 2220|  67.0k|    if (UNLIKELY(dst_capacity > ZXC_BLOCK_SIZE_MAX + ZXC_DECOMPRESS_TAIL_PAD))
  ------------------
  |  |  152|  67.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 67.0k]
  |  |  ------------------
  ------------------
 2221|      0|        return ZXC_ERROR_BAD_BLOCK_SIZE;
 2222|       |
 2223|  67.0k|    const int checksum_enabled = opts ? opts->checksum_enabled : 0;
  ------------------
  |  Branch (2223:34): [True: 67.0k, False: 0]
  ------------------
 2224|       |
 2225|  67.0k|    const uint8_t* dict = opts ? (const uint8_t*)opts->dict : NULL;
  ------------------
  |  Branch (2225:27): [True: 67.0k, False: 0]
  ------------------
 2226|  67.0k|    const size_t dict_size = ZXC_OPTS_DICT_SIZE(opts);
  ------------------
  |  | 1037|  67.0k|#define ZXC_OPTS_DICT_SIZE(o) (((o) && (o)->dict) ? (o)->dict_size : (size_t)0)
  |  |  ------------------
  |  |  |  Branch (1037:33): [True: 67.0k, False: 0]
  |  |  |  Branch (1037:40): [True: 0, False: 67.0k]
  |  |  ------------------
  ------------------
 2227|  67.0k|    if (UNLIKELY(dctx->owns_workspace))
  ------------------
  |  |  152|  67.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 67.0k]
  |  |  ------------------
  ------------------
 2228|      0|        return zxc_static_decompress_block(dctx, (const uint8_t*)src, src_size, (uint8_t*)dst,
 2229|      0|                                           dst_capacity, checksum_enabled, 0);
 2230|       |
 2231|       |    // Carved for the block dst can hold. The tail pad must not round the carve
 2232|       |    // up to 4 MiB: its buffers would then outgrow ZXC_VARINT_INVALID.
 2233|  67.0k|    const size_t block_size =
 2234|  67.0k|        zxc_block_size_ceil(dst_capacity < ZXC_BLOCK_SIZE_MAX ? dst_capacity : ZXC_BLOCK_SIZE_MAX);
  ------------------
  |  |   75|  67.0k|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  ------------------
  |  |  |  |   69|  67.0k|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  ------------------
  ------------------
                      zxc_block_size_ceil(dst_capacity < ZXC_BLOCK_SIZE_MAX ? dst_capacity : 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
  |  |  ------------------
  ------------------
  |  Branch (2234:29): [True: 67.0k, False: 0]
  ------------------
 2235|  67.0k|    const int rc = zxc_dctx_prepare(dctx, block_size, dict_size, checksum_enabled);
 2236|  67.0k|    if (UNLIKELY(rc != ZXC_OK)) return rc;  // LCOV_EXCL_LINE
  ------------------
  |  |  152|  67.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 67.0k]
  |  |  ------------------
  ------------------
 2237|       |
 2238|  67.0k|    zxc_cctx_t* const ctx = &dctx->inner;
 2239|  67.0k|    ctx->dict_size = dict_size;
 2240|  67.0k|    if (UNLIKELY(zxc_ctx_sync_dict_huf(ctx, dctx->huf_cache, &dctx->huf_cached,
  ------------------
  |  |  152|   335k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 67.0k]
  |  |  |  Branch (152:42): [True: 67.0k, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 67.0k]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2241|  67.0k|                                       ZXC_OPTS_DICT_HUF(opts)) != ZXC_OK))
 2242|      0|        return ZXC_ERROR_CORRUPT_DATA;  // LCOV_EXCL_LINE
 2243|       |
 2244|       |    // The [dict | decode] buffer carries block_size + ZXC_DECOMPRESS_TAIL_PAD.
 2245|  67.0k|    const size_t work_sz = block_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  372|  67.0k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|  67.0k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  67.0k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|  67.0k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  67.0k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  67.0k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  67.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|  67.0k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
 2246|       |
 2247|  67.0k|    int res;
 2248|  67.0k|    if (dict && dict_size > 0) {
  ------------------
  |  Branch (2248:9): [True: 0, False: 67.0k]
  |  Branch (2248:17): [True: 0, False: 0]
  ------------------
 2249|       |        // [dict | decode] assembled in the cctx-owned dict_buffer
 2250|      0|        uint8_t* const dec_buf = ctx->dict_buffer;
 2251|      0|        zxc_dict_buffer_load(ctx, dict, dict_size,
 2252|      0|                             zxc_dict_copy_gen(&dctx->dict_copy, dict, dict_size));
 2253|      0|        res = zxc_decompress_chunk_wrapper(ctx, (const uint8_t*)src, src_size, dec_buf + dict_size,
 2254|      0|                                           work_sz, 0);
 2255|      0|        if (LIKELY(res > 0)) {
  ------------------
  |  |  146|      0|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2256|      0|            if (UNLIKELY((size_t)res > dst_capacity)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2257|      0|            ZXC_MEMCPY(dst, dec_buf + dict_size, (size_t)res);
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2258|      0|        }
 2259|  67.0k|    } else {
 2260|  67.0k|        res = zxc_decompress_chunk_wrapper(ctx, (const uint8_t*)src, src_size, (uint8_t*)dst,
 2261|  67.0k|                                           dst_capacity, 0);
 2262|       |        // A tight tail aborts a block that fits: work_buf has the margin.
 2263|       |        // Corrupt blocks report OVERFLOW too, and pay the second decode.
 2264|  67.0k|        if (UNLIKELY(res == ZXC_ERROR_OVERFLOW))
  ------------------
  |  |  152|  67.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 5.78k, False: 61.2k]
  |  |  ------------------
  ------------------
 2265|  5.78k|            return zxc_decode_bounce(ctx, (const uint8_t*)src, src_size, (uint8_t*)dst,
 2266|  5.78k|                                     dst_capacity, 0);
 2267|  67.0k|    }
 2268|  61.2k|    if (UNLIKELY(res < 0)) return res;
  ------------------
  |  |  152|  61.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 23.3k, False: 37.8k]
  |  |  ------------------
  ------------------
 2269|  37.8k|    return (int64_t)res;
 2270|  61.2k|}
zxc_decompress_block_safe:
 2282|  88.1k|                                  void* RESTRICT dst, const size_t dst_capacity) {
 2283|  88.1k|    const zxc_dparams_t* const opts = dctx ? &dctx->params : NULL;
  ------------------
  |  Branch (2283:39): [True: 88.1k, False: 0]
  ------------------
 2284|  88.1k|    if (UNLIKELY(!dctx || !src || !dst || src_size < ZXC_BLOCK_HEADER_SIZE || dst_capacity == 0))
  ------------------
  |  |  152|   705k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 200, False: 87.9k]
  |  |  |  Branch (152:42): [True: 0, False: 88.1k]
  |  |  |  Branch (152:42): [True: 0, False: 88.1k]
  |  |  |  Branch (152:42): [True: 0, False: 88.1k]
  |  |  |  Branch (152:42): [True: 200, False: 87.9k]
  |  |  |  Branch (152:42): [True: 0, False: 87.9k]
  |  |  ------------------
  ------------------
 2285|    200|        return ZXC_ERROR_NULL_INPUT;
 2286|       |
 2287|       |    // Strict-tail variant: dst_capacity matches the exact uncompressed size
 2288|  87.9k|    if (UNLIKELY(dst_capacity > ZXC_BLOCK_SIZE_MAX)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  152|  87.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 87.9k]
  |  |  ------------------
  ------------------
 2289|  87.9k|    if (UNLIKELY(dctx->owns_workspace))
  ------------------
  |  |  152|  87.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 35.1k, False: 52.8k]
  |  |  ------------------
  ------------------
 2290|  35.1k|        return zxc_static_decompress_block(dctx, (const uint8_t*)src, src_size, (uint8_t*)dst,
 2291|  35.1k|                                           dst_capacity, opts ? opts->checksum_enabled : 0, 1);
  ------------------
  |  Branch (2291:58): [True: 35.1k, False: 0]
  ------------------
 2292|       |
 2293|       |    // A dict needs the [dict|payload] bounce; route to the bounce-capable path.
 2294|  52.8k|    if (opts && opts->dict && opts->dict_size > 0) {
  ------------------
  |  Branch (2294:9): [True: 52.8k, False: 0]
  |  Branch (2294:17): [True: 0, False: 52.8k]
  |  Branch (2294:31): [True: 0, False: 0]
  ------------------
 2295|      0|        return zxc_decompress_block(dctx, src, src_size, dst, dst_capacity);
 2296|      0|    }
 2297|       |
 2298|  52.8k|    const uint8_t type = ((const uint8_t*)src)[0];
 2299|       |    // RAW never wild-writes past dst_capacity: route to the existing fast API.
 2300|  52.8k|    if (type == ZXC_BLOCK_RAW) {
  ------------------
  |  Branch (2300:9): [True: 14.2k, False: 38.6k]
  ------------------
 2301|  14.2k|        return zxc_decompress_block(dctx, src, src_size, dst, dst_capacity);
 2302|  14.2k|    }
 2303|       |
 2304|       |    // SPL/PAK: use the strict-tail decoder (no bounce buffer required).
 2305|  38.6k|    const int checksum_enabled = opts ? opts->checksum_enabled : 0;
  ------------------
  |  Branch (2305:34): [True: 38.6k, False: 0]
  ------------------
 2306|  38.6k|    const int rc = zxc_dctx_prepare(dctx, zxc_block_size_ceil(dst_capacity), 0, checksum_enabled);
 2307|  38.6k|    if (UNLIKELY(rc != ZXC_OK)) return rc;  // LCOV_EXCL_LINE
  ------------------
  |  |  152|  38.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 38.6k]
  |  |  ------------------
  ------------------
 2308|  38.6k|    dctx->inner.dict_size = 0;
 2309|       |
 2310|  38.6k|    const int res = zxc_decompress_chunk_wrapper_safe_public(
 2311|  38.6k|        &dctx->inner, (const uint8_t*)src, src_size, (uint8_t*)dst, dst_capacity, 0);
 2312|  38.6k|    if (UNLIKELY(res < 0)) return res;
  ------------------
  |  |  152|  38.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 26.1k, False: 12.4k]
  |  |  ------------------
  ------------------
 2313|  12.4k|    return (int64_t)res;
 2314|  38.6k|}
zxc_static_dctx_workspace_size:
 2380|      3|size_t zxc_static_dctx_workspace_size(const size_t block_size) {
 2381|      3|    if (UNLIKELY(!zxc_validate_block_size(block_size))) return 0;
  ------------------
  |  |  152|      3|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 2382|      3|    const size_t inner_sz = zxc_cctx_compute_workspace_size(block_size, 0, 0, 0);
 2383|      3|    if (UNLIKELY(inner_sz == 0)) return 0;
  ------------------
  |  |  152|      3|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 2384|      3|    return ZXC_STATIC_DCTX_HDR_SIZE + inner_sz;
  ------------------
  |  | 2328|      3|#define ZXC_STATIC_DCTX_HDR_SIZE ZXC_ALIGN_CL(sizeof(struct zxc_dctx_s))
  |  |  ------------------
  |  |  |  |  384|      3|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|      3|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      3|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|      3|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|      3|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2385|      3|}
zxc_init_static_dctx:
 2388|  35.2k|                               const size_t block_size) {
 2389|  35.2k|    if (UNLIKELY(!workspace)) return NULL;
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 35.2k]
  |  |  ------------------
  ------------------
 2390|  35.2k|    if (UNLIKELY(!zxc_validate_block_size(block_size))) return NULL;
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 35.2k]
  |  |  ------------------
  ------------------
 2391|       |
 2392|  35.2k|    const size_t inner_sz = zxc_cctx_compute_workspace_size(block_size, 0, 0, 0);
 2393|  35.2k|    if (UNLIKELY(inner_sz == 0)) return NULL;
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 35.2k]
  |  |  ------------------
  ------------------
 2394|  35.2k|    if (UNLIKELY(workspace_size < ZXC_STATIC_DCTX_HDR_SIZE + inner_sz)) return NULL;
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 35.2k]
  |  |  ------------------
  ------------------
 2395|       |
 2396|  35.2k|    zxc_dctx* const dctx = (zxc_dctx*)workspace;
 2397|  35.2k|    ZXC_MEMSET(dctx, 0, sizeof(*dctx));
  ------------------
  |  |  173|  35.2k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2398|       |
 2399|  35.2k|    uint8_t* const inner_ws = (uint8_t*)workspace + ZXC_STATIC_DCTX_HDR_SIZE;
  ------------------
  |  | 2328|  35.2k|#define ZXC_STATIC_DCTX_HDR_SIZE ZXC_ALIGN_CL(sizeof(struct zxc_dctx_s))
  |  |  ------------------
  |  |  |  |  384|  35.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  35.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|  35.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2400|       |    // mode == 0 init: checksum_enabled is updated per-call from the file
 2401|       |    // header flags, so it does not need to be locked at workspace init.
 2402|  35.2k|    if (UNLIKELY(zxc_cctx_init_in_workspace(&dctx->inner, inner_ws, inner_sz, block_size, 0, 0, 0,
  ------------------
  |  |  152|  35.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 35.2k]
  |  |  ------------------
  ------------------
 2403|  35.2k|                                            0, 0) != ZXC_OK))
 2404|      0|        return NULL;
 2405|       |
 2406|  35.2k|    dctx->owns_workspace = 1;
 2407|  35.2k|    dctx->initialized = 1;
 2408|  35.2k|    dctx->last_block_size = block_size;
 2409|  35.2k|    return dctx;
 2410|  35.2k|}
zxc_dispatch.c:zxc_variants:
  417|  90.4k|static ZXC_ALWAYS_INLINE const zxc_variant_set_t* zxc_variants(void) {
  418|  90.4k|    return &zxc_variants_default;
  419|  90.4k|}
zxc_dispatch.c:zxc_cparams_defaults:
 1172|  17.6k|static zxc_cparams_t zxc_cparams_defaults(void) {
 1173|  17.6k|    return (zxc_cparams_t){.level = ZXC_LEVEL_DEFAULT, .block_size = ZXC_BLOCK_SIZE_DEFAULT};
  ------------------
  |  |   71|  17.6k|#define ZXC_BLOCK_SIZE_DEFAULT (512 * 1024)
  ------------------
 1174|  17.6k|}
zxc_dispatch.c:zxc_cparams_resolve:
 1163|  17.6k|static zxc_cctx_opts_t zxc_cparams_resolve(const zxc_cparams_t* p) {
 1164|  17.6k|    return (zxc_cctx_opts_t){.level = p->level,
 1165|  17.6k|                             .checksum = p->checksum_enabled,
 1166|  17.6k|                             .seekable = p->seekable,
 1167|  17.6k|                             .split_budget_pct = (uint8_t)p->favor_decode_speed,
 1168|  17.6k|                             .block_size = p->block_size};
 1169|  17.6k|}
zxc_dispatch.c:zxc_cctx_prepare_block:
 1944|  17.6k|                                  const uint8_t** chunk, size_t* chunk_sz) {
 1945|       |    // When a dictionary is active, offset_bits must accommodate dict + block.
 1946|  17.6k|    const uint8_t* b_dict = opts ? (const uint8_t*)opts->dict : NULL;
  ------------------
  |  Branch (1946:29): [True: 17.6k, False: 0]
  ------------------
 1947|  17.6k|    const size_t b_dict_size = ZXC_OPTS_DICT_SIZE(opts);
  ------------------
  |  | 1037|  17.6k|#define ZXC_OPTS_DICT_SIZE(o) (((o) && (o)->dict) ? (o)->dict_size : (size_t)0)
  |  |  ------------------
  |  |  |  Branch (1037:33): [True: 17.6k, False: 0]
  |  |  |  Branch (1037:40): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1948|  17.6k|    const size_t effective_block_size =
 1949|  17.6k|        b_dict_size > 0 ? zxc_block_size_ceil(b_dict_size + o.block_size) : o.block_size;
  ------------------
  |  Branch (1949:9): [True: 0, False: 17.6k]
  ------------------
 1950|       |
 1951|       |    // Static cctx: the setters already refuse a dictionary, another block size
 1952|       |    // and a level raise, but a source larger than the pinned block would still
 1953|       |    // force a re-carve the workspace cannot hold.
 1954|  17.6k|    if (UNLIKELY(cctx->owns_workspace && effective_block_size != cctx->last_block_size))
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1955|      0|        return ZXC_ERROR_BAD_BLOCK_SIZE;
 1956|       |
 1957|       |    // Re-init when [dict | block] outgrows the workspace (a larger one encodes
 1958|       |    // the same, so a smaller block keeps it), a level raise needs the
 1959|       |    // optimal-parser scratch, or a dictionary meets a context carved without it.
 1960|  17.6k|    if (UNLIKELY(!cctx->initialized || cctx->last_block_size < effective_block_size ||
  ------------------
  |  |  152|  52.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 17.6k, False: 0]
  |  |  |  Branch (152:42): [True: 17.6k, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1961|  17.6k|                 (o.level >= ZXC_LEVEL_DENSITY && !cctx->inner.opt_scratch) ||
 1962|  17.6k|                 (b_dict_size > 0 && !cctx->inner.dict_buffer))) {
 1963|  17.6k|        if (cctx->initialized) {
  ------------------
  |  Branch (1963:13): [True: 0, False: 17.6k]
  ------------------
 1964|       |            // LCOV_EXCL_START
 1965|      0|            zxc_cctx_free(&cctx->inner);
 1966|      0|            cctx->initialized = 0;
 1967|       |            // LCOV_EXCL_STOP
 1968|      0|        }
 1969|       |        // LCOV_EXCL_START
 1970|  17.6k|        if (UNLIKELY(zxc_cctx_init(&cctx->inner, effective_block_size, 1, o.level, o.checksum,
  ------------------
  |  |  152|  17.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
 1971|  17.6k|                                   b_dict_size) != ZXC_OK))
 1972|      0|            return ZXC_ERROR_MEMORY;
 1973|       |        // LCOV_EXCL_STOP
 1974|  17.6k|        cctx->last_block_size = effective_block_size;
 1975|  17.6k|        cctx->initialized = 1;
 1976|  17.6k|        cctx->huf_cached = 0;
 1977|  17.6k|    } else {
 1978|      0|        cctx->inner.compression_level = o.level;
 1979|      0|        cctx->inner.checksum_enabled = o.checksum;
 1980|      0|    }
 1981|       |
 1982|  17.6k|    cctx->inner.split_budget_pct = o.split_budget_pct;
 1983|  17.6k|    cctx->inner.dict_size = b_dict_size;
 1984|  17.6k|    if (UNLIKELY(zxc_ctx_sync_dict_huf(&cctx->inner, cctx->huf_cache, &cctx->huf_cached,
  ------------------
  |  |  152|  88.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 17.6k, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 17.6k]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1985|  17.6k|                                       ZXC_OPTS_DICT_HUF(opts)) != ZXC_OK))
 1986|      0|        return ZXC_ERROR_CORRUPT_DATA;  // LCOV_EXCL_LINE
 1987|       |
 1988|  17.6k|    if (b_dict && b_dict_size > 0) {
  ------------------
  |  Branch (1988:9): [True: 0, False: 17.6k]
  |  Branch (1988:19): [True: 0, False: 0]
  ------------------
 1989|       |        // [dict | block] assembled in the cctx-owned dict_buffer
 1990|      0|        uint8_t* const combined = cctx->inner.dict_buffer;
 1991|      0|        const uint64_t dict_gen = zxc_dict_copy_gen(&cctx->dict_copy, b_dict, b_dict_size);
 1992|      0|        if (cctx->inner.dict_snap) cctx->inner.dict_snap->input_gen = dict_gen;
  ------------------
  |  Branch (1992:13): [True: 0, False: 0]
  ------------------
 1993|      0|        zxc_dict_buffer_load(&cctx->inner, b_dict, b_dict_size, dict_gen);
 1994|      0|        ZXC_MEMCPY(combined + b_dict_size, src, src_size);
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1995|      0|        *chunk = combined;
 1996|  17.6k|    } else {
 1997|  17.6k|        *chunk = (const uint8_t*)src;
 1998|  17.6k|    }
 1999|  17.6k|    *chunk_sz = b_dict_size + src_size;
 2000|  17.6k|    return ZXC_OK;
 2001|  17.6k|}
zxc_dispatch.c:zxc_static_decompress_block:
 2154|  35.1k|                                           const int strict) {
 2155|  35.1k|    const size_t carved = dctx->last_block_size;
 2156|  35.1k|    const size_t work_sz = carved + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  372|  35.1k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  722|  35.1k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  35.1k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  533|  35.1k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  541|  35.1k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  535|  35.1k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  586|  35.1k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  342|  35.1k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
 2157|  35.1k|    zxc_cctx_t* const ctx = &dctx->inner;
 2158|  35.1k|    ctx->checksum_enabled = checksum_enabled;
 2159|  35.1k|    ctx->dict_size = 0;
 2160|  35.1k|    int res;
 2161|  35.1k|    if (strict) {
  ------------------
  |  Branch (2161:9): [True: 35.1k, False: 0]
  ------------------
 2162|  35.1k|        const size_t cap = dst_capacity < work_sz ? dst_capacity : work_sz;
  ------------------
  |  Branch (2162:28): [True: 27.2k, False: 7.90k]
  ------------------
 2163|  35.1k|        res = zxc_decompress_chunk_wrapper_safe_public(ctx, src, src_size, dst, cap, 0);
 2164|  35.1k|    } else if (dst_capacity >= work_sz) {
  ------------------
  |  Branch (2164:16): [True: 0, False: 0]
  ------------------
 2165|      0|        res = zxc_decompress_chunk_wrapper(ctx, src, src_size, dst, work_sz, 0);
 2166|      0|    } else {
 2167|       |        // Bounce through work_buf when dst cannot absorb wild copies.
 2168|      0|        return zxc_decode_bounce(ctx, src, src_size, dst, dst_capacity, carved);
 2169|      0|    }
 2170|  35.1k|    if (UNLIKELY(res > 0 && (size_t)res > carved)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  152|  52.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 35.1k]
  |  |  |  Branch (152:42): [True: 17.7k, False: 17.4k]
  |  |  |  Branch (152:42): [True: 0, False: 17.7k]
  |  |  ------------------
  ------------------
 2171|  35.1k|    return res;
 2172|  35.1k|}
zxc_dispatch.c:zxc_dctx_prepare:
 2179|   105k|                            const size_t dict_size, const int checksum_enabled) {
 2180|   105k|    if (LIKELY(dctx->initialized && dctx->last_block_size == block_size &&
  ------------------
  |  |  146|   372k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 72.8k, False: 32.7k]
  |  |  |  Branch (146:40): [True: 87.9k, False: 17.6k]
  |  |  |  Branch (146:40): [True: 72.8k, False: 15.0k]
  |  |  |  Branch (146:40): [True: 72.8k, False: 0]
  |  |  ------------------
  ------------------
 2181|   105k|               dctx->last_dict_size == dict_size)) {
 2182|  72.8k|        dctx->inner.checksum_enabled = checksum_enabled;
 2183|  72.8k|        return ZXC_OK;
 2184|  72.8k|    }
 2185|  32.7k|    if (dctx->initialized) {
  ------------------
  |  Branch (2185:9): [True: 15.0k, False: 17.6k]
  ------------------
 2186|  15.0k|        zxc_cctx_free(&dctx->inner);
 2187|  15.0k|        dctx->initialized = 0;
 2188|  15.0k|    }
 2189|       |    // LCOV_EXCL_START
 2190|  32.7k|    if (UNLIKELY(zxc_cctx_init(&dctx->inner, block_size, 0, 0, checksum_enabled, dict_size) !=
  ------------------
  |  |  152|  32.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 32.7k]
  |  |  ------------------
  ------------------
 2191|  32.7k|                 ZXC_OK))
 2192|      0|        return ZXC_ERROR_MEMORY;
 2193|       |    // LCOV_EXCL_STOP
 2194|  32.7k|    dctx->last_block_size = block_size;
 2195|  32.7k|    dctx->last_dict_size = dict_size;
 2196|  32.7k|    dctx->initialized = 1;
 2197|  32.7k|    dctx->huf_cached = 0;
 2198|  32.7k|    return ZXC_OK;
 2199|  32.7k|}
zxc_dispatch.c:zxc_ctx_sync_dict_huf:
 1145|  84.6k|                                 int* RESTRICT cached, const uint8_t* RESTRICT dict_huf) {
 1146|  84.6k|    if (dict_huf) {
  ------------------
  |  Branch (1146:9): [True: 0, False: 84.6k]
  ------------------
 1147|      0|        if (!*cached || memcmp(cache, dict_huf, ZXC_HUF_TABLE_SIZE) != 0) {
  ------------------
  |  |  102|      0|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
  |  Branch (1147:13): [True: 0, False: 0]
  |  Branch (1147:25): [True: 0, False: 0]
  ------------------
 1148|      0|            *cached = 0; /* a failed attach leaves inner without a tree */
 1149|      0|            if (UNLIKELY(zxc_cctx_attach_dict_huf(inner, dict_huf) != ZXC_OK))
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1150|      0|                return ZXC_ERROR_CORRUPT_DATA;
 1151|      0|            ZXC_MEMCPY(cache, dict_huf, ZXC_HUF_TABLE_SIZE);
  ------------------
  |  |  168|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1152|      0|            *cached = 1;
 1153|      0|        }
 1154|  84.6k|    } else if (*cached) {
  ------------------
  |  Branch (1154:16): [True: 0, False: 84.6k]
  ------------------
 1155|      0|        (void)zxc_cctx_attach_dict_huf(inner, NULL);
 1156|      0|        *cached = 0;
 1157|      0|    }
 1158|  84.6k|    return ZXC_OK;
 1159|  84.6k|}
zxc_dispatch.c:zxc_decode_bounce:
 2133|  5.78k|                                 const size_t dst_capacity, const size_t carved) {
 2134|       |    // Block API only: frameless blocks carry index 0.
 2135|  5.78k|    const int res =
 2136|  5.78k|        zxc_decompress_chunk_wrapper(ctx, src, src_size, ctx->work_buf, ctx->work_buf_cap, 0);
 2137|  5.78k|    if (UNLIKELY(res < 0)) return res;
  ------------------
  |  |  152|  5.78k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 2.59k, False: 3.19k]
  |  |  ------------------
  ------------------
 2138|  3.19k|    if (UNLIKELY(carved != 0 && (size_t)res > carved)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  152|  3.19k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 3.19k]
  |  |  |  Branch (152:42): [True: 0, False: 3.19k]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2139|  3.19k|    if (UNLIKELY((size_t)res > dst_capacity)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  3.19k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 42, False: 3.15k]
  |  |  ------------------
  ------------------
 2140|  3.15k|    ZXC_MEMCPY(dst, ctx->work_buf, (size_t)res);
  ------------------
  |  |  168|  3.15k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2141|  3.15k|    return res;
 2142|  3.19k|}
zxc_dispatch.c:zxc_decompress_chunk_wrapper_safe_public:
  549|  73.7k|                                                    const uint64_t block_index) {
  550|  73.7k|    return zxc_decompress_safe_variant()(ctx, src, src_sz, dst, dst_cap, block_index);
  551|  73.7k|}
zxc_dispatch.c:zxc_decompress_safe_variant:
  476|  73.7k|static ZXC_ALWAYS_INLINE zxc_decompress_func_t zxc_decompress_safe_variant(void) {
  477|  73.7k|    return zxc_decompress_chunk_wrapper_safe_default;
  478|  73.7k|}

zxc_huf_build_code_lengths_default:
  159|  17.8k|                               void* RESTRICT scratch, const int max_code_len) {
  160|  17.8k|    ZXC_MEMSET(code_len, 0, ZXC_HUF_NUM_SYMBOLS);
  ------------------
  |  |  173|  17.8k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  161|       |
  162|  17.8k|    pm_leaf_t leaves[ZXC_HUF_NUM_SYMBOLS];
  163|  17.8k|    int n = 0;
  164|  4.58M|    for (int i = 0; i < ZXC_HUF_NUM_SYMBOLS; i++) {
  ------------------
  |  |  833|  4.58M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (164:21): [True: 4.56M, False: 17.8k]
  ------------------
  165|  4.56M|        if (freq[i] > 0) {
  ------------------
  |  Branch (165:13): [True: 3.13M, False: 1.43M]
  ------------------
  166|  3.13M|            leaves[n].w = freq[i];
  167|  3.13M|            leaves[n].sym = (int16_t)i;
  168|  3.13M|            n++;
  169|  3.13M|        }
  170|  4.56M|    }
  171|  17.8k|    if (UNLIKELY(n == 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  17.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 17.8k]
  |  |  ------------------
  ------------------
  172|  17.8k|    if (n == 1) {
  ------------------
  |  Branch (172:9): [True: 7, False: 17.8k]
  ------------------
  173|      7|        code_len[leaves[0].sym] = 1;
  174|      7|        return ZXC_OK;
  175|      7|    }
  176|       |
  177|  17.8k|    pm_leaves_sort(leaves, n);
  178|       |
  179|       |    // Callers pass max_code_len >= 8, and n <= 256 <= 2^max_code_len, so the
  180|       |    // length limit is always feasible (a full 8-bit code covers all 256 symbols).
  181|  17.8k|    const int max_per_level = 2 * n;
  182|       |
  183|       |    // Working buffers: either carve from caller-provided scratch (sized for
  184|       |    // the worst-case alphabet) or fall back to per-call malloc/free.
  185|  17.8k|    pm_item_t* items;
  186|  17.8k|    int* counts;
  187|  17.8k|    frame_t* stack;
  188|  17.8k|    pm_item_t* owned_items = NULL;
  189|  17.8k|    int* owned_counts = NULL;
  190|  17.8k|    frame_t* owned_stack = NULL;
  191|  17.8k|    if (scratch) {
  ------------------
  |  Branch (191:9): [True: 17.8k, False: 0]
  ------------------
  192|  17.8k|        uint8_t* p = (uint8_t*)scratch;
  193|  17.8k|        items = (pm_item_t*)p;
  194|  17.8k|        p +=
  195|  17.8k|            (size_t)ZXC_HUF_MAX_CODE_LEN_ULTRA * (size_t)ZXC_HUF_PM_LEVEL_BOUND * sizeof(pm_item_t);
  ------------------
  |  |  826|  17.8k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
                          (size_t)ZXC_HUF_MAX_CODE_LEN_ULTRA * (size_t)ZXC_HUF_PM_LEVEL_BOUND * sizeof(pm_item_t);
  ------------------
  |  | 1082|  17.8k|#define ZXC_HUF_PM_LEVEL_BOUND (2 * ZXC_HUF_NUM_SYMBOLS)
  |  |  ------------------
  |  |  |  |  833|  17.8k|#define ZXC_HUF_NUM_SYMBOLS 256
  |  |  ------------------
  ------------------
  196|  17.8k|        p = (uint8_t*)(((uintptr_t)p + 7U) & ~(uintptr_t)7U);
  197|  17.8k|        counts = (int*)p;
  198|  17.8k|        ZXC_MEMSET(counts, 0, (size_t)ZXC_HUF_MAX_CODE_LEN_ULTRA * sizeof(int));
  ------------------
  |  |  173|  17.8k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  199|  17.8k|        p += (size_t)ZXC_HUF_MAX_CODE_LEN_ULTRA * sizeof(int);
  ------------------
  |  |  826|  17.8k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
  200|  17.8k|        p = (uint8_t*)(((uintptr_t)p + 7U) & ~(uintptr_t)7U);
  201|  17.8k|        stack = (frame_t*)p;
  202|  17.8k|    } else {
  203|      0|        owned_items = (pm_item_t*)ZXC_MALLOC((size_t)ZXC_HUF_MAX_CODE_LEN_ULTRA *
  ------------------
  |  |   68|      0|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  204|      0|                                             (size_t)max_per_level * sizeof(pm_item_t));
  205|      0|        owned_counts = (int*)ZXC_CALLOC((size_t)ZXC_HUF_MAX_CODE_LEN_ULTRA, sizeof(int));
  ------------------
  |  |   74|      0|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
  206|      0|        owned_stack = (frame_t*)ZXC_MALLOC((size_t)ZXC_HUF_MAX_CODE_LEN_ULTRA *
  ------------------
  |  |   68|      0|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  207|      0|                                           (size_t)max_per_level * sizeof(frame_t));
  208|      0|        if (UNLIKELY(!owned_items || !owned_counts || !owned_stack)) {
  ------------------
  |  |  152|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  |  Branch (152:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  209|      0|            ZXC_FREE(owned_items);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  210|      0|            ZXC_FREE(owned_counts);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  211|      0|            ZXC_FREE(owned_stack);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  212|      0|            return ZXC_ERROR_MEMORY;
  213|      0|        }
  214|      0|        items = owned_items;
  215|      0|        counts = owned_counts;
  216|      0|        stack = owned_stack;
  217|      0|    }
  218|  17.8k|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  219|       |
  220|       |    // Level 0 (logical level 1): the leaves themselves, already sorted.
  221|  3.15M|    for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (221:21): [True: 3.13M, False: 17.8k]
  ------------------
  222|  3.13M|        ITEM(0, i).weight = leaves[i].w;
  ------------------
  |  |  218|  3.13M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  223|  3.13M|        ITEM(0, i).left = -1;
  ------------------
  |  |  218|  3.13M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  224|  3.13M|        ITEM(0, i).right = -1;
  ------------------
  |  |  218|  3.13M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  225|  3.13M|        ITEM(0, i).sym = leaves[i].sym;
  ------------------
  |  |  218|  3.13M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  226|  3.13M|    }
  227|  17.8k|    counts[0] = n;
  228|       |
  229|       |    // Levels 1..max_code_len-1: merge sorted leaves with sorted packages from the previous
  230|       |    // level.
  231|   158k|    for (int k = 1; k < max_code_len; k++) {
  ------------------
  |  Branch (231:21): [True: 141k, False: 17.8k]
  ------------------
  232|   141k|        const int prev = counts[k - 1];
  233|   141k|        const int packs = prev / 2;
  234|   141k|        int li = 0;
  235|   141k|        int pi = 0;
  236|   141k|        int n_lvl = 0;
  237|  47.8M|        while (li < n || pi < packs) {
  ------------------
  |  Branch (237:16): [True: 46.2M, False: 1.65M]
  |  Branch (237:26): [True: 1.51M, False: 141k]
  ------------------
  238|  47.7M|            const uint32_t wl = (li < n) ? leaves[li].w : UINT32_MAX;
  ------------------
  |  Branch (238:33): [True: 46.2M, False: 1.51M]
  ------------------
  239|  47.7M|            const uint32_t wp =
  240|  47.7M|                (pi < packs)
  ------------------
  |  Branch (240:17): [True: 47.7M, False: 3.67k]
  ------------------
  241|  47.7M|                    ? (uint32_t)(ITEM(k - 1, 2 * pi).weight + ITEM(k - 1, 2 * pi + 1).weight)
  ------------------
  |  |  218|  47.7M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
                                  ? (uint32_t)(ITEM(k - 1, 2 * pi).weight + ITEM(k - 1, 2 * pi + 1).weight)
  ------------------
  |  |  218|  47.7M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  242|  47.7M|                    : UINT32_MAX;
  243|  47.7M|            if (wl <= wp && li < n) {
  ------------------
  |  Branch (243:17): [True: 25.4M, False: 22.2M]
  |  Branch (243:29): [True: 25.4M, False: 0]
  ------------------
  244|  25.4M|                ITEM(k, n_lvl).weight = wl;
  ------------------
  |  |  218|  25.4M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  245|  25.4M|                ITEM(k, n_lvl).left = -1;
  ------------------
  |  |  218|  25.4M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  246|  25.4M|                ITEM(k, n_lvl).right = -1;
  ------------------
  |  |  218|  25.4M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  247|  25.4M|                ITEM(k, n_lvl).sym = leaves[li].sym;
  ------------------
  |  |  218|  25.4M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  248|  25.4M|                li++;
  249|  25.4M|            } else {
  250|  22.2M|                ITEM(k, n_lvl).weight = wp;
  ------------------
  |  |  218|  22.2M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  251|  22.2M|                ITEM(k, n_lvl).left = (int16_t)(2 * pi);
  ------------------
  |  |  218|  22.2M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  252|  22.2M|                ITEM(k, n_lvl).right = (int16_t)(2 * pi + 1);
  ------------------
  |  |  218|  22.2M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  253|  22.2M|                ITEM(k, n_lvl).sym = -1;
  ------------------
  |  |  218|  22.2M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  254|  22.2M|                pi++;
  255|  22.2M|            }
  256|  47.7M|            n_lvl++;
  257|  47.7M|        }
  258|   141k|        counts[k] = n_lvl;
  259|   141k|    }
  260|       |
  261|       |    // Step 3: take first 2n-2 items at level max_code_len-1; trace back, counting leaf
  262|       |    // appearances.
  263|  17.8k|    int n_take = 2 * n - 2;
  264|  17.8k|    if (n_take > counts[max_code_len - 1]) n_take = counts[max_code_len - 1];
  ------------------
  |  Branch (264:9): [True: 0, False: 17.8k]
  ------------------
  265|       |
  266|       |    // Worst case stack depth: (max_code_len * n_take) frames; bounded by
  267|       |    // max_code_len * 2n <= ZXC_HUF_MAX_CODE_LEN_ULTRA * 2n. `stack` was set up earlier from
  268|       |    // scratch (or the local malloc fallback), sized for the ceiling.
  269|  17.8k|    int sp = 0;
  270|  6.24M|    for (int i = 0; i < n_take; i++) {
  ------------------
  |  Branch (270:21): [True: 6.23M, False: 17.8k]
  ------------------
  271|  6.23M|        stack[sp].lvl = (int8_t)(max_code_len - 1);
  272|  6.23M|        stack[sp].idx = (int16_t)i;
  273|  6.23M|        sp++;
  274|  6.23M|    }
  275|  44.4M|    while (sp > 0) {
  ------------------
  |  Branch (275:12): [True: 44.4M, False: 17.8k]
  ------------------
  276|  44.4M|        frame_t f = stack[--sp];
  277|  44.4M|        const pm_item_t* it = &ITEM(f.lvl, f.idx);
  ------------------
  |  |  218|  44.4M|#define ITEM(k, i) items[(size_t)(k) * (size_t)max_per_level + (size_t)(i)]
  ------------------
  278|  44.4M|        if (it->sym >= 0) {
  ------------------
  |  Branch (278:13): [True: 25.3M, False: 19.1M]
  ------------------
  279|  25.3M|            code_len[it->sym]++;
  280|  25.3M|        } else {
  281|  19.1M|            stack[sp].lvl = (int8_t)(f.lvl - 1);
  282|  19.1M|            stack[sp].idx = it->left;
  283|  19.1M|            sp++;
  284|  19.1M|            stack[sp].lvl = (int8_t)(f.lvl - 1);
  285|  19.1M|            stack[sp].idx = it->right;
  286|  19.1M|            sp++;
  287|  19.1M|        }
  288|  44.4M|    }
  289|       |
  290|  17.8k|    if (owned_items) {
  ------------------
  |  Branch (290:9): [True: 0, False: 17.8k]
  ------------------
  291|      0|        ZXC_FREE(owned_items);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  292|      0|        ZXC_FREE(owned_counts);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  293|      0|        ZXC_FREE(owned_stack);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  294|      0|    }
  295|  17.8k|#undef ITEM
  296|  17.8k|    return ZXC_OK;
  297|  17.8k|}
zxc_huf_nudge_code_lengths:
  787|  5.71k|                               const int max_code_len) {
  788|  5.71k|    enum { LU = ZXC_HUF_MAX_CODE_LEN_ULTRA };
  789|  5.71k|    uint32_t blc0[LU + 1];
  790|  5.71k|    const int n = zxc_huf_nudge_classes(code_len, blc0);
  791|       |    // Degenerate alphabets have no shape freedom (and n == 1 is format-pinned
  792|       |    // to code length exactly 1): leave them untouched.
  793|  5.71k|    if (n < 4) return 0;
  ------------------
  |  Branch (793:9): [True: 4, False: 5.71k]
  ------------------
  794|       |
  795|       |    // Tables and DP planes live past the rebuilds' region of the scratch when it
  796|       |    // has the room (opt_scratch does), else in one allocation: no 10 KiB frame.
  797|  5.71k|    const int owned = !scratch || scratch_cap < ZXC_HUF_NUDGE_SCRATCH_SIZE;
  ------------------
  |  | 1119|  5.71k|#define ZXC_HUF_NUDGE_SCRATCH_SIZE (ZXC_HUF_NUDGE_SCRATCH_OFF + sizeof(zxc_huf_nudge_ws_t))
  |  |  ------------------
  |  |  |  | 1117|  5.71k|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  384|  5.71k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  382|  5.71k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  380|  5.71k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  382|  5.71k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  380|  5.71k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (797:23): [True: 0, False: 5.71k]
  |  Branch (797:35): [True: 0, False: 5.71k]
  ------------------
  798|  5.71k|    zxc_huf_nudge_ws_t* const ws =
  799|  5.71k|        owned ? (zxc_huf_nudge_ws_t*)ZXC_MALLOC(sizeof(*ws))
  ------------------
  |  |   68|      0|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  |  Branch (799:9): [True: 0, False: 5.71k]
  ------------------
  800|  5.71k|              : (zxc_huf_nudge_ws_t*)((uint8_t*)scratch + ZXC_HUF_NUDGE_SCRATCH_OFF);
  ------------------
  |  | 1117|  5.71k|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  ------------------
  |  |  |  |  384|  5.71k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  5.71k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|  5.71k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  382|  5.71k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  380|  5.71k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  801|  5.71k|    if (UNLIKELY(!ws)) return 0;
  ------------------
  |  |  152|  5.71k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.71k]
  |  |  ------------------
  ------------------
  802|       |
  803|       |    // Baseline cost, exact (canonical-order frequency weighting).
  804|  5.71k|    uint64_t* const pf = ws->pf;
  805|  5.71k|    zxc_huf_nudge_pf_canonical(code_len, freq, blc0, pf);
  806|  5.71k|    zxc_huf_nudge_cost_t c0;
  807|  5.71k|    zxc_huf_nudge_eval(blc0, pf, &c0);
  808|       |
  809|       |    // Frequency-rank order shared by every candidate (rank 0 = most frequent;
  810|       |    // pm_leaves_sort is ascending, ties on symbol, so read it backwards).
  811|  5.71k|    pm_leaf_t* const leaves = ws->leaves;
  812|  5.71k|    int k = 0;
  813|  1.46M|    for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++) {
  ------------------
  |  |  833|  1.46M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (813:21): [True: 1.46M, False: 5.71k]
  ------------------
  814|  1.46M|        if (!freq[s]) continue;
  ------------------
  |  Branch (814:13): [True: 491k, False: 970k]
  ------------------
  815|   970k|        leaves[k].w = freq[s];
  816|   970k|        leaves[k].sym = (int16_t)s;
  817|   970k|        k++;
  818|   970k|    }
  819|  5.71k|    pm_leaves_sort(leaves, n);
  820|  5.71k|    int16_t* const sym_order = ws->sym_order;
  821|  5.71k|    uint64_t* const pf_rank = ws->pf_rank;
  822|  5.71k|    pf_rank[0] = 0;
  823|   976k|    for (int r = 0; r < n; r++) {
  ------------------
  |  Branch (823:21): [True: 970k, False: 5.71k]
  ------------------
  824|   970k|        sym_order[r] = leaves[n - 1 - r].sym;
  825|   970k|        pf_rank[r + 1] = pf_rank[r] + leaves[n - 1 - r].w;
  826|   970k|    }
  827|       |
  828|       |    // Candidates: the greedy ledger walk, package-merge rebuilt at reduced caps
  829|       |    // (the pass loop runs max_depth + 1 times, so depth cuts attack the decoder's
  830|       |    // biggest fixed cost), and the slot-ledger DP below. All Kraft-exact.
  831|  5.71k|    uint8_t (*const cand)[ZXC_HUF_NUM_SYMBOLS] = ws->cand;
  832|  5.71k|    int n_cand = 0;
  833|  5.71k|    {
  834|  5.71k|        uint32_t blc_w[LU + 1];
  835|  5.71k|        zxc_huf_nudge_walk(blc0, pf_rank, n, max_code_len, blc_w);
  836|  5.71k|        zxc_huf_nudge_assign(blc_w, sym_order, cand[n_cand]);
  837|  5.71k|        n_cand++;
  838|  5.71k|    }
  839|  5.71k|    int max_len0 = 0;
  840|  15.5k|    for (int l = LU; l >= 1; l--) {
  ------------------
  |  Branch (840:22): [True: 15.5k, False: 0]
  ------------------
  841|  15.5k|        if (blc0[l]) {
  ------------------
  |  Branch (841:13): [True: 5.71k, False: 9.83k]
  ------------------
  842|  5.71k|            max_len0 = l;
  843|  5.71k|            break;
  844|  5.71k|        }
  845|  15.5k|    }
  846|  5.71k|    if (max_len0 >= 2) {
  ------------------
  |  Branch (846:9): [True: 5.71k, False: 0]
  ------------------
  847|  15.0k|        for (int cut = 1; cut <= 2; cut++) {
  ------------------
  |  Branch (847:27): [True: 11.0k, False: 4.00k]
  ------------------
  848|  11.0k|            const int cap2 = max_len0 - cut;
  849|  11.0k|            if (cap2 < 2 || ((uint32_t)1 << cap2) < (uint32_t)n) break;
  ------------------
  |  Branch (849:17): [True: 3, False: 11.0k]
  |  Branch (849:29): [True: 1.70k, False: 9.34k]
  ------------------
  850|  9.34k|            if (zxc_huf_build_code_lengths(freq, cand[n_cand], scratch, cap2) != ZXC_OK) break;
  ------------------
  |  |   42|  9.34k|#define zxc_huf_build_code_lengths ZXC_CAT(zxc_huf_build_code_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   41|  9.34k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  9.34k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (850:17): [True: 0, False: 9.34k]
  ------------------
  851|  9.34k|            n_cand++;
  852|  9.34k|        }
  853|  5.71k|    }
  854|       |
  855|       |    // Slot-ledger DP: optimal class counts under the rank-weighted model, over
  856|       |    // groups of 2^G frequency-adjacent symbols (G = 0 is exact; coarser tiers
  857|       |    // keep the plane cache-resident, bounding the call to a few hundred us).
  858|       |    // When G does not divide n the lightest group is padded with zero-freq
  859|       |    // ghost leaves on unused byte values - wire-legal, empty runs, and the
  860|       |    // evaluator prices the burnt code space like anything else.
  861|  5.71k|    {
  862|  5.71k|        int g_log2 = 0; /* coarsen until the groups fit the DP plane */
  863|  14.0k|        while (((n + (1 << g_log2) - 1) >> g_log2) > ZXC_HUF_NUDGE_DP_M) g_log2++;
  ------------------
  |  | 1097|  14.0k|#define ZXC_HUF_NUDGE_DP_M 64
  ------------------
  |  Branch (863:16): [True: 8.34k, False: 5.71k]
  ------------------
  864|  5.71k|        const int g = 1 << g_log2;
  865|  5.71k|        const int m = (n + g - 1) / g;
  866|  5.71k|        const int cap_c = max_code_len - g_log2;
  867|  5.71k|        if (m >= 2 && cap_c >= 1 && m <= (1 << cap_c)) {
  ------------------
  |  Branch (867:13): [True: 5.71k, False: 0]
  |  Branch (867:23): [True: 5.71k, False: 0]
  |  Branch (867:37): [True: 5.71k, False: 0]
  ------------------
  868|  5.71k|            uint64_t* const pfg = ws->pfg;
  869|   310k|            for (int j2 = 0; j2 <= m; j2++) {
  ------------------
  |  Branch (869:30): [True: 305k, False: 5.71k]
  ------------------
  870|   305k|                int r = j2 * g;
  871|   305k|                if (r > n) r = n;
  ------------------
  |  Branch (871:21): [True: 2.07k, False: 303k]
  ------------------
  872|   305k|                pfg[j2] = pf_rank[r];
  873|   305k|            }
  874|  5.71k|            uint32_t cblc[LU + 1];
  875|  5.71k|            if (zxc_huf_nudge_dp_solve(ws, pfg, m, cap_c, LU - g_log2, g_log2, cblc)) {
  ------------------
  |  Branch (875:17): [True: 5.71k, False: 0]
  ------------------
  876|  5.71k|                uint8_t* const cl = cand[n_cand];
  877|  5.71k|                ZXC_MEMSET(cl, 0, ZXC_HUF_NUM_SYMBOLS);
  ------------------
  |  |  173|  5.71k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  878|  5.71k|                int r = 0;
  879|  5.71k|                int ghosts = 0;
  880|  5.71k|                uint8_t ghost_len = 0;
  881|  58.4k|                for (int lc = 1; lc <= cap_c; lc++) {
  ------------------
  |  Branch (881:34): [True: 52.7k, False: 5.71k]
  ------------------
  882|   352k|                    for (uint32_t q = 0; q < cblc[lc]; q++) {
  ------------------
  |  Branch (882:42): [True: 299k, False: 52.7k]
  ------------------
  883|  1.27M|                        for (int e = 0; e < g; e++, r++) {
  ------------------
  |  Branch (883:41): [True: 973k, False: 299k]
  ------------------
  884|   973k|                            if (r < n) {
  ------------------
  |  Branch (884:33): [True: 970k, False: 3.46k]
  ------------------
  885|   970k|                                cl[sym_order[r]] = (uint8_t)(lc + g_log2);
  886|   970k|                            } else {
  887|  3.46k|                                ghost_len = (uint8_t)(lc + g_log2);
  888|  3.46k|                                ghosts++;
  889|  3.46k|                            }
  890|   973k|                        }
  891|   299k|                    }
  892|  52.7k|                }
  893|   119k|                for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS && ghosts; s++) {
  ------------------
  |  |  833|   239k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (893:33): [True: 119k, False: 3]
  |  Branch (893:60): [True: 114k, False: 5.70k]
  ------------------
  894|   114k|                    if (freq[s] == 0 && cl[s] == 0) {
  ------------------
  |  Branch (894:25): [True: 3.46k, False: 110k]
  |  Branch (894:41): [True: 3.46k, False: 0]
  ------------------
  895|  3.46k|                        cl[s] = ghost_len;
  896|  3.46k|                        ghosts--;
  897|  3.46k|                    }
  898|   114k|                }
  899|  5.71k|                n_cand++;
  900|  5.71k|            }
  901|  5.71k|        }
  902|  5.71k|    }
  903|       |
  904|       |    // Adopt the cheapest candidate clearing both guard rails and strictly
  905|       |    // beating the baseline J; otherwise leave code_len byte-for-byte alone, so a
  906|       |    // rejection never depends on package-merge tie assignment.
  907|  5.71k|    const uint64_t j0 = zxc_huf_nudge_j(&c0);
  908|  5.71k|    uint64_t best_j = j0;
  909|  5.71k|    int best = -1;
  910|  26.4k|    for (int ci = 0; ci < n_cand; ci++) {
  ------------------
  |  Branch (910:22): [True: 20.7k, False: 5.71k]
  ------------------
  911|       |        // Every live symbol must keep a code; ghost-padded candidates carry
  912|       |        // MORE nonzero lengths than n, which is fine.
  913|  20.7k|        int valid = 1;
  914|  5.33M|        for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++) {
  ------------------
  |  |  833|  5.33M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (914:25): [True: 5.31M, False: 20.7k]
  ------------------
  915|  5.31M|            if (freq[s] != 0 && cand[ci][s] == 0) {
  ------------------
  |  Branch (915:17): [True: 3.48M, False: 1.83M]
  |  Branch (915:33): [True: 0, False: 3.48M]
  ------------------
  916|      0|                valid = 0;
  917|      0|                break;
  918|      0|            }
  919|  5.31M|        }
  920|  20.7k|        if (!valid) continue;
  ------------------
  |  Branch (920:13): [True: 0, False: 20.7k]
  ------------------
  921|  20.7k|        uint32_t blc[LU + 1];
  922|  20.7k|        (void)zxc_huf_nudge_classes(cand[ci], blc);
  923|  20.7k|        zxc_huf_nudge_pf_canonical(cand[ci], freq, blc, pf);
  924|  20.7k|        zxc_huf_nudge_cost_t c1;
  925|  20.7k|        zxc_huf_nudge_eval(blc, pf, &c1);
  926|  20.7k|        if (c1.bits * 1000 > c0.bits * ZXC_HUF_NUDGE_BITS_PERMIL) continue;
  ------------------
  |  |  916|  20.7k|#define ZXC_HUF_NUDGE_BITS_PERMIL 1015
  ------------------
  |  Branch (926:13): [True: 5.79k, False: 14.9k]
  ------------------
  927|  14.9k|        if (c1.touches * 256 > c0.touches * ZXC_HUF_NUDGE_MERGE_Q8) continue;
  ------------------
  |  |  919|  14.9k|#define ZXC_HUF_NUDGE_MERGE_Q8 230
  ------------------
  |  Branch (927:13): [True: 9.16k, False: 5.81k]
  ------------------
  928|  5.81k|        const uint64_t j = zxc_huf_nudge_j(&c1);
  929|  5.81k|        if (j < best_j) {
  ------------------
  |  Branch (929:13): [True: 5.21k, False: 601]
  ------------------
  930|  5.21k|            best_j = j;
  931|  5.21k|            best = ci;
  932|  5.21k|        }
  933|  5.81k|    }
  934|  5.71k|    if (best >= 0) ZXC_MEMCPY(code_len, cand[best], ZXC_HUF_NUM_SYMBOLS);
  ------------------
  |  |  168|  3.89k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  |  Branch (934:9): [True: 3.89k, False: 1.81k]
  ------------------
  935|  5.71k|    if (owned) ZXC_FREE(ws);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  |  Branch (935:9): [True: 0, False: 5.71k]
  ------------------
  936|  5.71k|    return best >= 0;
  937|  5.71k|}
zxc_huf_pack_lengths_default:
  946|  3.63k|void zxc_huf_pack_lengths(const uint8_t* RESTRICT code_len, uint8_t* RESTRICT out) {
  947|   469k|    for (int i = 0; i < ZXC_HUF_NUM_SYMBOLS; i += 2) {
  ------------------
  |  |  833|   469k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (947:21): [True: 465k, False: 3.63k]
  ------------------
  948|   465k|        const uint8_t lo = code_len[i] & 0x0F;
  949|   465k|        const uint8_t hi = code_len[i + 1] & 0x0F;
  950|   465k|        out[i >> 1] = (uint8_t)(lo | (hi << 4));
  951|   465k|    }
  952|  3.63k|}
zxc_huf_unpack_lengths_default:
  956|  20.6k|int zxc_huf_unpack_lengths(const uint8_t* RESTRICT in, uint8_t* RESTRICT code_len) {
  957|  20.6k|    int max_len = 0;
  958|  20.6k|    int n_present = 0;
  959|  2.66M|    for (int i = 0; i < ZXC_HUF_NUM_SYMBOLS; i += 2) {
  ------------------
  |  |  833|  2.66M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (959:21): [True: 2.64M, False: 20.6k]
  ------------------
  960|  2.64M|        const uint8_t b = in[i >> 1];
  961|  2.64M|        const uint8_t lo = b & 0x0F;
  962|  2.64M|        const uint8_t hi = (uint8_t)(b >> 4);
  963|  2.64M|        code_len[i] = lo;
  964|  2.64M|        code_len[i + 1] = hi;
  965|  2.64M|        if (lo > max_len) max_len = lo;
  ------------------
  |  Branch (965:13): [True: 40.5k, False: 2.60M]
  ------------------
  966|  2.64M|        if (hi > max_len) max_len = hi;
  ------------------
  |  Branch (966:13): [True: 34.4k, False: 2.61M]
  ------------------
  967|  2.64M|        if (lo) n_present++;
  ------------------
  |  Branch (967:13): [True: 1.33M, False: 1.31M]
  ------------------
  968|  2.64M|        if (hi) n_present++;
  ------------------
  |  Branch (968:13): [True: 1.36M, False: 1.28M]
  ------------------
  969|  2.64M|    }
  970|  20.6k|    if (UNLIKELY(max_len > ZXC_HUF_MAX_CODE_LEN_ULTRA || n_present == 0))
  ------------------
  |  |  152|  41.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 131, False: 20.5k]
  |  |  |  Branch (152:42): [True: 131, False: 20.5k]
  |  |  |  Branch (152:42): [True: 0, False: 20.5k]
  |  |  ------------------
  ------------------
  971|    131|        return ZXC_ERROR_CORRUPT_DATA;
  972|  20.5k|    return ZXC_OK;
  973|  20.6k|}
zxc_huf_calc_size_default:
 1208|  5.71k|                         const int with_header) {
 1209|  5.71k|    zxc_pivco_tree_t t;
 1210|  5.71k|    if (UNLIKELY(zxc_pivco_tree_build(code_len, &t) != 0)) return SIZE_MAX;
  ------------------
  |  |  152|  5.71k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.71k]
  |  |  ------------------
  ------------------
 1211|  5.71k|    const size_t body = zxc_huf_calc_size_dict(freq, code_len, &t);
  ------------------
  |  |   46|  5.71k|#define zxc_huf_calc_size_dict ZXC_CAT(zxc_huf_calc_size_dict, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   41|  5.71k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  5.71k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|  5.71k|    if (UNLIKELY(body == SIZE_MAX)) return SIZE_MAX;
  ------------------
  |  |  152|  5.71k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.71k]
  |  |  ------------------
  ------------------
 1213|  5.71k|    return body + (with_header ? (size_t)ZXC_HUF_TABLE_SIZE : 0);
  ------------------
  |  |  102|  5.71k|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
  |  Branch (1213:20): [True: 5.71k, False: 0]
  ------------------
 1214|  5.71k|}
zxc_huf_calc_size_dict_default:
 1222|  5.71k|                              const zxc_pivco_tree_t* RESTRICT tree) {
 1223|       |    // Encodability is part of the estimate: a histogram symbol the table has no
 1224|       |    // code for would be silently ignored below and undercount. Report the
 1225|       |    // candidate unencodable instead.
 1226|  1.46M|    for (int k = 0; k < ZXC_HUF_NUM_SYMBOLS; k++)
  ------------------
  |  |  833|  1.46M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1226:21): [True: 1.46M, False: 5.71k]
  ------------------
 1227|  1.46M|        if (UNLIKELY(freq[k] != 0 && code_len[k] == 0)) return SIZE_MAX;
  ------------------
  |  |  152|  2.43M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 1.46M]
  |  |  |  Branch (152:42): [True: 970k, False: 492k]
  |  |  |  Branch (152:42): [True: 0, False: 970k]
  |  |  ------------------
  ------------------
 1228|  5.71k|    uint32_t count[ZXC_PIVCO_NODE_SLOTS];
 1229|  5.71k|    zxc_pivco_counts(tree, freq, count);
 1230|       |    return zxc_pivco_layout(tree, count, NULL);
 1231|  5.71k|}
zxc_huf_encode_section_default:
 1315|  3.63k|                           uint8_t* RESTRICT dst, const size_t dst_cap) {
 1316|  3.63k|    zxc_pivco_tree_t t;
 1317|  3.63k|    uint32_t codes[ZXC_HUF_NUM_SYMBOLS];
 1318|  3.63k|    if (UNLIKELY(zxc_pivco_tree_build(code_len, &t) != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  3.63k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 3.63k]
  |  |  ------------------
  ------------------
 1319|  3.63k|    zxc_pivco_codes(&t, codes);
 1320|  3.63k|    return zxc_pivco_encode_core(literals, n_literals, freq, code_len, &t, codes, dst, dst_cap, 1);
 1321|  3.63k|}
zxc_huf_decode_section_default:
 2310|  20.7k|                           uint8_t* RESTRICT dst, const size_t n, uint8_t* RESTRICT scratch) {
 2311|  20.7k|    if (UNLIKELY(payload_size < (size_t)ZXC_HUF_TABLE_SIZE)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  20.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 82, False: 20.6k]
  |  |  ------------------
  ------------------
 2312|  20.6k|    uint8_t code_len[ZXC_HUF_NUM_SYMBOLS];
 2313|  20.6k|    const int rc = zxc_huf_unpack_lengths(payload, code_len);
  ------------------
  |  |   44|  20.6k|#define zxc_huf_unpack_lengths ZXC_CAT(zxc_huf_unpack_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   41|  20.6k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  20.6k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2314|  20.6k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  152|  20.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 131, False: 20.5k]
  |  |  ------------------
  ------------------
 2315|  20.5k|    zxc_pivco_tree_t t;
 2316|  20.5k|    if (UNLIKELY(zxc_pivco_tree_build(code_len, &t) != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  20.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 40, False: 20.4k]
  |  |  ------------------
  ------------------
 2317|  20.4k|    return zxc_pivco_decode_core(payload + ZXC_HUF_TABLE_SIZE, payload_size - ZXC_HUF_TABLE_SIZE,
  ------------------
  |  |  102|  20.4k|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
                  return zxc_pivco_decode_core(payload + ZXC_HUF_TABLE_SIZE, payload_size - ZXC_HUF_TABLE_SIZE,
  ------------------
  |  |  102|  20.4k|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
 2318|  20.4k|                                 dst, n, &t, scratch);
 2319|  20.5k|}
zxc_huffman.c:pm_leaves_sort:
  103|  23.5k|static void pm_leaves_sort(pm_leaf_t* RESTRICT leaves, const int n) {
  104|       |    // One bucket per possible value of floor(log2(weight)) for a 32-bit
  105|       |    // weight, i.e. 32 buckets.
  106|  23.5k|    enum { NUM_BUCKETS = 32 };
  107|  23.5k|    int count[NUM_BUCKETS];
  108|  23.5k|    int offset[NUM_BUCKETS + 1]; /* +1 sentinel = n, avoids end-of-bucket branch. */
  109|  23.5k|    uint8_t bucket_of[ZXC_HUF_NUM_SYMBOLS];
  110|  23.5k|    pm_leaf_t tmp[ZXC_HUF_NUM_SYMBOLS];
  111|       |
  112|  23.5k|    ZXC_MEMSET(count, 0, sizeof(count));
  ------------------
  |  |  173|  23.5k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  113|  4.12M|    for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (113:21): [True: 4.10M, False: 23.5k]
  ------------------
  114|  4.10M|        const unsigned b = zxc_log2_u32(leaves[i].w);
  115|  4.10M|        bucket_of[i] = (uint8_t)b;
  116|  4.10M|        count[b]++;
  117|  4.10M|    }
  118|       |
  119|  23.5k|    int acc = 0;
  120|   777k|    for (int b = 0; b < NUM_BUCKETS; b++) {
  ------------------
  |  Branch (120:21): [True: 753k, False: 23.5k]
  ------------------
  121|   753k|        offset[b] = acc;
  122|   753k|        acc += count[b];
  123|   753k|    }
  124|  23.5k|    offset[NUM_BUCKETS] = n;
  125|       |
  126|  23.5k|    int pos[NUM_BUCKETS];
  127|  23.5k|    ZXC_MEMCPY(pos, offset, sizeof(pos));
  ------------------
  |  |  168|  23.5k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  128|  4.12M|    for (int i = 0; i < n; i++) {
  ------------------
  |  Branch (128:21): [True: 4.10M, False: 23.5k]
  ------------------
  129|  4.10M|        tmp[pos[bucket_of[i]]++] = leaves[i];
  130|  4.10M|    }
  131|       |
  132|   777k|    for (int b = 0; b < NUM_BUCKETS; b++) {
  ------------------
  |  Branch (132:21): [True: 753k, False: 23.5k]
  ------------------
  133|   753k|        if (count[b] < 2) continue;
  ------------------
  |  Branch (133:13): [True: 626k, False: 127k]
  ------------------
  134|   127k|        const int s = offset[b];
  135|   127k|        const int e = offset[b + 1];
  136|  4.06M|        for (int i = s + 1; i < e; i++) {
  ------------------
  |  Branch (136:29): [True: 3.94M, False: 127k]
  ------------------
  137|  3.94M|            const pm_leaf_t key = tmp[i];
  138|  3.94M|            int j = i - 1;
  139|  73.8M|            while (j >= s && (tmp[j].w > key.w || (tmp[j].w == key.w && tmp[j].sym > key.sym))) {
  ------------------
  |  Branch (139:20): [True: 73.7M, False: 145k]
  |  Branch (139:31): [True: 69.9M, False: 3.79M]
  |  Branch (139:52): [True: 3.35M, False: 440k]
  |  Branch (139:73): [True: 0, False: 3.35M]
  ------------------
  140|  69.9M|                tmp[j + 1] = tmp[j];
  141|  69.9M|                j--;
  142|  69.9M|            }
  143|  3.94M|            tmp[j + 1] = key;
  144|  3.94M|        }
  145|   127k|    }
  146|       |
  147|  23.5k|    ZXC_MEMCPY(leaves, tmp, (size_t)n * sizeof(pm_leaf_t));
  ------------------
  |  |  168|  23.5k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  148|  23.5k|}
zxc_huffman.c:zxc_huf_nudge_classes:
  339|  26.4k|static int zxc_huf_nudge_classes(const uint8_t* RESTRICT code_len, uint32_t* RESTRICT blc) {
  340|  26.4k|    ZXC_MEMSET(blc, 0, (ZXC_HUF_MAX_CODE_LEN_ULTRA + 1) * sizeof(uint32_t));
  ------------------
  |  |  173|  26.4k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  341|  26.4k|    int n = 0;
  342|  6.80M|    for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++) {
  ------------------
  |  |  833|  6.80M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (342:21): [True: 6.77M, False: 26.4k]
  ------------------
  343|  6.77M|        const int l = code_len[s];
  344|  6.77M|        if (!l) continue;
  ------------------
  |  Branch (344:13): [True: 2.32M, False: 4.45M]
  ------------------
  345|  4.45M|        blc[l]++;
  346|  4.45M|        n++;
  347|  4.45M|    }
  348|  26.4k|    return n;
  349|  26.4k|}
zxc_huffman.c:zxc_huf_nudge_pf_canonical:
  362|  26.4k|                                       uint64_t* RESTRICT pf) {
  363|  26.4k|    uint32_t pos[ZXC_HUF_MAX_CODE_LEN_ULTRA + 1];
  364|  26.4k|    uint32_t acc = 0;
  365|   317k|    for (int l = 1; l <= ZXC_HUF_MAX_CODE_LEN_ULTRA; l++) {
  ------------------
  |  |  826|   317k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
  |  Branch (365:21): [True: 291k, False: 26.4k]
  ------------------
  366|   291k|        pos[l] = acc;
  367|   291k|        acc += blc[l];
  368|   291k|    }
  369|  26.4k|    uint32_t val[ZXC_HUF_NUM_SYMBOLS];
  370|  6.80M|    for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++) {
  ------------------
  |  |  833|  6.80M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (370:21): [True: 6.77M, False: 26.4k]
  ------------------
  371|  6.77M|        const int l = code_len[s];
  372|  6.77M|        if (l) val[pos[l]++] = freq[s];
  ------------------
  |  Branch (372:13): [True: 4.45M, False: 2.32M]
  ------------------
  373|  6.77M|    }
  374|  26.4k|    pf[0] = 0;
  375|  4.48M|    for (uint32_t i = 0; i < acc; i++) pf[i + 1] = pf[i] + val[i];
  ------------------
  |  Branch (375:26): [True: 4.45M, False: 26.4k]
  ------------------
  376|  26.4k|}
zxc_huffman.c:zxc_huf_nudge_eval:
  397|   168k|                               zxc_huf_nudge_cost_t* RESTRICT out) {
  398|   168k|    enum { LU = ZXC_HUF_MAX_CODE_LEN_ULTRA };
  399|   168k|    uint64_t bits = 0;
  400|   168k|    uint64_t touches = 0;
  401|   168k|    int max_len = 0;
  402|   168k|    uint32_t S = 0;    /* code-space cursor, in 2^-LU slots */
  403|   168k|    uint32_t base = 0; /* leaf index where the current run starts */
  404|  2.02M|    for (int l = 1; l <= LU; l++) {
  ------------------
  |  Branch (404:21): [True: 1.85M, False: 168k]
  ------------------
  405|  1.85M|        if (!blc[l]) continue;
  ------------------
  |  Branch (405:13): [True: 833k, False: 1.02M]
  ------------------
  406|  1.02M|        max_len = l;
  407|  1.02M|        bits += (uint64_t)l * (pf[base + blc[l]] - pf[base]);
  408|  1.02M|        const uint32_t w = 1U << (LU - l);
  409|  1.02M|        const uint32_t end = S + blc[l] * w;
  410|  1.02M|        uint32_t x = S;
  411|  3.48M|        while (x < end) {
  ------------------
  |  Branch (411:16): [True: 2.46M, False: 1.02M]
  ------------------
  412|  2.46M|            const uint32_t wx = x ? (x & (0U - x)) : (1U << LU);
  ------------------
  |  Branch (412:33): [True: 2.29M, False: 168k]
  ------------------
  413|  2.46M|            const uint32_t wr = 1U << zxc_log2_u32(end - x);
  414|  2.46M|            const uint32_t W = wx < wr ? wx : wr;
  ------------------
  |  Branch (414:32): [True: 747k, False: 1.71M]
  ------------------
  415|  2.46M|            const int D = (int)zxc_log2_u32(W) - (LU - l);
  416|  2.46M|            const uint32_t i0 = base + ((x - S) >> (LU - l));
  417|  2.46M|            const uint64_t mass = pf[i0 + (W >> (LU - l))] - pf[i0];
  418|  2.46M|            int t;
  419|  2.46M|            if (D == 0) {
  ------------------
  |  Branch (419:17): [True: 425k, False: 2.04M]
  ------------------
  420|   425k|                t = l + 1; /* lone leaf: one memset + merges above */
  421|  2.04M|            } else if (D == 1) {
  ------------------
  |  Branch (421:24): [True: 587k, False: 1.45M]
  ------------------
  422|   587k|                t = l; /* leaf pair: parent XOR-blend at depth l-1 */
  423|  1.45M|            } else {
  424|  1.45M|                t = (l - D) + 1; /* flat root: one unpack + merges above */
  425|  1.45M|                if (D > ZXC_PIVCO_UNPACK_FLAT_SIMD_MAX) t += ZXC_HUF_NUDGE_DEEP_FLAT_PENALTY;
  ------------------
  |  |  847|  1.45M|#define ZXC_PIVCO_UNPACK_FLAT_SIMD_MAX 6
  ------------------
                              if (D > ZXC_PIVCO_UNPACK_FLAT_SIMD_MAX) t += ZXC_HUF_NUDGE_DEEP_FLAT_PENALTY;
  ------------------
  |  |  924|  28.2k|#define ZXC_HUF_NUDGE_DEEP_FLAT_PENALTY 24
  ------------------
  |  Branch (425:21): [True: 28.2k, False: 1.42M]
  ------------------
  426|  1.45M|            }
  427|  2.46M|            touches += mass * (uint64_t)t;
  428|  2.46M|            x += W;
  429|  2.46M|        }
  430|  1.02M|        S = end;
  431|  1.02M|        base += blc[l];
  432|  1.02M|    }
  433|   168k|    touches += (uint64_t)ZXC_HUF_NUDGE_LEVEL_COST * (uint64_t)(max_len + 1);
  ------------------
  |  |  928|   168k|#define ZXC_HUF_NUDGE_LEVEL_COST 64
  ------------------
  434|   168k|    out->bits = bits;
  435|   168k|    out->touches = touches;
  436|   168k|}
zxc_huffman.c:zxc_huf_nudge_walk:
  521|  5.71k|                               const int n, const int cap, uint32_t* RESTRICT out_blc) {
  522|  5.71k|    enum { LU = ZXC_HUF_MAX_CODE_LEN_ULTRA };
  523|  5.71k|    ZXC_MEMSET(out_blc, 0, (LU + 1) * sizeof(uint32_t));
  ------------------
  |  |  173|  5.71k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  524|  5.71k|    uint32_t s = 2; /* the root's two slots at level 1 (n >= 4 => root is internal) */
  525|  5.71k|    uint32_t n_rem = (uint32_t)n;
  526|  57.0k|    for (int l = 1; l <= cap && n_rem; l++) {
  ------------------
  |  Branch (526:21): [True: 56.0k, False: 979]
  |  Branch (526:33): [True: 51.3k, False: 4.73k]
  ------------------
  527|  51.3k|        struct {
  528|  51.3k|            uint32_t c;
  529|  51.3k|            int flat_d; /* > 0: complete as one uniform run at depth l + flat_d */
  530|  51.3k|        } cand[6];
  531|  51.3k|        int n_cand = 0;
  532|  51.3k|        const uint32_t c_base = zxc_huf_nudge_clamp(blc0[l], s, n_rem, l, cap);
  533|  51.3k|        cand[n_cand].c = c_base;
  534|  51.3k|        cand[n_cand++].flat_d = 0;
  535|  51.3k|        if (c_base < n_rem) {
  ------------------
  |  Branch (535:13): [True: 45.5k, False: 5.71k]
  ------------------
  536|       |            // Shape the internal-node count i = s - c toward few set bits.
  537|  45.5k|            const uint32_t i_base = s - c_base;
  538|  45.5k|            const uint32_t i_dn = 1U << zxc_log2_u32(i_base);
  539|  45.5k|            const uint32_t rest = i_base - i_dn;
  540|  45.5k|            const uint32_t shapes[3] = {i_dn, i_dn << 1,
  541|  45.5k|                                        i_dn | (rest ? 1U << zxc_log2_u32(rest) : 0U)};
  ------------------
  |  Branch (541:49): [True: 28.4k, False: 17.1k]
  ------------------
  542|   182k|            for (int k = 0; k < 3; k++) {
  ------------------
  |  Branch (542:29): [True: 136k, False: 45.5k]
  ------------------
  543|   136k|                const uint32_t want = s > shapes[k] ? s - shapes[k] : 0;
  ------------------
  |  Branch (543:39): [True: 71.7k, False: 65.0k]
  ------------------
  544|   136k|                const uint32_t c = zxc_huf_nudge_clamp(want, s, n_rem, l, cap);
  545|   136k|                int dup = 0;
  546|   353k|                for (int p = 0; p < n_cand; p++) dup |= (cand[p].c == c);
  ------------------
  |  Branch (546:33): [True: 216k, False: 136k]
  ------------------
  547|   136k|                if (!dup) {
  ------------------
  |  Branch (547:21): [True: 70.0k, False: 66.7k]
  ------------------
  548|  70.0k|                    cand[n_cand].c = c;
  549|  70.0k|                    cand[n_cand++].flat_d = 0;
  550|  70.0k|                }
  551|   136k|            }
  552|       |            // Uniform finish: c leaves here, the rest as i complete depth-D
  553|       |            // subtrees (c*(2^D - 1) == s*2^D - n_rem must divide exactly).
  554|   259k|            for (int d = 1; d <= cap - l && n_cand < 6; d++) {
  ------------------
  |  Branch (554:29): [True: 235k, False: 24.6k]
  |  Branch (554:45): [True: 235k, False: 0]
  ------------------
  555|   235k|                const uint32_t den = (1U << d) - 1;
  556|   235k|                const int32_t num = (int32_t)(s << d) - (int32_t)n_rem;
  557|   235k|                if (num < 0 || (uint32_t)num % den) continue;
  ------------------
  |  Branch (557:21): [True: 117k, False: 117k]
  |  Branch (557:32): [True: 96.4k, False: 20.8k]
  ------------------
  558|  20.8k|                const uint32_t c = (uint32_t)num / den;
  559|  20.8k|                if (c >= s || c >= n_rem) continue; /* need i >= 1 and a remainder */
  ------------------
  |  Branch (559:21): [True: 0, False: 20.8k]
  |  Branch (559:31): [True: 0, False: 20.8k]
  ------------------
  560|  20.8k|                cand[n_cand].c = c;
  561|  20.8k|                cand[n_cand++].flat_d = d;
  562|  20.8k|                break; /* the shallowest exact finish is the aggressive one */
  563|  20.8k|            }
  564|  45.5k|        }
  565|  51.3k|        uint64_t best_j = UINT64_MAX;
  566|  51.3k|        uint32_t best_c = c_base;
  567|   193k|        for (int k = 0; k < n_cand; k++) {
  ------------------
  |  Branch (567:25): [True: 142k, False: 51.3k]
  ------------------
  568|   142k|            uint32_t tmp[LU + 1];
  569|   142k|            ZXC_MEMCPY(tmp, out_blc, sizeof(tmp));
  ------------------
  |  |  168|   142k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  570|   142k|            tmp[l] = cand[k].c;
  571|   142k|            const uint32_t rem = n_rem - cand[k].c;
  572|   142k|            if (rem) {
  ------------------
  |  Branch (572:17): [True: 136k, False: 5.71k]
  ------------------
  573|   136k|                if (cand[k].flat_d)
  ------------------
  |  Branch (573:21): [True: 20.8k, False: 115k]
  ------------------
  574|  20.8k|                    tmp[l + cand[k].flat_d] = rem;
  575|   115k|                else
  576|   115k|                    zxc_huf_nudge_complete(tmp, l, 2 * (s - cand[k].c), rem, blc0, cap);
  577|   136k|            }
  578|   142k|            zxc_huf_nudge_cost_t cc;
  579|   142k|            zxc_huf_nudge_eval(tmp, pf_rank, &cc);
  580|   142k|            const uint64_t j = zxc_huf_nudge_j(&cc);
  581|   142k|            if (j < best_j) {
  ------------------
  |  Branch (581:17): [True: 61.0k, False: 81.1k]
  ------------------
  582|  61.0k|                best_j = j;
  583|  61.0k|                best_c = cand[k].c;
  584|  61.0k|            }
  585|   142k|        }
  586|  51.3k|        out_blc[l] = best_c;
  587|  51.3k|        n_rem -= best_c;
  588|  51.3k|        s = 2 * (s - best_c);
  589|  51.3k|    }
  590|  5.71k|}
zxc_huffman.c:zxc_huf_nudge_clamp:
  468|   724k|                                    const int l, const int cap) {
  469|   724k|    if (n_rem <= s || l >= cap) return n_rem; /* forced finish */
  ------------------
  |  Branch (469:9): [True: 121k, False: 602k]
  |  Branch (469:23): [True: 0, False: 602k]
  ------------------
  470|   602k|    const uint32_t m = 1U << (cap - l);
  471|   602k|    const uint32_t lo = (2 * s > n_rem) ? 2 * s - n_rem : 0;
  ------------------
  |  Branch (471:25): [True: 172k, False: 430k]
  ------------------
  472|   602k|    uint32_t hi = s - 1;
  473|   602k|    const uint32_t cap_hi = (s * m - n_rem) / (m - 1);
  474|   602k|    if (cap_hi < hi) hi = cap_hi;
  ------------------
  |  Branch (474:9): [True: 455k, False: 147k]
  ------------------
  475|   602k|    const uint32_t c = want < lo ? lo : want;
  ------------------
  |  Branch (475:24): [True: 46.3k, False: 556k]
  ------------------
  476|   602k|    return c > hi ? hi : c;
  ------------------
  |  Branch (476:12): [True: 94.6k, False: 508k]
  ------------------
  477|   724k|}
zxc_huffman.c:zxc_huf_nudge_complete:
  491|   115k|                                   const uint32_t* RESTRICT blc0, const int cap) {
  492|   651k|    for (int j = l + 1; j <= cap && n_rem; j++) {
  ------------------
  |  Branch (492:25): [True: 595k, False: 56.2k]
  |  Branch (492:37): [True: 536k, False: 59.3k]
  ------------------
  493|   536k|        const uint32_t c = zxc_huf_nudge_clamp(blc0[j], s, n_rem, j, cap);
  494|   536k|        blc[j] = c;
  495|   536k|        n_rem -= c;
  496|   536k|        s = 2 * (s - c);
  497|   536k|    }
  498|   115k|}
zxc_huffman.c:zxc_huf_nudge_assign:
  766|  5.71k|                                 uint8_t* RESTRICT cand_len) {
  767|  5.71k|    ZXC_MEMSET(cand_len, 0, ZXC_HUF_NUM_SYMBOLS);
  ------------------
  |  |  173|  5.71k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  768|  5.71k|    int r = 0;
  769|  68.5k|    for (int l = 1; l <= ZXC_HUF_MAX_CODE_LEN_ULTRA; l++)
  ------------------
  |  |  826|  68.5k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
  |  Branch (769:21): [True: 62.8k, False: 5.71k]
  ------------------
  770|  1.03M|        for (uint32_t k = 0; k < blc[l]; k++) cand_len[sym_order[r++]] = (uint8_t)l;
  ------------------
  |  Branch (770:30): [True: 970k, False: 62.8k]
  ------------------
  771|  5.71k|}
zxc_huffman.c:zxc_huf_nudge_dp_solve:
  671|  5.71k|                                  uint32_t* RESTRICT out_cblc) {
  672|  5.71k|    if (UNLIKELY(m < 2 || m > ZXC_HUF_NUDGE_DP_M || cap_c < 1 ||
  ------------------
  |  |  152|  34.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.71k]
  |  |  |  Branch (152:42): [True: 0, False: 5.71k]
  |  |  |  Branch (152:42): [True: 0, False: 5.71k]
  |  |  |  Branch (152:42): [True: 0, False: 5.71k]
  |  |  |  Branch (152:42): [True: 0, False: 5.71k]
  |  |  ------------------
  ------------------
  673|  5.71k|                 cap_c > ZXC_HUF_MAX_CODE_LEN_ULTRA))
  674|      0|        return 0;
  675|       |
  676|  5.71k|    const size_t plane = (size_t)(m + 1) * (size_t)(m + 1);
  677|  5.71k|    const size_t arrive_cnt = (size_t)(cap_c + 1) * plane;
  678|  5.71k|    uint64_t* jcur = ws->jcur;
  679|  5.71k|    uint64_t* jnxt = ws->jnxt;
  680|  5.71k|    uint8_t* const arrive = ws->arrive;
  681|  5.71k|    int ok = 0;
  682|       |
  683|  5.71k|#define ZXC_NUDGE_DP_IDX(k, s) ((size_t)(k) * (size_t)(m + 1) + (size_t)(s))
  684|  17.2M|    for (size_t i = 0; i < plane; i++) jcur[i] = UINT64_MAX;
  ------------------
  |  Branch (684:24): [True: 17.2M, False: 5.71k]
  ------------------
  685|  5.71k|    jcur[ZXC_NUDGE_DP_IDX(0, 2)] = 0;
  ------------------
  |  |  683|  5.71k|#define ZXC_NUDGE_DP_IDX(k, s) ((size_t)(k) * (size_t)(m + 1) + (size_t)(s))
  ------------------
  686|  5.71k|    uint64_t best_j = UINT64_MAX;
  687|  5.71k|    int best_l = 0;
  688|  5.71k|    int best_k = 0;
  689|  5.71k|    int best_s = 0;
  690|  58.4k|    for (int lc = 1; lc <= cap_c; lc++) {
  ------------------
  |  Branch (690:22): [True: 52.7k, False: 5.71k]
  ------------------
  691|   157M|        for (size_t i = 0; i < plane; i++) jnxt[i] = UINT64_MAX;
  ------------------
  |  Branch (691:28): [True: 157M, False: 52.7k]
  ------------------
  692|  2.80M|        for (int k = 0; k < m; k++) {
  ------------------
  |  Branch (692:25): [True: 2.75M, False: 52.7k]
  ------------------
  693|  2.75M|            const uint32_t n_rem = (uint32_t)(m - k);
  694|  80.0M|            for (uint32_t s = 1; s <= n_rem; s++) {
  ------------------
  |  Branch (694:34): [True: 77.2M, False: 2.75M]
  ------------------
  695|  77.2M|                const size_t from = ZXC_NUDGE_DP_IDX(k, s);
  ------------------
  |  |  683|  77.2M|#define ZXC_NUDGE_DP_IDX(k, s) ((size_t)(k) * (size_t)(m + 1) + (size_t)(s))
  ------------------
  696|  77.2M|                if (UNLIKELY(from >= plane)) continue;
  ------------------
  |  |  152|  77.2M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 77.2M]
  |  |  ------------------
  ------------------
  697|  77.2M|                const uint64_t j0 = jcur[from];
  698|  77.2M|                if (j0 == UINT64_MAX) continue;
  ------------------
  |  Branch (698:21): [True: 69.1M, False: 8.14M]
  ------------------
  699|  8.14M|                if (s == n_rem) {
  ------------------
  |  Branch (699:21): [True: 467k, False: 7.67M]
  ------------------
  700|       |                    // Forced finish: fill every slot, close the tree here.
  701|   467k|                    const uint64_t j =
  702|   467k|                        j0 + zxc_huf_nudge_dp_run_j(lu, lc, g_log2, s, s, pfg, (uint32_t)k) +
  703|   467k|                        (uint64_t)ZXC_HUF_NUDGE_LAMBDA_Q8 * (uint64_t)ZXC_HUF_NUDGE_LEVEL_COST *
  ------------------
  |  |  913|   467k|#define ZXC_HUF_NUDGE_LAMBDA_Q8 26
  ------------------
                                      (uint64_t)ZXC_HUF_NUDGE_LAMBDA_Q8 * (uint64_t)ZXC_HUF_NUDGE_LEVEL_COST *
  ------------------
  |  |  928|   467k|#define ZXC_HUF_NUDGE_LEVEL_COST 64
  ------------------
  704|   467k|                            (uint64_t)(lc + g_log2 + 1);
  705|   467k|                    if (j < best_j) {
  ------------------
  |  Branch (705:25): [True: 69.9k, False: 397k]
  ------------------
  706|  69.9k|                        best_j = j;
  707|  69.9k|                        best_l = lc;
  708|  69.9k|                        best_k = k;
  709|  69.9k|                        best_s = (int)s;
  710|  69.9k|                    }
  711|   467k|                    continue;
  712|   467k|                }
  713|  7.67M|                if (lc == cap_c) continue; /* must finish at the cap */
  ------------------
  |  Branch (713:21): [True: 0, False: 7.67M]
  ------------------
  714|  7.67M|                const uint32_t mm = 1U << (cap_c - lc);
  715|  7.67M|                const uint32_t lo = (2 * s > n_rem) ? 2 * s - n_rem : 0;
  ------------------
  |  Branch (715:37): [True: 4.62M, False: 3.04M]
  ------------------
  716|  7.67M|                uint32_t hi = s - 1;
  717|  7.67M|                const uint32_t cap_hi = (s * mm - n_rem) / (mm - 1);
  718|  7.67M|                if (cap_hi < hi) hi = cap_hi;
  ------------------
  |  Branch (718:21): [True: 6.00M, False: 1.67M]
  ------------------
  719|  59.6M|                for (uint32_t c = lo; c <= hi; c++) {
  ------------------
  |  Branch (719:39): [True: 51.9M, False: 7.67M]
  ------------------
  720|  51.9M|                    const uint64_t j =
  721|  51.9M|                        j0 + zxc_huf_nudge_dp_run_j(lu, lc, g_log2, s, c, pfg, (uint32_t)k);
  722|  51.9M|                    const size_t to = ZXC_NUDGE_DP_IDX(k + (int)c, 2 * (s - c));
  ------------------
  |  |  683|  51.9M|#define ZXC_NUDGE_DP_IDX(k, s) ((size_t)(k) * (size_t)(m + 1) + (size_t)(s))
  ------------------
  723|  51.9M|                    const size_t arr = (size_t)(lc + 1) * plane + to;
  724|       |
  725|  51.9M|                    if (UNLIKELY(to >= plane || arr >= arrive_cnt)) continue;
  ------------------
  |  |  152|   103M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 51.9M]
  |  |  |  Branch (152:42): [True: 0, False: 51.9M]
  |  |  |  Branch (152:42): [True: 0, False: 51.9M]
  |  |  ------------------
  ------------------
  726|  51.9M|                    if (j < jnxt[to]) {
  ------------------
  |  Branch (726:25): [True: 32.7M, False: 19.2M]
  ------------------
  727|  32.7M|                        jnxt[to] = j;
  728|  32.7M|                        arrive[arr] = (uint8_t)c;
  729|  32.7M|                    }
  730|  51.9M|                }
  731|  7.67M|            }
  732|  2.75M|        }
  733|  52.7k|        uint64_t* tmp = jcur;
  734|  52.7k|        jcur = jnxt;
  735|  52.7k|        jnxt = tmp;
  736|  52.7k|    }
  737|  5.71k|    if (best_j == UINT64_MAX) goto done;
  ------------------
  |  Branch (737:9): [True: 0, False: 5.71k]
  ------------------
  738|  5.71k|    ZXC_MEMSET(out_cblc, 0, (ZXC_HUF_MAX_CODE_LEN_ULTRA + 1) * sizeof(uint32_t));
  ------------------
  |  |  173|  5.71k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  739|  5.71k|    out_cblc[best_l] = (uint32_t)best_s;
  740|  5.71k|    {
  741|  5.71k|        int k = best_k;
  742|  5.71k|        int s = best_s;
  743|  43.0k|        for (int lc = best_l; lc > 1; lc--) {
  ------------------
  |  Branch (743:31): [True: 37.3k, False: 5.71k]
  ------------------
  744|  37.3k|            const uint32_t c = arrive[(size_t)lc * plane + ZXC_NUDGE_DP_IDX(k, s)];
  ------------------
  |  |  683|  37.3k|#define ZXC_NUDGE_DP_IDX(k, s) ((size_t)(k) * (size_t)(m + 1) + (size_t)(s))
  ------------------
  745|  37.3k|            out_cblc[lc - 1] = c;
  746|  37.3k|            s = s / 2 + (int)c;
  747|  37.3k|            k -= (int)c;
  748|  37.3k|        }
  749|  5.71k|        if (UNLIKELY(k != 0 || s != 2)) goto done; /* backtrack corruption: drop candidate */
  ------------------
  |  |  152|  11.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 5.71k]
  |  |  |  Branch (152:42): [True: 0, False: 5.71k]
  |  |  |  Branch (152:42): [True: 0, False: 5.71k]
  |  |  ------------------
  ------------------
  750|  5.71k|    }
  751|  5.71k|    ok = 1;
  752|  5.71k|done:
  753|  5.71k|#undef ZXC_NUDGE_DP_IDX
  754|  5.71k|    return ok;
  755|  5.71k|}
zxc_huffman.c:zxc_huf_nudge_dp_run_j:
  615|  52.4M|                                       const uint64_t* RESTRICT pfg, const uint32_t k) {
  616|  52.4M|    if (!c) return 0;
  ------------------
  |  Branch (616:9): [True: 3.04M, False: 49.3M]
  ------------------
  617|  49.3M|    const int lr = lc + g_log2; /* real code length of these leaves */
  618|  49.3M|    const uint32_t w = 1U << (lu - lc);
  619|  49.3M|    const uint32_t S = (1U << lu) - s * w;
  620|  49.3M|    const uint32_t end = S + c * w;
  621|  49.3M|    const uint64_t bits = (uint64_t)lr * (pfg[k + c] - pfg[k]);
  622|  49.3M|    uint64_t touches = 0;
  623|  49.3M|    uint32_t x = S;
  624|   200M|    while (x < end) {
  ------------------
  |  Branch (624:12): [True: 151M, False: 49.3M]
  ------------------
  625|   151M|        const uint32_t wx = x ? (x & (0U - x)) : (1U << lu);
  ------------------
  |  Branch (625:29): [True: 151M, False: 245k]
  ------------------
  626|   151M|        const uint32_t wr = 1U << zxc_log2_u32(end - x);
  627|   151M|        const uint32_t W = wx < wr ? wx : wr;
  ------------------
  |  Branch (627:28): [True: 43.3M, False: 108M]
  ------------------
  628|   151M|        const int d = (int)zxc_log2_u32(W >> (lu - lc)) + g_log2;
  629|   151M|        const uint32_t i0 = k + ((x - S) >> (lu - lc));
  630|   151M|        const uint64_t mass = pfg[i0 + (W >> (lu - lc))] - pfg[i0];
  631|   151M|        int t;
  632|   151M|        if (d == 0) {
  ------------------
  |  Branch (632:13): [True: 5.49M, False: 145M]
  ------------------
  633|  5.49M|            t = lr + 1;
  634|   145M|        } else if (d == 1) {
  ------------------
  |  Branch (634:20): [True: 13.9M, False: 131M]
  ------------------
  635|  13.9M|            t = lr;
  636|   131M|        } else {
  637|   131M|            t = (lr - d) + 1;
  638|   131M|            if (d > ZXC_PIVCO_UNPACK_FLAT_SIMD_MAX) t += ZXC_HUF_NUDGE_DEEP_FLAT_PENALTY;
  ------------------
  |  |  847|   131M|#define ZXC_PIVCO_UNPACK_FLAT_SIMD_MAX 6
  ------------------
                          if (d > ZXC_PIVCO_UNPACK_FLAT_SIMD_MAX) t += ZXC_HUF_NUDGE_DEEP_FLAT_PENALTY;
  ------------------
  |  |  924|   126k|#define ZXC_HUF_NUDGE_DEEP_FLAT_PENALTY 24
  ------------------
  |  Branch (638:17): [True: 126k, False: 131M]
  ------------------
  639|   131M|        }
  640|   151M|        touches += mass * (uint64_t)t;
  641|   151M|        x += W;
  642|   151M|    }
  643|  49.3M|    return 256U * bits + (uint64_t)ZXC_HUF_NUDGE_LAMBDA_Q8 * touches;
  ------------------
  |  |  913|  49.3M|#define ZXC_HUF_NUDGE_LAMBDA_Q8 26
  ------------------
  644|  52.4M|}
zxc_huffman.c:zxc_huf_nudge_j:
  444|   153k|static ZXC_ALWAYS_INLINE uint64_t zxc_huf_nudge_j(const zxc_huf_nudge_cost_t* c) {
  445|   153k|    return 256U * c->bits + (uint64_t)ZXC_HUF_NUDGE_LAMBDA_Q8 * c->touches;
  ------------------
  |  |  913|   153k|#define ZXC_HUF_NUDGE_LAMBDA_Q8 26
  ------------------
  446|   153k|}
zxc_huffman.c:zxc_pivco_tree_build:
 1048|  29.8k|static int zxc_pivco_tree_build(const uint8_t* RESTRICT code_len, zxc_pivco_tree_t* RESTRICT t) {
 1049|  29.8k|    uint16_t bl_count[ZXC_HUF_MAX_CODE_LEN_ULTRA + 1] = {0};
 1050|  29.8k|    int n_present = 0;
 1051|  29.8k|    int max_depth = 0;
 1052|  7.68M|    for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++) {
  ------------------
  |  |  833|  7.68M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1052:21): [True: 7.65M, False: 29.8k]
  ------------------
 1053|  7.65M|        const int l = code_len[s];
 1054|  7.65M|        if (l == 0) continue;
  ------------------
  |  Branch (1054:13): [True: 3.39M, False: 4.26M]
  ------------------
 1055|  4.26M|        if (UNLIKELY(l > ZXC_HUF_MAX_CODE_LEN_ULTRA)) return -1;
  ------------------
  |  |  152|  4.26M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 4.26M]
  |  |  ------------------
  ------------------
 1056|  4.26M|        bl_count[l]++;
 1057|  4.26M|        n_present++;
 1058|  4.26M|        if (l > max_depth) max_depth = l;
  ------------------
  |  Branch (1058:13): [True: 112k, False: 4.14M]
  ------------------
 1059|  4.26M|    }
 1060|  29.8k|    if (UNLIKELY(n_present == 0)) return -1;
  ------------------
  |  |  152|  29.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 29.8k]
  |  |  ------------------
  ------------------
 1061|  29.8k|    if (n_present >= 2) {
  ------------------
  |  Branch (1061:9): [True: 28.0k, False: 1.82k]
  ------------------
 1062|  28.0k|        uint32_t kraft = 0;
 1063|   336k|        for (int l = 1; l <= ZXC_HUF_MAX_CODE_LEN_ULTRA; l++)
  ------------------
  |  |  826|   336k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
  |  Branch (1063:25): [True: 308k, False: 28.0k]
  ------------------
 1064|   308k|            kraft += (uint32_t)bl_count[l] << (ZXC_HUF_MAX_CODE_LEN_ULTRA - l);
  ------------------
  |  |  826|   308k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
 1065|  28.0k|        if (UNLIKELY(kraft != (1U << ZXC_HUF_MAX_CODE_LEN_ULTRA))) return -1;
  ------------------
  |  |  152|  28.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 35, False: 28.0k]
  |  |  ------------------
  ------------------
 1066|  28.0k|    } else if (UNLIKELY(bl_count[1] != 1)) {
  ------------------
  |  |  152|  1.82k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 5, False: 1.81k]
  |  |  ------------------
  ------------------
 1067|      5|        return -1; /* the lone symbol is pinned at length 1 */
 1068|      5|    }
 1069|  29.8k|    t->max_depth = max_depth;
 1070|       |
 1071|       |    // Two children per internal node above, one under the lone symbol's root.
 1072|       |    // The d-bit prefixes start at `first`.
 1073|  29.8k|    unsigned width = 1;
 1074|  29.8k|    unsigned first = 0;
 1075|  29.8k|    t->node_base[0] = 0;
 1076|  29.8k|    t->leaf_base[0] = 0;
 1077|   300k|    for (int d = 0; d <= max_depth; d++) {
  ------------------
  |  Branch (1077:21): [True: 270k, False: 29.8k]
  ------------------
 1078|   270k|        t->base[d] = (int16_t)(t->node_base[d] - (int)first);
 1079|   270k|        t->node_base[d + 1] = (uint16_t)(t->node_base[d] + width);
 1080|   270k|        t->leaf_base[d + 1] = (uint16_t)(t->leaf_base[d] + bl_count[d]);
 1081|   270k|        first = 2 * (first + bl_count[d]);
 1082|   270k|        width = (d == 0 && n_present == 1) ? 1U : 2 * (width - bl_count[d]);
  ------------------
  |  Branch (1082:18): [True: 29.8k, False: 240k]
  |  Branch (1082:28): [True: 1.81k, False: 28.0k]
  ------------------
 1083|   270k|    }
 1084|       |
 1085|  29.8k|    uint16_t pos[ZXC_HUF_MAX_CODE_LEN_ULTRA + 1];
 1086|   300k|    for (int d = 0; d <= max_depth; d++) pos[d] = t->leaf_base[d];
  ------------------
  |  Branch (1086:21): [True: 270k, False: 29.8k]
  ------------------
 1087|  7.67M|    for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++)
  ------------------
  |  |  833|  7.67M|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1087:21): [True: 7.64M, False: 29.8k]
  ------------------
 1088|  7.64M|        if (code_len[s]) t->syms[pos[code_len[s]]++] = (uint8_t)s;
  ------------------
  |  Branch (1088:13): [True: 4.25M, False: 3.38M]
  ------------------
 1089|       |
 1090|       |    // FORMAT RULE: a flat root is a MAXIMAL complete subtree of depth D >= 2
 1091|       |    // (D = 1 is a leaf pair). Bottom-up, flat_d holds complete heights: 0 at
 1092|       |    // leaves and the slot, INCOMPLETE across depths.
 1093|  29.8k|    enum { INCOMPLETE = 0xFE };
 1094|  29.8k|    t->flat_d[t->node_base[max_depth + 1]] = 0;
 1095|   300k|    for (int d = max_depth; d >= 0; d--) {
  ------------------
  |  Branch (1095:29): [True: 270k, False: 29.8k]
  ------------------
 1096|   270k|        uint8_t* const h = t->flat_d + t->node_base[d];
 1097|   270k|        const uint8_t* const hc = t->flat_d + t->node_base[d + 1];
 1098|   270k|        const int L = zxc_pivco_leaves(t, d);
 1099|   270k|        const int N = t->node_base[d + 1] - t->node_base[d];
 1100|  4.52M|        for (int i = 0; i < L; i++) h[i] = 0;
  ------------------
  |  Branch (1100:25): [True: 4.25M, False: 270k]
  ------------------
 1101|  4.49M|        for (int i = L; i < N; i++) {
  ------------------
  |  Branch (1101:25): [True: 4.22M, False: 270k]
  ------------------
 1102|  4.22M|            const uint8_t a = hc[2 * (i - L)];
 1103|  4.22M|            const uint8_t b = hc[2 * (i - L) + 1];
 1104|  4.22M|            h[i] = (a == b && a != INCOMPLETE) ? (uint8_t)(a + 1) : (uint8_t)INCOMPLETE;
  ------------------
  |  Branch (1104:21): [True: 4.01M, False: 213k]
  |  Branch (1104:31): [True: 3.97M, False: 39.2k]
  ------------------
 1105|  4.22M|        }
 1106|   270k|    }
 1107|       |    // Top-down: the first height >= 2 on a path is a flat root, the internal
 1108|       |    // nodes below are covered. The wire packs a path LSB first, so leaf r has
 1109|       |    // packed code r bit-reversed: store the leaves in that order.
 1110|   270k|    for (int d = 0; d < max_depth; d++) {
  ------------------
  |  Branch (1110:21): [True: 240k, False: 29.8k]
  ------------------
 1111|   240k|        uint8_t* const fd = t->flat_d + t->node_base[d];
 1112|   240k|        const uint8_t* const up =
 1113|   240k|            d ? t->flat_d + t->node_base[d - 1] + zxc_pivco_leaves(t, d - 1) : NULL;
  ------------------
  |  Branch (1113:13): [True: 210k, False: 29.8k]
  ------------------
 1114|   240k|        const int N = t->node_base[d + 1] - t->node_base[d];
 1115|  4.46M|        for (int i = zxc_pivco_leaves(t, d); i < N; i++) {
  ------------------
  |  Branch (1115:46): [True: 4.22M, False: 240k]
  ------------------
 1116|  4.22M|            if (up && up[i >> 1]) {
  ------------------
  |  Branch (1116:17): [True: 4.19M, False: 29.8k]
  |  Branch (1116:23): [True: 3.72M, False: 468k]
  ------------------
 1117|  3.72M|                fd[i] = ZXC_PIVCO_COVERED;
  ------------------
  |  |  850|  3.72M|#define ZXC_PIVCO_COVERED 0xFFU
  ------------------
 1118|  3.72M|            } else if (fd[i] < 2 || fd[i] == INCOMPLETE) {
  ------------------
  |  Branch (1118:24): [True: 51.0k, False: 447k]
  |  Branch (1118:37): [True: 252k, False: 195k]
  ------------------
 1119|   303k|                fd[i] = 0;
 1120|   303k|            } else {
 1121|   195k|                const int g = t->node_base[d] + i;
 1122|   195k|                zxc_pivco_bitrev_permute(t->syms + zxc_pivco_flat_leaves(t, g, d, fd[i]), fd[i]);
 1123|   195k|            }
 1124|  4.22M|        }
 1125|   240k|    }
 1126|  29.8k|    return 0;
 1127|  29.8k|}
zxc_huffman.c:zxc_pivco_leaves:
 1012|  2.18M|static ZXC_ALWAYS_INLINE int zxc_pivco_leaves(const zxc_pivco_tree_t* RESTRICT t, const int d) {
 1013|  2.18M|    return t->leaf_base[d + 1] - t->leaf_base[d];
 1014|  2.18M|}
zxc_huffman.c:zxc_pivco_bitrev_permute:
 1024|   195k|static void zxc_pivco_bitrev_permute(uint8_t* RESTRICT s, const int D) {
 1025|   195k|    const unsigned m = 1U << D;
 1026|   195k|    unsigned c = 0; /* r bit-reversed */
 1027|  4.31M|    for (unsigned r = 0; r < m; r++) {
  ------------------
  |  Branch (1027:26): [True: 4.11M, False: 195k]
  ------------------
 1028|  4.11M|        if (r < c) {
  ------------------
  |  Branch (1028:13): [True: 1.59M, False: 2.52M]
  ------------------
 1029|  1.59M|            const uint8_t x = s[r];
 1030|  1.59M|            s[r] = s[c];
 1031|  1.59M|            s[c] = x;
 1032|  1.59M|        }
 1033|  4.11M|        unsigned bit = m >> 1; /* reversed increment */
 1034|  8.04M|        for (; c & bit; bit >>= 1) c ^= bit;
  ------------------
  |  Branch (1034:16): [True: 3.92M, False: 4.11M]
  ------------------
 1035|  4.11M|        c |= bit;
 1036|  4.11M|    }
 1037|   195k|}
zxc_huffman.c:zxc_pivco_flat_leaves:
 1018|   320k|                                                   const int d, const int D) {
 1019|   320k|    const int e = d + D;
 1020|   320k|    return t->leaf_base[e] + t->base[e] - t->node_base[e] + ((g - t->base[d]) << D);
 1021|   320k|}
zxc_huffman.c:zxc_pivco_counts:
 1138|  9.35k|                             uint32_t* RESTRICT count) {
 1139|  9.35k|    count[t->node_base[t->max_depth + 1]] = 0;
 1140|   104k|    for (int d = t->max_depth; d >= 0; d--) {
  ------------------
  |  Branch (1140:32): [True: 94.9k, False: 9.35k]
  ------------------
 1141|  94.9k|        const int L = zxc_pivco_leaves(t, d);
 1142|  94.9k|        const int N = t->node_base[d + 1] - t->node_base[d];
 1143|  94.9k|        uint32_t* const cnt = count + t->node_base[d];
 1144|  94.9k|        const uint32_t* const ccnt = count + t->node_base[d + 1];
 1145|  94.9k|        const uint8_t* const sym = t->syms + t->leaf_base[d];
 1146|  1.67M|        for (int i = 0; i < L; i++) cnt[i] = freq[sym[i]];
  ------------------
  |  Branch (1146:25): [True: 1.57M, False: 94.9k]
  ------------------
 1147|  1.66M|        for (int i = L; i < N; i++) cnt[i] = ccnt[2 * (i - L)] + ccnt[2 * (i - L) + 1];
  ------------------
  |  Branch (1147:25): [True: 1.56M, False: 94.9k]
  ------------------
 1148|  94.9k|    }
 1149|  9.35k|}
zxc_huffman.c:zxc_pivco_layout:
 1195|  9.35k|                               uint32_t* RESTRICT cur) {
 1196|  9.35k|    size_t total = 0;
 1197|  94.9k|    for (int d = 0; d < t->max_depth; d++) {
  ------------------
  |  Branch (1197:21): [True: 85.5k, False: 9.35k]
  ------------------
 1198|  1.65M|        for (int g = t->node_base[d] + zxc_pivco_leaves(t, d); g < t->node_base[d + 1]; g++) {
  ------------------
  |  Branch (1198:64): [True: 1.56M, False: 85.5k]
  ------------------
 1199|  1.56M|            if (t->flat_d[g] == ZXC_PIVCO_COVERED) continue;
  ------------------
  |  |  850|  1.56M|#define ZXC_PIVCO_COVERED 0xFFU
  ------------------
  |  Branch (1199:17): [True: 1.39M, False: 174k]
  ------------------
 1200|   174k|            if (cur) cur[g] = (uint32_t)(total << 3);
  ------------------
  |  Branch (1200:17): [True: 72.0k, False: 102k]
  ------------------
 1201|   174k|            total += zxc_pivco_run_bytes(count[g], t->flat_d[g]);
 1202|   174k|        }
 1203|  85.5k|    }
 1204|  9.35k|    return total;
 1205|  9.35k|}
zxc_huffman.c:zxc_pivco_run_bytes:
 1182|  5.49M|static ZXC_ALWAYS_INLINE size_t zxc_pivco_run_bytes(const uint32_t count, const uint8_t flat_d) {
 1183|  5.49M|    return flat_d ? ((size_t)count * flat_d + 7) / 8 : ((size_t)count + 7) / 8;
  ------------------
  |  Branch (1183:12): [True: 4.99M, False: 502k]
  ------------------
 1184|  5.49M|}
zxc_huffman.c:zxc_pivco_codes:
 1152|  3.63k|static void zxc_pivco_codes(const zxc_pivco_tree_t* RESTRICT t, uint32_t* RESTRICT codes) {
 1153|  37.5k|    for (int d = 1; d <= t->max_depth; d++)
  ------------------
  |  Branch (1153:21): [True: 33.9k, False: 3.63k]
  ------------------
 1154|   638k|        for (int i = 0; i < zxc_pivco_leaves(t, d); i++)
  ------------------
  |  Branch (1154:25): [True: 604k, False: 33.9k]
  ------------------
 1155|   604k|            codes[t->syms[t->leaf_base[d] + i]] = (uint32_t)(t->node_base[d] + i - t->base[d]);
 1156|  3.63k|}
zxc_huffman.c:zxc_pivco_encode_core:
 1244|  3.63k|                                 const int with_header) {
 1245|  3.63k|    if (UNLIKELY(n_literals == 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  3.63k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 3.63k]
  |  |  ------------------
  ------------------
 1246|       |    // Every literal present in the histogram must have a code (a dict table
 1247|       |    // may lack codes for symbols unseen in training: the caller then falls
 1248|       |    // back to a per-block table, but a direct call must fail loudly).
 1249|   934k|    for (int k = 0; k < ZXC_HUF_NUM_SYMBOLS; k++)
  ------------------
  |  |  833|   934k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1249:21): [True: 931k, False: 3.63k]
  ------------------
 1250|   931k|        if (UNLIKELY(freq[k] != 0 && code_len[k] == 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  1.53M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 931k]
  |  |  |  Branch (152:42): [True: 602k, False: 328k]
  |  |  |  Branch (152:42): [True: 0, False: 602k]
  |  |  ------------------
  ------------------
 1251|       |
 1252|  3.63k|    uint32_t count[ZXC_PIVCO_NODE_SLOTS];
 1253|  3.63k|    zxc_pivco_counts(t, freq, count);
 1254|  3.63k|    uint32_t cur[ZXC_PIVCO_MAX_NODES]; /* per-node write cursor, in payload bits */
 1255|  3.63k|    const size_t payload = zxc_pivco_layout(t, count, cur);
 1256|  3.63k|    const size_t hdr = with_header ? (size_t)ZXC_HUF_TABLE_SIZE : 0;
  ------------------
  |  |  102|  3.63k|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
  |  Branch (1256:24): [True: 3.63k, False: 0]
  ------------------
 1257|       |    // +2: the packed-code emitter uses a 3-byte read-modify-write that may
 1258|       |    // touch up to 2 bytes past the payload end.
 1259|  3.63k|    if (UNLIKELY(hdr + payload + 2 > dst_cap)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  152|  3.63k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 3.63k]
  |  |  ------------------
  ------------------
 1260|       |
 1261|  3.63k|    if (with_header) zxc_huf_pack_lengths(code_len, dst);
  ------------------
  |  |   43|  3.63k|#define zxc_huf_pack_lengths ZXC_CAT(zxc_huf_pack_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   41|  3.63k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  3.63k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1261:9): [True: 3.63k, False: 0]
  ------------------
 1262|  3.63k|    uint8_t* const out = dst + hdr;
 1263|  3.63k|    ZXC_MEMSET(out, 0, payload + 2);
  ------------------
  |  |  173|  3.63k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 1264|       |
 1265|       |    // Emit MSB-first while descending. At a flat root, emit the code's last D
 1266|       |    // bits, its packed code, in one shot and stop. Batching the per-bit
 1267|       |    // read-modify-write buys nothing: accumulators would still touch memory
 1268|       |    // once per bit, and flat roots absorb the dense levels.
 1269|  23.8M|    for (size_t i = 0; i < n_literals; i++) {
  ------------------
  |  Branch (1269:24): [True: 23.8M, False: 3.63k]
  ------------------
 1270|  23.8M|        const uint8_t s = literals[i];
 1271|  23.8M|        const uint32_t c = codes[s];
 1272|  23.8M|        const int l = code_len[s];
 1273|  97.4M|        for (int d = 0; d < l; d++) {
  ------------------
  |  Branch (1273:25): [True: 93.1M, False: 4.27M]
  ------------------
 1274|  93.1M|            const int g = t->base[d] + (int)(c >> (l - d));
 1275|  93.1M|            const int fd = t->flat_d[g];
 1276|  93.1M|            if (fd) {
  ------------------
  |  Branch (1276:17): [True: 19.5M, False: 73.6M]
  ------------------
 1277|  19.5M|                const uint32_t p = cur[g];
 1278|  19.5M|                cur[g] += (uint32_t)fd;
 1279|  19.5M|                uint8_t* q = out + (p >> 3);
 1280|  19.5M|                const uint32_t sh = p & 7U;
 1281|  19.5M|                uint32_t w = (uint32_t)q[0] | ((uint32_t)q[1] << 8) | ((uint32_t)q[2] << 16);
 1282|  19.5M|                w |= (c & ((1U << fd) - 1U)) << sh; /* fd <= 8, sh <= 7: fits 24 bits */
 1283|  19.5M|                q[0] = (uint8_t)w;
 1284|  19.5M|                q[1] = (uint8_t)(w >> 8);
 1285|  19.5M|                q[2] = (uint8_t)(w >> 16);
 1286|  19.5M|                break;
 1287|  19.5M|            }
 1288|  73.6M|            const uint32_t bit = (c >> (l - 1 - d)) & 1U;
 1289|  73.6M|            const uint32_t p = cur[g]++;
 1290|  73.6M|            out[p >> 3] |= (uint8_t)(bit << (p & 7));
 1291|  73.6M|        }
 1292|  23.8M|    }
 1293|  3.63k|    return (int)(hdr + payload);
 1294|  3.63k|}
zxc_huffman.c:zxc_pivco_decode_core:
 2188|  20.4k|                                 const zxc_pivco_tree_t* RESTRICT t, uint8_t* RESTRICT scratch) {
 2189|  20.4k|    if (UNLIKELY(n == 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  20.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 3, False: 20.4k]
  |  |  ------------------
  ------------------
 2190|       |
 2191|       |    // Pass 1, in wire order: node counts from the partition bits, and where
 2192|       |    // each depth's runs start. Leaf-pair children (emitted by their parent) and
 2193|       |    // a flat root's inside get count 0: empty runs, nothing to flag.
 2194|  20.4k|    uint32_t count[ZXC_PIVCO_NODE_SLOTS];
 2195|  20.4k|    const uint8_t* lvl_run[ZXC_HUF_MAX_CODE_LEN_ULTRA];
 2196|  20.4k|    const int slot = t->node_base[t->max_depth + 1];
 2197|  20.4k|    count[0] = (uint32_t)n;
 2198|  20.4k|    count[slot] = 0;
 2199|  20.4k|    const uint8_t* p = payload;
 2200|  20.4k|    const uint8_t* const pend = payload + payload_size;
 2201|   175k|    for (int d = 0; d < t->max_depth; d++) {
  ------------------
  |  Branch (2201:21): [True: 155k, False: 20.4k]
  ------------------
 2202|   155k|        lvl_run[d] = p;
 2203|   155k|        const int L = zxc_pivco_leaves(t, d);
 2204|   155k|        const int N = t->node_base[d + 1] - t->node_base[d];
 2205|   155k|        const int Lc = zxc_pivco_leaves(t, d + 1);
 2206|   155k|        const uint32_t* const cnt = count + t->node_base[d];
 2207|   155k|        uint32_t* const ccnt = count + t->node_base[d + 1];
 2208|   155k|        const uint8_t* const fd = t->flat_d + t->node_base[d];
 2209|  2.81M|        for (int i = L; i < N; i++) {
  ------------------
  |  Branch (2209:25): [True: 2.66M, False: 154k]
  ------------------
 2210|  2.66M|            const uint32_t c = cnt[i];
 2211|  2.66M|            const int k2 = 2 * (i - L); /* first child */
 2212|  2.66M|            if (fd[i]) {
  ------------------
  |  Branch (2212:17): [True: 2.46M, False: 198k]
  ------------------
 2213|       |                // Packed-code run: no partition below, nothing to popcount.
 2214|  2.46M|                const size_t fbytes = zxc_pivco_run_bytes(c, fd[i]);
 2215|  2.46M|                if (UNLIKELY((size_t)(pend - p) < fbytes)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  2.46M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 5, False: 2.46M]
  |  |  ------------------
  ------------------
 2216|  2.46M|                p += fbytes;
 2217|  2.46M|                ccnt[k2] = 0;
 2218|  2.46M|                ccnt[k2 + 1] = 0;
 2219|  2.46M|                continue;
 2220|  2.46M|            }
 2221|   198k|            const size_t nbytes = zxc_pivco_run_bytes(c, 0); /* merge node: c partition bits */
 2222|   198k|            if (UNLIKELY((size_t)(pend - p) < nbytes)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|   198k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 10, False: 198k]
  |  |  ------------------
  ------------------
 2223|       |            // popcount of the c valid bits = the right child's count. All but the
 2224|       |            // last byte counted fast, the last one with its padding masked - if the
 2225|       |            // 8-byte loop swallowed it unmasked, padding bits would inflate `ones`.
 2226|   198k|            uint32_t ones = 0;
 2227|   198k|            if (nbytes) {
  ------------------
  |  Branch (2227:17): [True: 198k, False: 319]
  ------------------
 2228|   198k|                const size_t full = nbytes - 1;
 2229|   198k|                size_t k = 0;
 2230|  5.18M|                for (; k + 8 <= full; k += 8) {
  ------------------
  |  Branch (2230:24): [True: 4.98M, False: 198k]
  ------------------
 2231|  4.98M|                    uint64_t w;
 2232|  4.98M|                    ZXC_MEMCPY(&w, p + k, 8);
  ------------------
  |  |  168|  4.98M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2233|  4.98M|                    ones += (uint32_t)zxc_pivco_popcnt64(w);
 2234|  4.98M|                }
 2235|   819k|                for (; k < full; k++) ones += (uint32_t)zxc_pivco_popcnt32(p[k]);
  ------------------
  |  Branch (2235:24): [True: 621k, False: 198k]
  ------------------
 2236|   198k|                uint8_t last = p[full];
 2237|   198k|                if (c & 7U) last &= (uint8_t)((1U << (c & 7U)) - 1U);
  ------------------
  |  Branch (2237:21): [True: 171k, False: 26.3k]
  ------------------
 2238|   198k|                ones += (uint32_t)zxc_pivco_popcnt32(last);
 2239|   198k|            }
 2240|   198k|            p += nbytes;
 2241|   198k|            if (UNLIKELY(ones > c)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|   198k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 198k]
  |  |  ------------------
  ------------------
 2242|   198k|            const int leaf_pair = k2 + 1 < Lc;
 2243|   198k|            ccnt[k2] = leaf_pair ? 0 : c - ones;
  ------------------
  |  Branch (2243:24): [True: 32.7k, False: 165k]
  ------------------
 2244|   198k|            ccnt[k2 + 1] = leaf_pair ? 0 : ones;
  ------------------
  |  Branch (2244:28): [True: 32.7k, False: 165k]
  ------------------
 2245|   198k|        }
 2246|   155k|    }
 2247|       |    // The slot stands for the lone-symbol root's missing child: no 1 bits.
 2248|  20.4k|    if (UNLIKELY(count[slot] != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  152|  20.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 3, False: 20.4k]
  |  |  ------------------
  ------------------
 2249|       |
 2250|       |    // Pass 2, bottom-up. Runs and children follow position order, so two
 2251|       |    // running offsets replace per-node tables.
 2252|   195k|    for (int d = t->max_depth; d >= 0; d--) {
  ------------------
  |  Branch (2252:32): [True: 175k, False: 20.4k]
  ------------------
 2253|   175k|        uint8_t* const buf_d = (d & 1) ? scratch : dst;
  ------------------
  |  Branch (2253:32): [True: 83.3k, False: 92.1k]
  ------------------
 2254|   175k|        const uint8_t* const buf_c = (d & 1) ? dst : scratch; /* children at d+1 (read-only) */
  ------------------
  |  Branch (2254:38): [True: 83.3k, False: 92.1k]
  ------------------
 2255|   175k|        const int L = zxc_pivco_leaves(t, d);
 2256|   175k|        const int N = t->node_base[d + 1] - t->node_base[d];
 2257|   175k|        const uint32_t* const cnt = count + t->node_base[d];
 2258|   175k|        const uint8_t* const sym = t->syms + t->leaf_base[d];
 2259|   175k|        size_t off = 0;
 2260|  2.85M|        for (int i = 0; i < L; i++) {
  ------------------
  |  Branch (2260:25): [True: 2.67M, False: 175k]
  ------------------
 2261|  2.67M|            if (cnt[i]) ZXC_MEMSET(buf_d + off, sym[i], cnt[i]);
  ------------------
  |  |  173|  25.7k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  |  Branch (2261:17): [True: 25.7k, False: 2.65M]
  ------------------
 2262|  2.67M|            off += cnt[i];
 2263|  2.67M|        }
 2264|   175k|        if (d == t->max_depth) continue; /* leaves only, as in pass 1 */
  ------------------
  |  Branch (2264:13): [True: 20.4k, False: 154k]
  ------------------
 2265|   154k|        const uint8_t* run = lvl_run[d];
 2266|   154k|        const uint32_t* const ccnt = count + t->node_base[d + 1];
 2267|   154k|        const uint8_t* const csym = t->syms + t->leaf_base[d + 1];
 2268|   154k|        const int Lc = zxc_pivco_leaves(t, d + 1);
 2269|   154k|        const uint8_t* const fd = t->flat_d + t->node_base[d];
 2270|   154k|        size_t coff = 0;
 2271|  2.81M|        for (int i = L; i < N; i++) {
  ------------------
  |  Branch (2271:25): [True: 2.66M, False: 154k]
  ------------------
 2272|  2.66M|            const uint32_t c = cnt[i];
 2273|  2.66M|            const int k2 = 2 * (i - L);
 2274|  2.66M|            if (c) {
  ------------------
  |  Branch (2274:17): [True: 323k, False: 2.33M]
  ------------------
 2275|   323k|                if (fd[i]) {
  ------------------
  |  Branch (2275:21): [True: 125k, False: 198k]
  ------------------
 2276|   125k|                    const int D = fd[i];
 2277|   125k|                    const int leaves = zxc_pivco_flat_leaves(t, t->node_base[d] + i, d, D);
 2278|   125k|                    zxc_pivco_unpack_flat(buf_d + off, c, D, run, t->syms + leaves);
 2279|   198k|                } else if (k2 + 1 < Lc) {
  ------------------
  |  Branch (2279:28): [True: 32.5k, False: 165k]
  ------------------
 2280|  32.5k|                    zxc_pivco_emit_leaf_pair(buf_d + off, c, csym[k2], csym[k2 + 1], run);
 2281|   165k|                } else {
 2282|   165k|                    const uint32_t nl = ccnt[k2];
 2283|   165k|                    zxc_pivco_merge(buf_d + off, buf_c + coff, nl, c - nl, run);
 2284|   165k|                }
 2285|   323k|            }
 2286|  2.66M|            run += zxc_pivco_run_bytes(c, fd[i]);
 2287|  2.66M|            off += c;
 2288|  2.66M|            coff += ccnt[k2] + ccnt[k2 + 1];
 2289|  2.66M|        }
 2290|   154k|    }
 2291|  20.4k|    return ZXC_OK;
 2292|  20.4k|}
zxc_huffman.c:zxc_pivco_popcnt64:
 1009|  4.98M|static ZXC_ALWAYS_INLINE int zxc_pivco_popcnt64(const uint64_t v) { return (int)ZXC_POPCOUNT64(v); }
  ------------------
  |  |  157|  4.98M|#define ZXC_POPCOUNT64(v) __builtin_popcountll(v)
  ------------------
zxc_huffman.c:zxc_pivco_popcnt32:
 1007|  40.4M|static ZXC_ALWAYS_INLINE int zxc_pivco_popcnt32(const uint32_t v) { return (int)ZXC_POPCOUNT32(v); }
  ------------------
  |  |  156|  40.4M|#define ZXC_POPCOUNT32(v) __builtin_popcount(v)
  ------------------
zxc_huffman.c:zxc_pivco_unpack_flat:
 1584|   125k|                                  const uint8_t* RESTRICT bits, const uint8_t* RESTRICT c2s) {
 1585|   125k|    size_t i = 0;
 1586|       |#if defined(ZXC_USE_NEON64)
 1587|       |    if (D == 2) {
 1588|       |        uint8_t c2s16[16];
 1589|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 3];
 1590|       |        const uint8x16_t vc2s = vld1q_u8(c2s16);
 1591|       |        static const uint8_t rep4[16] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
 1592|       |        static const int8_t sh2[16] = {0, -2, -4, -6, 0, -2, -4, -6, 0, -2, -4, -6, 0, -2, -4, -6};
 1593|       |        const uint8x16_t vrep = vld1q_u8(rep4);
 1594|       |        const int8x16_t vsh = vld1q_s8(sh2);
 1595|       |        const uint8x16_t vmask = vdupq_n_u8(0x03);
 1596|       |        while (i + 16 <= n) {
 1597|       |            uint8x16_t raw = vdupq_n_u8(0);
 1598|       |            raw = vreinterpretq_u8_u32(
 1599|       |                vsetq_lane_u32(zxc_le32(bits + ((i * 2) >> 3)), vreinterpretq_u32_u8(raw), 0));
 1600|       |            const uint8x16_t rep = vqtbl1q_u8(raw, vrep);
 1601|       |            const uint8x16_t codes = vandq_u8(vshlq_u8(rep, vsh), vmask);
 1602|       |            vst1q_u8(out + i, vqtbl1q_u8(vc2s, codes));
 1603|       |            i += 16;
 1604|       |        }
 1605|       |    } else if (D == 3) {
 1606|       |        // Odd D straddle bytes: build a 16-bit window {byte_j,byte_j+1} per lane
 1607|       |        // (byte_j = Di>>3), right-shift by Di&7, mask D bits. 16/step, two u16x8
 1608|       |        // halves sharing the shift vector. D=3: 6 source bytes.
 1609|       |        uint8_t c2s16[16];
 1610|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 7];
 1611|       |        const uint8x16_t vc2s = vld1q_u8(c2s16); /* 8 entries, padded to 16 */
 1612|       |        static const uint8_t idxA[16] = {0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3};
 1613|       |        static const uint8_t idxB[16] = {3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6};
 1614|       |        static const int16_t sh8[8] = {0, -3, -6, -1, -4, -7, -2, -5};
 1615|       |        const uint8x16_t vidxA = vld1q_u8(idxA);
 1616|       |        const uint8x16_t vidxB = vld1q_u8(idxB);
 1617|       |        const int16x8_t vsh = vld1q_s16(sh8);
 1618|       |        const uint16x8_t vmask = vdupq_n_u16(0x07);
 1619|       |        while (i + 16 <= n) {
 1620|       |            const size_t off = (i * 3) >> 3;
 1621|       |            uint32_t w0;
 1622|       |            uint16_t w1;
 1623|       |            ZXC_MEMCPY(&w0, bits + off, 4);
 1624|       |            ZXC_MEMCPY(&w1, bits + off + 4, 2); /* exactly 6 bytes read */
 1625|       |            uint8x16_t raw = vdupq_n_u8(0);
 1626|       |            raw = vreinterpretq_u8_u32(vsetq_lane_u32(w0, vreinterpretq_u32_u8(raw), 0));
 1627|       |            raw = vreinterpretq_u8_u16(vsetq_lane_u16(w1, vreinterpretq_u16_u8(raw), 2));
 1628|       |            const uint16x8_t winA = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxA));
 1629|       |            const uint16x8_t winB = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxB));
 1630|       |            const uint8x8_t cA = vmovn_u16(vandq_u16(vshlq_u16(winA, vsh), vmask));
 1631|       |            const uint8x8_t cB = vmovn_u16(vandq_u16(vshlq_u16(winB, vsh), vmask));
 1632|       |            vst1q_u8(out + i, vqtbl1q_u8(vc2s, vcombine_u8(cA, cB)));
 1633|       |            i += 16;
 1634|       |        }
 1635|       |    } else if (D == 4) {
 1636|       |        const uint8x16_t vc2s = vld1q_u8(c2s); /* 16 entries */
 1637|       |        static const uint8_t rep2[16] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7};
 1638|       |        static const int8_t sh4[16] = {0, -4, 0, -4, 0, -4, 0, -4, 0, -4, 0, -4, 0, -4, 0, -4};
 1639|       |        const uint8x16_t vrep = vld1q_u8(rep2);
 1640|       |        const int8x16_t vsh = vld1q_s8(sh4);
 1641|       |        const uint8x16_t vmask = vdupq_n_u8(0x0F);
 1642|       |        while (i + 16 <= n) {
 1643|       |            uint8x16_t raw = vdupq_n_u8(0);
 1644|       |            raw = vreinterpretq_u8_u64(
 1645|       |                vsetq_lane_u64(zxc_le64(bits + ((i * 4) >> 3)), vreinterpretq_u64_u8(raw), 0));
 1646|       |            const uint8x16_t rep = vqtbl1q_u8(raw, vrep);
 1647|       |            const uint8x16_t codes = vandq_u8(vshlq_u8(rep, vsh), vmask);
 1648|       |            vst1q_u8(out + i, vqtbl1q_u8(vc2s, codes));
 1649|       |            i += 16;
 1650|       |        }
 1651|       |    } else if (D == 5) {
 1652|       |        // Same window scheme as D=3; c2s has 32 entries (vqtbl2q). 10 bytes.
 1653|       |        const uint8x16x2_t vc2s = vld1q_u8_x2(c2s);
 1654|       |        static const uint8_t idxA[16] = {0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5};
 1655|       |        static const uint8_t idxB[16] = {5, 6, 5, 6, 6, 7, 6, 7, 7, 8, 8, 9, 8, 9, 9, 10};
 1656|       |        static const int16_t sh8[8] = {0, -5, -2, -7, -4, -1, -6, -3};
 1657|       |        const uint8x16_t vidxA = vld1q_u8(idxA);
 1658|       |        const uint8x16_t vidxB = vld1q_u8(idxB);
 1659|       |        const int16x8_t vsh = vld1q_s16(sh8);
 1660|       |        const uint16x8_t vmask = vdupq_n_u16(0x1F);
 1661|       |        while (i + 16 <= n) {
 1662|       |            const size_t off = (i * 5) >> 3;
 1663|       |            uint64_t w0;
 1664|       |            uint16_t w1;
 1665|       |            ZXC_MEMCPY(&w0, bits + off, 8);
 1666|       |            ZXC_MEMCPY(&w1, bits + off + 8, 2);
 1667|       |            uint8x16_t raw = vdupq_n_u8(0);
 1668|       |            raw = vreinterpretq_u8_u64(vsetq_lane_u64(w0, vreinterpretq_u64_u8(raw), 0));
 1669|       |            raw = vreinterpretq_u8_u16(vsetq_lane_u16(w1, vreinterpretq_u16_u8(raw), 4));
 1670|       |            const uint16x8_t winA = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxA));
 1671|       |            const uint16x8_t winB = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxB));
 1672|       |            const uint8x8_t cA = vmovn_u16(vandq_u16(vshlq_u16(winA, vsh), vmask));
 1673|       |            const uint8x8_t cB = vmovn_u16(vandq_u16(vshlq_u16(winB, vsh), vmask));
 1674|       |            vst1q_u8(out + i, vqtbl2q_u8(vc2s, vcombine_u8(cA, cB)));
 1675|       |            i += 16;
 1676|       |        }
 1677|       |    } else if (D == 6) {
 1678|       |        // Same window scheme as D=3; c2s has 64 entries (vqtbl4q). 12 bytes.
 1679|       |        const uint8x16x4_t vc2s = vld1q_u8_x4(c2s);
 1680|       |        static const uint8_t idxA[16] = {0, 1, 0, 1, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 5, 6};
 1681|       |        static const uint8_t idxB[16] = {6, 7, 6, 7, 7, 8, 8, 9, 9, 10, 9, 10, 10, 11, 11, 12};
 1682|       |        static const int16_t sh8[8] = {0, -6, -4, -2, 0, -6, -4, -2};
 1683|       |        const uint8x16_t vidxA = vld1q_u8(idxA);
 1684|       |        const uint8x16_t vidxB = vld1q_u8(idxB);
 1685|       |        const int16x8_t vsh = vld1q_s16(sh8);
 1686|       |        const uint16x8_t vmask = vdupq_n_u16(0x3F);
 1687|       |        while (i + 16 <= n) {
 1688|       |            const size_t off = (i * 6) >> 3;
 1689|       |            uint64_t w0;
 1690|       |            uint32_t w1;
 1691|       |            ZXC_MEMCPY(&w0, bits + off, 8);
 1692|       |            ZXC_MEMCPY(&w1, bits + off + 8, 4);
 1693|       |            uint8x16_t raw = vdupq_n_u8(0);
 1694|       |            raw = vreinterpretq_u8_u64(vsetq_lane_u64(w0, vreinterpretq_u64_u8(raw), 0));
 1695|       |            raw = vreinterpretq_u8_u32(vsetq_lane_u32(w1, vreinterpretq_u32_u8(raw), 2));
 1696|       |            const uint16x8_t winA = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxA));
 1697|       |            const uint16x8_t winB = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxB));
 1698|       |            const uint8x8_t cA = vmovn_u16(vandq_u16(vshlq_u16(winA, vsh), vmask));
 1699|       |            const uint8x8_t cB = vmovn_u16(vandq_u16(vshlq_u16(winB, vsh), vmask));
 1700|       |            vst1q_u8(out + i, vqtbl4q_u8(vc2s, vcombine_u8(cA, cB)));
 1701|       |            i += 16;
 1702|       |        }
 1703|       |    }
 1704|       |#elif defined(ZXC_USE_NEON32)
 1705|       |    // d-register mirrors of the AArch64 kernels: 8 codes per step, c2s lookup
 1706|       |    // via VTBL (16-entry table = two d-registers).
 1707|       |    if (D == 2) {
 1708|       |        uint8_t c2s8[8];
 1709|       |        for (int k = 0; k < 8; k++) c2s8[k] = c2s[k & 3];
 1710|       |        const uint8x8_t vc2s = vld1_u8(c2s8);
 1711|       |        static const uint8_t rep4[8] = {0, 0, 0, 0, 1, 1, 1, 1};
 1712|       |        static const int8_t sh2[8] = {0, -2, -4, -6, 0, -2, -4, -6};
 1713|       |        const uint8x8_t vrep = vld1_u8(rep4);
 1714|       |        const int8x8_t vsh = vld1_s8(sh2);
 1715|       |        const uint8x8_t vmask = vdup_n_u8(0x03);
 1716|       |        while (i + 8 <= n) {
 1717|       |            const uint16_t w = (uint16_t)((uint16_t)bits[(i * 2) >> 3] |
 1718|       |                                          ((uint16_t)bits[((i * 2) >> 3) + 1] << 8));
 1719|       |            const uint8x8_t raw = vreinterpret_u8_u16(vdup_n_u16(w));
 1720|       |            const uint8x8_t rep = vtbl1_u8(raw, vrep);
 1721|       |            const uint8x8_t codes = vand_u8(vshl_u8(rep, vsh), vmask);
 1722|       |            vst1_u8(out + i, vtbl1_u8(vc2s, codes));
 1723|       |            i += 8;
 1724|       |        }
 1725|       |    } else if (D == 3) {
 1726|       |        // 8 codes/step. 3-bit codes straddle bytes, so build a 16-bit window
 1727|       |        // {byte_j, byte_j+1} per lane via two VTBLs, then extract bits [s,s+3)
 1728|       |        // by multiply-by-2^(13-s) then >>13 - ARMv7 has no per-lane u16 variable
 1729|       |        // shift. 8 codes fit in 3 source bytes.
 1730|       |        const uint8x8_t vc2s = vld1_u8(c2s); /* 8 entries (2^3) */
 1731|       |        static const uint8_t idxlo[8] = {0, 1, 0, 1, 0, 1, 1, 2};
 1732|       |        static const uint8_t idxhi[8] = {1, 2, 1, 2, 2, 3, 2, 3};
 1733|       |        static const uint16_t mul8[8] = {8192, 1024, 128, 4096, 512, 64, 2048, 256};
 1734|       |        const uint8x8_t vidxlo = vld1_u8(idxlo);
 1735|       |        const uint8x8_t vidxhi = vld1_u8(idxhi);
 1736|       |        const uint16x8_t vmul = vld1q_u16(mul8);
 1737|       |        const uint16x8_t vmask = vdupq_n_u16(0x07);
 1738|       |        while (i + 8 <= n) {
 1739|       |            const size_t off = (i * 3) >> 3;
 1740|       |            const uint32_t w = (uint32_t)bits[off] | ((uint32_t)bits[off + 1] << 8) |
 1741|       |                               ((uint32_t)bits[off + 2] << 16); /* exactly 3 bytes */
 1742|       |            const uint8x8_t raw = vreinterpret_u8_u32(vdup_n_u32(w));
 1743|       |            const uint8x8_t wlo = vtbl1_u8(raw, vidxlo);
 1744|       |            const uint8x8_t whi = vtbl1_u8(raw, vidxhi);
 1745|       |            const uint16x8_t win = vreinterpretq_u16_u8(vcombine_u8(wlo, whi));
 1746|       |            const uint16x8_t codes16 = vandq_u16(vshrq_n_u16(vmulq_u16(win, vmul), 13), vmask);
 1747|       |            vst1_u8(out + i, vtbl1_u8(vc2s, vmovn_u16(codes16)));
 1748|       |            i += 8;
 1749|       |        }
 1750|       |    } else if (D == 4) {
 1751|       |        /* Register by register: GCC has no AArch32 vld1_u8_x2/_x4 before 14.
 1752|       |         * Loaded once per call, so the tuple form bought nothing anyway. */
 1753|       |        uint8x8x2_t vc2s;
 1754|       |        vc2s.val[0] = vld1_u8(c2s);
 1755|       |        vc2s.val[1] = vld1_u8(c2s + 8);
 1756|       |        static const uint8_t rep2[8] = {0, 0, 1, 1, 2, 2, 3, 3};
 1757|       |        static const int8_t sh4[8] = {0, -4, 0, -4, 0, -4, 0, -4};
 1758|       |        const uint8x8_t vrep = vld1_u8(rep2);
 1759|       |        const int8x8_t vsh = vld1_s8(sh4);
 1760|       |        const uint8x8_t vmask = vdup_n_u8(0x0F);
 1761|       |        while (i + 8 <= n) {
 1762|       |            uint32_t w;
 1763|       |            ZXC_MEMCPY(&w, bits + ((i * 4) >> 3), 4);
 1764|       |            const uint8x8_t raw = vreinterpret_u8_u32(vdup_n_u32(w));
 1765|       |            const uint8x8_t rep = vtbl1_u8(raw, vrep);
 1766|       |            const uint8x8_t codes = vand_u8(vshl_u8(rep, vsh), vmask);
 1767|       |            vst1_u8(out + i, vtbl2_u8(vc2s, codes));
 1768|       |            i += 8;
 1769|       |        }
 1770|       |    } else if (D == 5) {
 1771|       |        // Same window scheme as D=3; c2s has 32 entries (VTBL4). 5 source bytes.
 1772|       |        // Register by register: see D == 4.
 1773|       |        uint8x8x4_t vc2s;
 1774|       |        vc2s.val[0] = vld1_u8(c2s);
 1775|       |        vc2s.val[1] = vld1_u8(c2s + 8);
 1776|       |        vc2s.val[2] = vld1_u8(c2s + 16);
 1777|       |        vc2s.val[3] = vld1_u8(c2s + 24);
 1778|       |        static const uint8_t idxlo[8] = {0, 1, 0, 1, 1, 2, 1, 2};
 1779|       |        static const uint8_t idxhi[8] = {2, 3, 3, 4, 3, 4, 4, 5};
 1780|       |        static const uint16_t mul8[8] = {2048, 64, 512, 16, 128, 1024, 32, 256};
 1781|       |        const uint8x8_t vidxlo = vld1_u8(idxlo);
 1782|       |        const uint8x8_t vidxhi = vld1_u8(idxhi);
 1783|       |        const uint16x8_t vmul = vld1q_u16(mul8);
 1784|       |        const uint16x8_t vmask = vdupq_n_u16(0x1F);
 1785|       |        while (i + 8 <= n) {
 1786|       |            uint64_t w = 0;
 1787|       |            ZXC_MEMCPY(&w, bits + ((i * 5) >> 3), 5);
 1788|       |            const uint8x8_t raw = vcreate_u8(w);
 1789|       |            const uint16x8_t win =
 1790|       |                vreinterpretq_u16_u8(vcombine_u8(vtbl1_u8(raw, vidxlo), vtbl1_u8(raw, vidxhi)));
 1791|       |            const uint8x8_t codes =
 1792|       |                vmovn_u16(vandq_u16(vshrq_n_u16(vmulq_u16(win, vmul), 11), vmask));
 1793|       |            vst1_u8(out + i, vtbl4_u8(vc2s, codes));
 1794|       |            i += 8;
 1795|       |        }
 1796|       |    } else if (D == 6) {
 1797|       |        // Same window scheme; c2s has 64 entries: two VTBL4 halves, select by
 1798|       |        // code bit 5. 6 source bytes.
 1799|       |        uint8x8x4_t lo, hi;  // register by register: see D == 4
 1800|       |        lo.val[0] = vld1_u8(c2s);
 1801|       |        lo.val[1] = vld1_u8(c2s + 8);
 1802|       |        lo.val[2] = vld1_u8(c2s + 16);
 1803|       |        lo.val[3] = vld1_u8(c2s + 24);
 1804|       |        hi.val[0] = vld1_u8(c2s + 32);
 1805|       |        hi.val[1] = vld1_u8(c2s + 40);
 1806|       |        hi.val[2] = vld1_u8(c2s + 48);
 1807|       |        hi.val[3] = vld1_u8(c2s + 56);
 1808|       |        static const uint8_t idxlo[8] = {0, 1, 0, 1, 1, 2, 2, 3};
 1809|       |        static const uint8_t idxhi[8] = {3, 4, 3, 4, 4, 5, 5, 6};
 1810|       |        static const uint16_t mul8[8] = {1024, 16, 64, 256, 1024, 16, 64, 256};
 1811|       |        const uint8x8_t vidxlo = vld1_u8(idxlo);
 1812|       |        const uint8x8_t vidxhi = vld1_u8(idxhi);
 1813|       |        const uint16x8_t vmul = vld1q_u16(mul8);
 1814|       |        const uint16x8_t vmask = vdupq_n_u16(0x3F);
 1815|       |        while (i + 8 <= n) {
 1816|       |            uint64_t w = 0;
 1817|       |            ZXC_MEMCPY(&w, bits + ((i * 6) >> 3), 6);
 1818|       |            const uint8x8_t raw = vcreate_u8(w);
 1819|       |            const uint16x8_t win =
 1820|       |                vreinterpretq_u16_u8(vcombine_u8(vtbl1_u8(raw, vidxlo), vtbl1_u8(raw, vidxhi)));
 1821|       |            const uint8x8_t codes =
 1822|       |                vmovn_u16(vandq_u16(vshrq_n_u16(vmulq_u16(win, vmul), 10), vmask));
 1823|       |            const uint8x8_t sel =
 1824|       |                vbsl_u8(vcge_u8(codes, vdup_n_u8(32)), vtbl4_u8(hi, vsub_u8(codes, vdup_n_u8(32))),
 1825|       |                        vtbl4_u8(lo, codes));
 1826|       |            vst1_u8(out + i, sel);
 1827|       |            i += 8;
 1828|       |        }
 1829|       |    }
 1830|       |#elif defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || \
 1831|       |    (defined(ZXC_USE_SSE2) && defined(__SSE4_1__))
 1832|       |#if defined(ZXC_USE_AVX512) && defined(__AVX512VBMI__)
 1833|       |    /* vpmultishiftqb reads an 8-bit field at an arbitrary bit offset: the
 1834|       |     * unaligned D-bit read, in one instruction. Two facts carry the rest -
 1835|       |     * 64 codes are exactly 8*D bytes and byte-aligned, so the tables are the
 1836|       |     * same every step; and only the low D bits of a field survive, so bytes
 1837|       |     * past 8*D are irrelevant and both accesses can be clamped to the run.
 1838|       |     * Clamping the store also ends the run, hence nothing narrower below. */
 1839|       |    if (D >= 2 && D <= 6) {
 1840|       |        uint8_t arr[64];
 1841|       |        uint8_t shf[64];
 1842|       |        for (int k = 0; k < 8; k++) {
 1843|       |            for (int j = 0; j < 8; j++) {
 1844|       |                arr[k * 8 + j] = (uint8_t)(k * D + j);
 1845|       |                shf[k * 8 + j] = (uint8_t)(j * D);
 1846|       |            }
 1847|       |        }
 1848|       |        const __m512i varr = _mm512_loadu_si512((const void*)arr);
 1849|       |        const __m512i vshf = _mm512_loadu_si512((const void*)shf);
 1850|       |        const __m512i vand = _mm512_set1_epi8((char)((1 << D) - 1));
 1851|       |        /* c2s holds 2^D entries and nothing is guaranteed past them. */
 1852|       |        const __mmask64 tm = (D == 6) ? ~(__mmask64)0 : (((__mmask64)1 << (1 << D)) - 1);
 1853|       |        const __m512i vc2s = _mm512_maskz_loadu_epi8(tm, (const void*)c2s);
 1854|       |        const size_t nbytes = zxc_pivco_run_bytes((uint32_t)n, (uint8_t)D);
 1855|       |        while (i < n) {
 1856|       |            const size_t off = ((size_t)i * (size_t)D) >> 3;
 1857|       |            const size_t avail = nbytes - off;
 1858|       |            const size_t left = n - i;
 1859|       |            const __mmask64 lm = (avail >= 64) ? ~(__mmask64)0 : (((__mmask64)1 << avail) - 1);
 1860|       |            const __mmask64 sm = (left >= 64) ? ~(__mmask64)0 : (((__mmask64)1 << left) - 1);
 1861|       |            const __m512i raw = _mm512_maskz_loadu_epi8(lm, (const void*)(bits + off));
 1862|       |            const __m512i q = _mm512_permutexvar_epi8(varr, raw);
 1863|       |            const __m512i codes = _mm512_and_si512(_mm512_multishift_epi64_epi8(vshf, q), vand);
 1864|       |            _mm512_mask_storeu_epi8((void*)(out + i), sm, _mm512_permutexvar_epi8(codes, vc2s));
 1865|       |            i += 64;
 1866|       |        }
 1867|       |        if (i > n) i = n;
 1868|       |    }
 1869|       |#else
 1870|       |#if defined(ZXC_USE_AVX2)
 1871|       |    /* Codes 16..31 start exactly 2*D bytes in, so the upper half runs the same
 1872|       |     * pattern over a shifted source: one shuffle vector serves both, and packus
 1873|       |     * leaves each half's codes in order in its own lane - no cross-lane fixup.
 1874|       |     * The bound keeps both 16-byte reads inside the run; the exact-length
 1875|       |     * 16-wide loops below take the tail. */
 1876|       |    if (D >= 2 && D <= 6) {
 1877|       |        uint8_t sa[16];
 1878|       |        uint8_t sb[16];
 1879|       |        uint16_t mu[8];
 1880|       |        for (int q = 0; q < 8; q++) {
 1881|       |            const int ba = (q * D) >> 3;
 1882|       |            sa[2 * q] = (uint8_t)ba;
 1883|       |            sa[2 * q + 1] = (uint8_t)(ba + 1);
 1884|       |            sb[2 * q] = (uint8_t)(ba + D); /* code q+8 sits D bytes further */
 1885|       |            sb[2 * q + 1] = (uint8_t)(ba + D + 1);
 1886|       |            mu[q] = (uint16_t)(1U << (16 - D - ((q * D) & 7)));
 1887|       |        }
 1888|       |        const __m256i vsa = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)sa));
 1889|       |        const __m256i vsb = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)sb));
 1890|       |        const __m256i vmu = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)mu));
 1891|       |        const __m256i vand = _mm256_set1_epi8((char)((1 << D) - 1));
 1892|       |        uint8_t tab[64];
 1893|       |        for (int e = 0; e < 64; e++) tab[e] = c2s[e & ((1 << D) - 1)];
 1894|       |        const __m256i t0 = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)tab));
 1895|       |        const __m256i t1 =
 1896|       |            _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)(tab + 16)));
 1897|       |        const __m256i t2 =
 1898|       |            _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)(tab + 32)));
 1899|       |        const __m256i t3 =
 1900|       |            _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)(tab + 48)));
 1901|       |        const size_t nbytes = zxc_pivco_run_bytes((uint32_t)n, (uint8_t)D);
 1902|       |        while (i + 32 <= n && ((size_t)i * (size_t)D >> 3) + (size_t)(2 * D) + 16 <= nbytes) {
 1903|       |            const uint8_t* src = bits + ((size_t)i * (size_t)D >> 3);
 1904|       |            const __m256i raw = _mm256_inserti128_si256(
 1905|       |                _mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(const void*)src)),
 1906|       |                _mm_loadu_si128((const __m128i*)(const void*)(src + 2 * D)), 1);
 1907|       |            const __m256i ca =
 1908|       |                _mm256_srli_epi16(_mm256_mullo_epi16(_mm256_shuffle_epi8(raw, vsa), vmu), 16 - D);
 1909|       |            const __m256i cb =
 1910|       |                _mm256_srli_epi16(_mm256_mullo_epi16(_mm256_shuffle_epi8(raw, vsb), vmu), 16 - D);
 1911|       |            const __m256i codes = _mm256_and_si256(_mm256_packus_epi16(ca, cb), vand);
 1912|       |            __m256i sym;
 1913|       |            if (D <= 4) {
 1914|       |                sym = _mm256_shuffle_epi8(t0, codes);
 1915|       |            } else {
 1916|       |                const __m256i b4 = _mm256_slli_epi16(codes, 3); /* code bit 4 -> sign */
 1917|       |                const __m256i lo = _mm256_blendv_epi8(_mm256_shuffle_epi8(t0, codes),
 1918|       |                                                      _mm256_shuffle_epi8(t1, codes), b4);
 1919|       |                if (D == 5) {
 1920|       |                    sym = lo;
 1921|       |                } else {
 1922|       |                    const __m256i hi = _mm256_blendv_epi8(_mm256_shuffle_epi8(t2, codes),
 1923|       |                                                          _mm256_shuffle_epi8(t3, codes), b4);
 1924|       |                    sym = _mm256_blendv_epi8(lo, hi, _mm256_slli_epi16(codes, 2));
 1925|       |                }
 1926|       |            }
 1927|       |            _mm256_storeu_si256((__m256i*)(void*)(out + i), sym);
 1928|       |            i += 32;
 1929|       |        }
 1930|       |    }
 1931|       |#endif
 1932|       |    if (D == 4) {
 1933|       |        const __m128i vc2s = _mm_loadu_si128((const __m128i*)(const void*)c2s);
 1934|       |        const __m128i vrep = _mm_setr_epi8(0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7);
 1935|       |        const __m128i vmask = _mm_set1_epi8(0x0F);
 1936|       |        // even lanes keep low nibble, odd lanes take the high nibble: shift the
 1937|       |        // replicated bytes right by 4 via a 16-bit shift + odd-lane select.
 1938|       |        const __m128i vodd = _mm_set1_epi16(0x0F00 - 0x0F00 + (short)0xFF00);
 1939|       |        while (i + 16 <= n) {
 1940|       |            const __m128i raw =
 1941|       |                _mm_loadl_epi64((const __m128i*)(const void*)(bits + ((i * 4) >> 3)));
 1942|       |            const __m128i rep = _mm_shuffle_epi8(raw, vrep);
 1943|       |            const __m128i hi = _mm_and_si128(_mm_srli_epi16(rep, 4), _mm_set1_epi8(0x0F));
 1944|       |            const __m128i lo = _mm_and_si128(rep, vmask);
 1945|       |            const __m128i codes = _mm_blendv_epi8(lo, hi, vodd);
 1946|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_shuffle_epi8(vc2s, codes));
 1947|       |            i += 16;
 1948|       |        }
 1949|       |    } else if (D == 2) {
 1950|       |        // 16 codes from 4 bytes. SSE has no per-lane byte shift, so shift by
 1951|       |        // multiply: (b << (6 - 2j)) >> 6 keeps bits [2j+1:2j]. Bytes spread to
 1952|       |        // u16 lanes, times {64,16,4,1}, shifted, then packed back.
 1953|       |        uint8_t c2s16[16];
 1954|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 3];
 1955|       |        const __m128i vc2s = _mm_loadu_si128((const __m128i*)(const void*)c2s16);
 1956|       |        const __m128i vspreadA =
 1957|       |            _mm_setr_epi8(0, (char)0x80, 0, (char)0x80, 0, (char)0x80, 0, (char)0x80, 1, (char)0x80,
 1958|       |                          1, (char)0x80, 1, (char)0x80, 1, (char)0x80);
 1959|       |        const __m128i vspreadB =
 1960|       |            _mm_setr_epi8(2, (char)0x80, 2, (char)0x80, 2, (char)0x80, 2, (char)0x80, 3, (char)0x80,
 1961|       |                          3, (char)0x80, 3, (char)0x80, 3, (char)0x80);
 1962|       |        const __m128i vmul = _mm_setr_epi16(64, 16, 4, 1, 64, 16, 4, 1);
 1963|       |        while (i + 16 <= n) {
 1964|       |            const __m128i raw = _mm_cvtsi32_si128(
 1965|       |                (int)((uint32_t)bits[(i * 2) >> 3] | ((uint32_t)bits[((i * 2) >> 3) + 1] << 8) |
 1966|       |                      ((uint32_t)bits[((i * 2) >> 3) + 2] << 16) |
 1967|       |                      ((uint32_t)bits[((i * 2) >> 3) + 3] << 24)));
 1968|       |            const __m128i a16 =
 1969|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, vspreadA), vmul), 6);
 1970|       |            const __m128i b16 =
 1971|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, vspreadB), vmul), 6);
 1972|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(a16, b16), _mm_set1_epi8(3));
 1973|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_shuffle_epi8(vc2s, codes));
 1974|       |            i += 16;
 1975|       |        }
 1976|       |    } else if (D == 3) {
 1977|       |        // 16-bit window {byte_j,byte_j+1} per lane (byte_j = Di>>3); SSE has no
 1978|       |        // per-lane u16 shift, so extract bits [s,s+D) of window w by w*2^(16-D-s)
 1979|       |        // (field lands in the top D bits) then >>(16-D); s_j = Dj&7. D=3: 6 bytes.
 1980|       |        uint8_t c2s16[16];
 1981|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 7];
 1982|       |        const __m128i vc2s = _mm_loadu_si128((const __m128i*)(const void*)c2s16);
 1983|       |        const __m128i shufA = _mm_setr_epi8(0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3);
 1984|       |        const __m128i shufB = _mm_setr_epi8(3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6);
 1985|       |        const __m128i vmul = _mm_setr_epi16(8192, 1024, 128, 4096, 512, 64, 2048, 256);
 1986|       |        while (i + 16 <= n) {
 1987|       |            const size_t off = (i * 3) >> 3;
 1988|       |            uint32_t w0;
 1989|       |            uint16_t w1;
 1990|       |            ZXC_MEMCPY(&w0, bits + off, 4);
 1991|       |            ZXC_MEMCPY(&w1, bits + off + 4, 2); /* exactly 6 bytes read */
 1992|       |            const __m128i raw = _mm_insert_epi16(_mm_cvtsi32_si128((int)w0), (int16_t)w1, 2);
 1993|       |            const __m128i cA =
 1994|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufA), vmul), 13);
 1995|       |            const __m128i cB =
 1996|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufB), vmul), 13);
 1997|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(cA, cB), _mm_set1_epi8(7));
 1998|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_shuffle_epi8(vc2s, codes));
 1999|       |            i += 16;
 2000|       |        }
 2001|       |    } else if (D == 5) {
 2002|       |        // c2s has 32 entries: pshufb does 16, so select lo/hi by code bit 4.
 2003|       |        const __m128i vlo = _mm_loadu_si128((const __m128i*)(const void*)c2s);
 2004|       |        const __m128i vhi = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 16));
 2005|       |        const __m128i shufA = _mm_setr_epi8(0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5);
 2006|       |        const __m128i shufB = _mm_setr_epi8(5, 6, 5, 6, 6, 7, 6, 7, 7, 8, 8, 9, 8, 9, 9, 10);
 2007|       |        const __m128i vmul = _mm_setr_epi16(2048, 64, 512, 16, 128, 1024, 32, 256);
 2008|       |        while (i + 16 <= n) {
 2009|       |            const size_t off = (i * 5) >> 3;
 2010|       |            uint16_t w1;
 2011|       |            ZXC_MEMCPY(&w1, bits + off + 8, 2); /* 10 source bytes */
 2012|       |            const __m128i raw = _mm_insert_epi16(
 2013|       |                _mm_loadl_epi64((const __m128i*)(const void*)(bits + off)), (int16_t)w1, 4);
 2014|       |            const __m128i cA =
 2015|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufA), vmul), 11);
 2016|       |            const __m128i cB =
 2017|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufB), vmul), 11);
 2018|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(cA, cB), _mm_set1_epi8(0x1F));
 2019|       |            const __m128i sel =
 2020|       |                _mm_blendv_epi8(_mm_shuffle_epi8(vlo, codes), _mm_shuffle_epi8(vhi, codes),
 2021|       |                                _mm_slli_epi16(codes, 3));
 2022|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), sel);
 2023|       |            i += 16;
 2024|       |        }
 2025|       |    } else if (D == 6) {
 2026|       |        // c2s has 64 entries: 4 pshufb sub-tables, select by code bits 4-5.
 2027|       |        const __m128i t0 = _mm_loadu_si128((const __m128i*)(const void*)c2s);
 2028|       |        const __m128i t1 = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 16));
 2029|       |        const __m128i t2 = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 32));
 2030|       |        const __m128i t3 = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 48));
 2031|       |        const __m128i shufA = _mm_setr_epi8(0, 1, 0, 1, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 5, 6);
 2032|       |        const __m128i shufB = _mm_setr_epi8(6, 7, 6, 7, 7, 8, 8, 9, 9, 10, 9, 10, 10, 11, 11, 12);
 2033|       |        const __m128i vmul = _mm_setr_epi16(1024, 16, 64, 256, 1024, 16, 64, 256);
 2034|       |        while (i + 16 <= n) {
 2035|       |            const size_t off = (i * 6) >> 3;
 2036|       |            uint32_t w1;
 2037|       |            ZXC_MEMCPY(&w1, bits + off + 8, 4); /* 12 source bytes */
 2038|       |            const __m128i raw = _mm_insert_epi32(
 2039|       |                _mm_loadl_epi64((const __m128i*)(const void*)(bits + off)), (int)w1, 2);
 2040|       |            const __m128i cA =
 2041|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufA), vmul), 10);
 2042|       |            const __m128i cB =
 2043|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufB), vmul), 10);
 2044|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(cA, cB), _mm_set1_epi8(0x3F));
 2045|       |            const __m128i m4 = _mm_slli_epi16(codes, 3);
 2046|       |            const __m128i lo =
 2047|       |                _mm_blendv_epi8(_mm_shuffle_epi8(t0, codes), _mm_shuffle_epi8(t1, codes), m4);
 2048|       |            const __m128i hi =
 2049|       |                _mm_blendv_epi8(_mm_shuffle_epi8(t2, codes), _mm_shuffle_epi8(t3, codes), m4);
 2050|       |            _mm_storeu_si128((__m128i*)(void*)(out + i),
 2051|       |                             _mm_blendv_epi8(lo, hi, _mm_slli_epi16(codes, 2)));
 2052|       |            i += 16;
 2053|       |        }
 2054|       |    }
 2055|       |#endif /* AVX-512 VBMI, else AVX2 + SSE */
 2056|       |#endif
 2057|       |    // Generic scalar bit-reader (any D).
 2058|   125k|    {
 2059|   125k|        uint64_t bitpos = i * (uint64_t)D;
 2060|   125k|        const uint32_t m = (1U << D) - 1U;
 2061|   125k|        const size_t fbytes = (size_t)(((uint64_t)n * (uint64_t)D + 7U) >> 3);
 2062|  86.1M|        while (i < n) {
  ------------------
  |  Branch (2062:16): [True: 85.9M, False: 125k]
  ------------------
 2063|  85.9M|            const size_t byte = (size_t)(bitpos >> 3);
 2064|  85.9M|            uint32_t w = bits[byte];
 2065|  85.9M|            if (byte + 1 < fbytes) w |= (uint32_t)bits[byte + 1] << 8;
  ------------------
  |  Branch (2065:17): [True: 85.8M, False: 180k]
  ------------------
 2066|  85.9M|            if (D > 8 && byte + 2 < fbytes) w |= (uint32_t)bits[byte + 2] << 16;
  ------------------
  |  Branch (2066:17): [True: 0, False: 85.9M]
  |  Branch (2066:26): [True: 0, False: 0]
  ------------------
 2067|  85.9M|            out[i++] = c2s[(w >> (bitpos & 7U)) & m];
 2068|  85.9M|            bitpos += (uint64_t)D;
 2069|  85.9M|        }
 2070|   125k|    }
 2071|   125k|}
zxc_huffman.c:zxc_pivco_emit_leaf_pair:
 2083|  32.5k|                                                       const uint8_t* RESTRICT bits) {
 2084|  32.5k|    size_t i = 0;
 2085|       |#if defined(ZXC_USE_NEON64)
 2086|       |    const uint8x16_t vsym0 = vdupq_n_u8(sym0);
 2087|       |    const uint8x16_t vdelta = vdupq_n_u8((uint8_t)(sym0 ^ sym1));
 2088|       |    static const uint8_t rep_idx[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
 2089|       |    static const uint8_t bit_sel[16] = {1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128};
 2090|       |    const uint8x16_t vrep = vld1q_u8(rep_idx);
 2091|       |    const uint8x16_t vsel = vld1q_u8(bit_sel);
 2092|       |    while (i + 16 <= n) {
 2093|       |        uint8x16_t ctrl = vdupq_n_u8(0);
 2094|       |        ctrl = vsetq_lane_u8(bits[i >> 3], ctrl, 0);
 2095|       |        ctrl = vsetq_lane_u8(bits[(i >> 3) + 1], ctrl, 1);
 2096|       |        const uint8x16_t rep = vqtbl1q_u8(ctrl, vrep);
 2097|       |        const uint8x16_t mask = vtstq_u8(rep, vsel);
 2098|       |        vst1q_u8(out + i, veorq_u8(vsym0, vandq_u8(vdelta, mask)));
 2099|       |        i += 16;
 2100|       |    }
 2101|       |#elif defined(ZXC_USE_NEON32)
 2102|       |    const uint8x8_t vsym0 = vdup_n_u8(sym0);
 2103|       |    const uint8x8_t vdelta = vdup_n_u8((uint8_t)(sym0 ^ sym1));
 2104|       |    static const uint8_t bit_sel8[8] = {1, 2, 4, 8, 16, 32, 64, 128};
 2105|       |    const uint8x8_t vsel = vld1_u8(bit_sel8);
 2106|       |    while (i + 8 <= n) {
 2107|       |        const uint8x8_t mask = vtst_u8(vdup_n_u8(bits[i >> 3]), vsel);
 2108|       |        vst1_u8(out + i, veor_u8(vsym0, vand_u8(vdelta, mask)));
 2109|       |        i += 8;
 2110|       |    }
 2111|       |#elif defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || \
 2112|       |    (defined(ZXC_USE_SSE2) && defined(__SSSE3__))
 2113|       |#if defined(ZXC_USE_AVX512)
 2114|       |    /* The control word is already the blend mask; the masked store takes the
 2115|       |     * tail, hence nothing narrower below. */
 2116|       |    {
 2117|       |        const __m512i z0 = _mm512_set1_epi8((char)sym0);
 2118|       |        const __m512i z1 = _mm512_set1_epi8((char)sym1);
 2119|       |        while (i < n) {
 2120|       |            const size_t left = n - i;
 2121|       |            const size_t cb = (left + 7) >> 3;
 2122|       |            uint64_t ctrl = 0;
 2123|       |            ZXC_MEMCPY(&ctrl, bits + (i >> 3), cb < 8 ? cb : 8); /* not past the run */
 2124|       |            const __mmask64 sm = (left >= 64) ? ~(__mmask64)0 : (((__mmask64)1 << left) - 1);
 2125|       |            _mm512_mask_storeu_epi8((void*)(out + i), sm,
 2126|       |                                    _mm512_mask_blend_epi8((__mmask64)ctrl, z0, z1));
 2127|       |            i += 64;
 2128|       |        }
 2129|       |        if (i > n) i = n;
 2130|       |    }
 2131|       |#else
 2132|       |#if defined(ZXC_USE_AVX2)
 2133|       |    /* Broadcasting the control dword lets each 128-bit half pick its own two
 2134|       |     * bytes out of it. */
 2135|       |    {
 2136|       |        const __m256i y0 = _mm256_set1_epi8((char)sym0);
 2137|       |        const __m256i ydelta = _mm256_set1_epi8((char)(uint8_t)(sym0 ^ sym1));
 2138|       |        const __m256i yrep = _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
 2139|       |                                              2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3);
 2140|       |        const __m256i ysel =
 2141|       |            _mm256_setr_epi8(1, 2, 4, 8, 16, 32, 64, (char)128, 1, 2, 4, 8, 16, 32, 64, (char)128,
 2142|       |                             1, 2, 4, 8, 16, 32, 64, (char)128, 1, 2, 4, 8, 16, 32, 64, (char)128);
 2143|       |        while (i + 32 <= n) {
 2144|       |            uint32_t c4;
 2145|       |            ZXC_MEMCPY(&c4, bits + (i >> 3), 4);
 2146|       |            const __m256i rep = _mm256_shuffle_epi8(_mm256_set1_epi32((int)c4), yrep);
 2147|       |            const __m256i mask = _mm256_cmpeq_epi8(_mm256_and_si256(rep, ysel), ysel);
 2148|       |            _mm256_storeu_si256((__m256i*)(void*)(out + i),
 2149|       |                                _mm256_xor_si256(y0, _mm256_and_si256(ydelta, mask)));
 2150|       |            i += 32;
 2151|       |        }
 2152|       |    }
 2153|       |#endif
 2154|       |    const __m128i vsym0 = _mm_set1_epi8((char)sym0);
 2155|       |    const __m128i vdelta = _mm_set1_epi8((char)(uint8_t)(sym0 ^ sym1));
 2156|       |    const __m128i vrep = _mm_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
 2157|       |    const __m128i vsel =
 2158|       |        _mm_setr_epi8(1, 2, 4, 8, 16, 32, 64, (char)128, 1, 2, 4, 8, 16, 32, 64, (char)128);
 2159|       |    while (i + 16 <= n) {
 2160|       |        const __m128i ctrl = _mm_cvtsi32_si128(bits[i >> 3] | ((int)bits[(i >> 3) + 1] << 8));
 2161|       |        const __m128i rep = _mm_shuffle_epi8(ctrl, vrep);
 2162|       |        // lanes where the selected bit is set -> 0xFF
 2163|       |        const __m128i mask = _mm_cmpeq_epi8(_mm_and_si128(rep, vsel), vsel);
 2164|       |        _mm_storeu_si128((__m128i*)(void*)(out + i),
 2165|       |                         _mm_xor_si128(vsym0, _mm_and_si128(vdelta, mask)));
 2166|       |        i += 16;
 2167|       |    }
 2168|       |#endif /* AVX-512, else AVX2 + SSE */
 2169|       |#endif
 2170|  7.53M|    while (i < n) {
  ------------------
  |  Branch (2170:12): [True: 7.50M, False: 32.5k]
  ------------------
 2171|  7.50M|        const int bit = (bits[i >> 3] >> (i & 7)) & 1;
 2172|  7.50M|        out[i++] = bit ? sym1 : sym0;
  ------------------
  |  Branch (2172:20): [True: 3.65M, False: 3.85M]
  ------------------
 2173|  7.50M|    }
 2174|  32.5k|}
zxc_huffman.c:zxc_pivco_merge:
 1403|   165k|                                              const uint8_t* RESTRICT bits) {
 1404|   165k|    const uint8_t* L = src;
 1405|   165k|    const uint8_t* R = src + nl;
 1406|   165k|    const size_t n = nl + nr;
 1407|   165k|    size_t i = 0;
 1408|   165k|    size_t lp = 0;
 1409|   165k|    size_t rp = 0;
 1410|       |    // MSan keeps the shadow of the bytes a shuffle loads but never selects.
 1411|   165k|    ZXC_MSAN_UNPOISON(src + n, 16);
  ------------------
  |  |  268|   165k|#define ZXC_MSAN_UNPOISON(p, n) ((void)0)
  ------------------
 1412|       |#if defined(ZXC_USE_NEON64)
 1413|       |    // 16 outputs per step: two-register TBL over {L[0..15], R[0..15]} with the
 1414|       |    // signed-index tables (see zxc_pivco_tables.h).
 1415|       |    while (i + 16 <= n) {
 1416|       |        const uint8_t b0 = bits[i >> 3];
 1417|       |        const uint8_t b1 = bits[(i >> 3) + 1];
 1418|       |        uint8x16x2_t tb;
 1419|       |        tb.val[0] = vld1q_u8(L + lp);
 1420|       |        tb.val[1] = vld1q_u8(R + rp);
 1421|       |        const size_t pc0 = (size_t)ZXC_PIVCO_POPCNT8(b0);
 1422|       |        const uint8x8_t ia = vld1_u8(zxc_pivco_idxa_u8[b0]);
 1423|       |        const uint8x8_t ib = vld1_u8(zxc_pivco_idxb_pre[pc0][b1]);
 1424|       |        vst1q_u8(out + i, vqtbl2q_u8(tb, vcombine_u8(ia, ib)));
 1425|       |        const size_t pc = pc0 + (size_t)ZXC_PIVCO_POPCNT8(b1);
 1426|       |        ZXC_PIVCO_MERGE_STEP(16, pc);
 1427|       |    }
 1428|       |#else /* x86 tiers */
 1429|       |#if defined(ZXC_USE_AVX512) && defined(__AVX512VBMI2__)
 1430|       |    // 64 outputs per step: the merge IS a pair of byte expands - L's bytes fill
 1431|       |    // the control word's 0-bit lanes, R's the 1-bit lanes. The masked expand
 1432|       |    // loads only touch the bytes they consume, so the speculative reads stay
 1433|       |    // fault-safe without extra buffer slack.
 1434|       |    const __m512i zero = _mm512_setzero_si512();
 1435|       |    while (i + 64 <= n) {
 1436|       |        uint64_t ctrl;
 1437|       |        ZXC_MEMCPY(&ctrl, bits + (i >> 3), 8);
 1438|       |        const __m512i vl =
 1439|       |            _mm512_mask_expandloadu_epi8(zero, (__mmask64)~ctrl, (const void*)(L + lp));
 1440|       |        const __m512i outv =
 1441|       |            _mm512_mask_expandloadu_epi8(vl, (__mmask64)ctrl, (const void*)(R + rp));
 1442|       |        _mm512_storeu_si512((void*)(out + i), outv);
 1443|       |        const int pc = zxc_pivco_popcnt64(ctrl);
 1444|       |        ZXC_PIVCO_MERGE_STEP(64, pc);
 1445|       |    }
 1446|       |#endif
 1447|       |#if defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || \
 1448|       |    (defined(ZXC_USE_SSE2) && defined(__SSSE3__))
 1449|       |    // 16 outputs/step: pshufb(L, ix+0x70) | pshufb(R, ix-16) selects L[ix] or
 1450|       |    // R[ix-16] (out-of-range lanes zero out); 32/step unrolls it twice.
 1451|       |#if defined(ZXC_USE_AVX2)
 1452|       |    // Same thing at 256 bits, 32 outputs/step. Both selects take the index
 1453|       |    // unbiased: table lanes all sit in [0, 31], so pshufb masks to 4 bits and
 1454|       |    // bit 4 is the L/R selector - shifted into the sign it drives the blend,
 1455|       |    // and both bias vectors go away. L and R stay two 128-bit loads: the
 1456|       |    // second cursor is lp + (16 - pcA), never lp + 16.
 1457|       |    while (i + 32 <= n) {
 1458|       |        const uint8_t* cb = bits + (i >> 3);
 1459|       |        const size_t pcA0 = (size_t)zxc_pivco_popcnt32(cb[0]);
 1460|       |        const size_t pcA = pcA0 + (size_t)zxc_pivco_popcnt32(cb[1]);
 1461|       |        const size_t pcB0 = (size_t)zxc_pivco_popcnt32(cb[2]);
 1462|       |        const size_t pcB = pcB0 + (size_t)zxc_pivco_popcnt32(cb[3]);
 1463|       |        const size_t lpB = lp + (16 - pcA);
 1464|       |        const size_t rpB = rp + pcA;
 1465|       |        const __m256i vl = _mm256_inserti128_si256(
 1466|       |            _mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(const void*)(L + lp))),
 1467|       |            _mm_loadu_si128((const __m128i*)(const void*)(L + lpB)), 1);
 1468|       |        const __m256i vr = _mm256_inserti128_si256(
 1469|       |            _mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(const void*)(R + rp))),
 1470|       |            _mm_loadu_si128((const __m128i*)(const void*)(R + rpB)), 1);
 1471|       |        const __m128i ixA = _mm_unpacklo_epi64(
 1472|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[0]]),
 1473|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcA0][cb[1]]));
 1474|       |        const __m128i ixB = _mm_unpacklo_epi64(
 1475|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[2]]),
 1476|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcB0][cb[3]]));
 1477|       |        const __m256i ix = _mm256_inserti128_si256(_mm256_castsi128_si256(ixA), ixB, 1);
 1478|       |        _mm256_storeu_si256(
 1479|       |            (__m256i*)(void*)(out + i),
 1480|       |            _mm256_blendv_epi8(_mm256_shuffle_epi8(vl, ix), _mm256_shuffle_epi8(vr, ix),
 1481|       |                               _mm256_slli_epi16(ix, 3)));
 1482|       |        lp = lpB + (16 - pcB);
 1483|       |        rp = rpB + pcB;
 1484|       |        i += 32;
 1485|       |    }
 1486|       |#else
 1487|       |    while (i + 32 <= n) {
 1488|       |        const uint8_t* cb = bits + (i >> 3);
 1489|       |        const size_t pcA0 = (size_t)zxc_pivco_popcnt32(cb[0]);
 1490|       |        const size_t pcA = pcA0 + (size_t)zxc_pivco_popcnt32(cb[1]);
 1491|       |        const size_t pcB0 = (size_t)zxc_pivco_popcnt32(cb[2]);
 1492|       |        const size_t pcB = pcB0 + (size_t)zxc_pivco_popcnt32(cb[3]);
 1493|       |        const size_t lpB = lp + (16 - pcA);
 1494|       |        const size_t rpB = rp + pcA;
 1495|       |        const __m128i vlA = _mm_loadu_si128((const __m128i*)(const void*)(L + lp));
 1496|       |        const __m128i vrA = _mm_loadu_si128((const __m128i*)(const void*)(R + rp));
 1497|       |        const __m128i vlB = _mm_loadu_si128((const __m128i*)(const void*)(L + lpB));
 1498|       |        const __m128i vrB = _mm_loadu_si128((const __m128i*)(const void*)(R + rpB));
 1499|       |        const __m128i iaA = _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[0]]);
 1500|       |        const __m128i ibA =
 1501|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcA0][cb[1]]);
 1502|       |        const __m128i iaB = _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[2]]);
 1503|       |        const __m128i ibB =
 1504|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcB0][cb[3]]);
 1505|       |        const __m128i ixA = _mm_unpacklo_epi64(iaA, ibA);
 1506|       |        const __m128i ixB = _mm_unpacklo_epi64(iaB, ibB);
 1507|       |        const __m128i selA =
 1508|       |            _mm_or_si128(_mm_shuffle_epi8(vlA, _mm_add_epi8(ixA, _mm_set1_epi8(0x70))),
 1509|       |                         _mm_shuffle_epi8(vrA, _mm_sub_epi8(ixA, _mm_set1_epi8(16))));
 1510|       |        const __m128i selB =
 1511|       |            _mm_or_si128(_mm_shuffle_epi8(vlB, _mm_add_epi8(ixB, _mm_set1_epi8(0x70))),
 1512|       |                         _mm_shuffle_epi8(vrB, _mm_sub_epi8(ixB, _mm_set1_epi8(16))));
 1513|       |        _mm_storeu_si128((__m128i*)(void*)(out + i), selA);
 1514|       |        _mm_storeu_si128((__m128i*)(void*)(out + i + 16), selB);
 1515|       |        lp = lpB + (16 - pcB);
 1516|       |        rp = rpB + pcB;
 1517|       |        i += 32;
 1518|       |    }
 1519|       |#endif
 1520|       |    while (i + 16 <= n) {
 1521|       |        const uint8_t b0 = bits[i >> 3];
 1522|       |        const uint8_t b1 = bits[(i >> 3) + 1];
 1523|       |        const __m128i vl = _mm_loadu_si128((const __m128i*)(const void*)(L + lp));
 1524|       |        const __m128i vr = _mm_loadu_si128((const __m128i*)(const void*)(R + rp));
 1525|       |        const int pc0 = zxc_pivco_popcnt32(b0);
 1526|       |        const __m128i ia = _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[b0]);
 1527|       |        const __m128i ib =
 1528|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pc0][b1]);
 1529|       |        const __m128i ix = _mm_unpacklo_epi64(ia, ib);
 1530|       |        const __m128i sell = _mm_shuffle_epi8(vl, _mm_add_epi8(ix, _mm_set1_epi8(0x70)));
 1531|       |        const __m128i selr = _mm_shuffle_epi8(vr, _mm_sub_epi8(ix, _mm_set1_epi8(16)));
 1532|       |        _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_or_si128(sell, selr));
 1533|       |        const int pc = pc0 + zxc_pivco_popcnt32(b1);
 1534|       |        ZXC_PIVCO_MERGE_STEP(16, pc);
 1535|       |    }
 1536|       |#elif defined(ZXC_USE_NEON32)
 1537|       |    // 8 outputs per step: four-register VTBL over {L[0..7], -, R[0..7], -}. The
 1538|       |    // shared index tables address a 32-lane view, and an 8-output step only
 1539|       |    // touches lanes 0..7 and 16..23, so the two spare d-registers stay zero.
 1540|       |    while (i + 8 <= n) {
 1541|       |        const uint8_t b = bits[i >> 3];
 1542|       |        uint8x8x4_t tb;
 1543|       |        tb.val[0] = vld1_u8(L + lp);
 1544|       |        tb.val[1] = vdup_n_u8(0);
 1545|       |        tb.val[2] = vld1_u8(R + rp);
 1546|       |        tb.val[3] = vdup_n_u8(0);
 1547|       |        vst1_u8(out + i, vtbl4_u8(tb, vld1_u8(zxc_pivco_idxa_u8[b])));
 1548|       |        const int pc = zxc_pivco_popcnt32(b);
 1549|       |        ZXC_PIVCO_MERGE_STEP(8, pc);
 1550|       |    }
 1551|       |#endif
 1552|   165k|#endif /* x86 tiers */
 1553|       |    // Portable 8-output path: byte selects from a 24-byte scratch laid out
 1554|       |    // as the low half of the 32-lane view the shared index tables assume
 1555|       |    // (L at offset 0, R at offset 16).
 1556|  39.7M|    while (i + 8 <= n) {
  ------------------
  |  Branch (1556:12): [True: 39.5M, False: 165k]
  ------------------
 1557|  39.5M|        const uint8_t b = bits[i >> 3];
 1558|  39.5M|        uint8_t comb[24];
 1559|  39.5M|        ZXC_MEMCPY(comb, L + lp, 8);
  ------------------
  |  |  168|  39.5M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1560|  39.5M|        ZXC_MEMCPY(comb + 16, R + rp, 8);
  ------------------
  |  |  168|  39.5M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1561|  39.5M|        const uint8_t* ix = zxc_pivco_idxa_u8[b];
 1562|   356M|        for (int j = 0; j < 8; j++) out[i + (size_t)j] = comb[ix[j]];
  ------------------
  |  Branch (1562:25): [True: 316M, False: 39.5M]
  ------------------
 1563|  39.5M|        const int pc = zxc_pivco_popcnt32(b);
 1564|  39.5M|        ZXC_PIVCO_MERGE_STEP(8, pc);
  ------------------
  |  | 1371|  39.5M|    do {                            \
  |  | 1372|  39.5M|        rp += (size_t)(pc);         \
  |  | 1373|  39.5M|        lp += (size_t)((w) - (pc)); \
  |  | 1374|  39.5M|        i += (w);                   \
  |  | 1375|  39.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1375:14): [Folded, False: 39.5M]
  |  |  ------------------
  ------------------
 1565|  39.5M|    }
 1566|   743k|    while (i < n) {
  ------------------
  |  Branch (1566:12): [True: 578k, False: 165k]
  ------------------
 1567|   578k|        const int bit = (bits[i >> 3] >> (i & 7)) & 1;
 1568|   578k|        out[i++] = bit ? R[rp++] : L[lp++];
  ------------------
  |  Branch (1568:20): [True: 305k, False: 272k]
  ------------------
 1569|   578k|    }
 1570|   165k|}

zxc_common.c:zxc_opt_dp_sizes:
 1129|  10.8k|                                               size_t* RESTRICT sz_bm) {
 1130|  10.8k|    *sz_dp = ZXC_ALIGN_CL((chunk_size + 1) * sizeof(uint32_t));
  ------------------
  |  |  384|  10.8k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1131|  10.8k|    *sz_pl = ZXC_ALIGN_CL((chunk_size + 1) * sizeof(uint16_t));
  ------------------
  |  |  384|  10.8k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1132|  10.8k|    *sz_po = ZXC_ALIGN_CL((chunk_size + 1) * sizeof(uint16_t));
  ------------------
  |  |  384|  10.8k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1133|  10.8k|    *sz_bm = ZXC_ALIGN_CL(ZXC_BITMAP_WORDS(chunk_size + 1) * sizeof(uint64_t));
  ------------------
  |  |  384|  10.8k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  10.8k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  10.8k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1134|  10.8k|}
zxc_common.c:zxc_log2_u32:
 1145|   120k|static ZXC_ALWAYS_INLINE uint32_t zxc_log2_u32(const uint32_t v) {
 1146|       |#ifdef _MSC_VER
 1147|       |    unsigned long index;
 1148|       |    return (v == 0) ? 0 : (_BitScanReverse(&index, v) ? index : 0);
 1149|       |#else
 1150|   120k|    return (v == 0) ? 0 : (uint32_t)(31 - __builtin_clz(v));
  ------------------
  |  Branch (1150:12): [True: 0, False: 120k]
  ------------------
 1151|   120k|#endif
 1152|   120k|}
zxc_common.c:zxc_store_le32:
 1485|  68.2k|static ZXC_ALWAYS_INLINE void zxc_store_le32(void* p, const uint32_t v) {
 1486|       |#ifdef ZXC_BIG_ENDIAN
 1487|       |    const uint32_t s = ZXC_BSWAP32(v);
 1488|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1489|       |#else
 1490|  68.2k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  168|  68.2k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1491|  68.2k|#endif
 1492|  68.2k|}
zxc_common.c:zxc_le32:
 1385|   230k|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1386|   230k|    uint32_t v;
 1387|   230k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  168|   230k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1388|       |#ifdef ZXC_BIG_ENDIAN
 1389|       |    return ZXC_BSWAP32(v);
 1390|       |#else
 1391|   230k|    return v;
 1392|   230k|#endif
 1393|   230k|}
zxc_common.c:zxc_le64:
 1448|  23.0k|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1449|  23.0k|    uint64_t v;
 1450|  23.0k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  168|  23.0k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1451|       |#ifdef ZXC_BIG_ENDIAN
 1452|       |    return ZXC_BSWAP64(v);
 1453|       |#else
 1454|  23.0k|    return v;
 1455|  23.0k|#endif
 1456|  23.0k|}
zxc_common.c:zxc_hash8:
 1524|  23.0k|static ZXC_ALWAYS_INLINE uint8_t zxc_hash8(const uint8_t* p) {
 1525|  23.0k|    const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  797|  23.0k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
                  const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  797|  23.0k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1526|       |
 1527|  23.0k|    return (uint8_t)(h >> 56);
 1528|  23.0k|}
zxc_compress.c:zxc_store_le32:
 1485|  9.88k|static ZXC_ALWAYS_INLINE void zxc_store_le32(void* p, const uint32_t v) {
 1486|       |#ifdef ZXC_BIG_ENDIAN
 1487|       |    const uint32_t s = ZXC_BSWAP32(v);
 1488|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1489|       |#else
 1490|  9.88k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  168|  9.88k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1491|  9.88k|#endif
 1492|  9.88k|}
zxc_compress.c:zxc_checksum:
 1732|  9.88k|                                               const uint64_t seed, const uint8_t hash_method) {
 1733|  9.88k|    (void)hash_method; /* single algorithm for now; extend when adding more */
 1734|  9.88k|    const uint64_t hash = rapidhash_withSeed(input, len, seed);
 1735|       |
 1736|       |    return (uint32_t)(hash ^ (hash >> (sizeof(uint32_t) * CHAR_BIT)));
 1737|  9.88k|}
zxc_compress.c:zxc_get_lz77_params:
 1249|  35.2k|static ZXC_ALWAYS_INLINE zxc_lz77_params_t zxc_get_lz77_params(const int level) {
 1250|       |    // The distance floor stops at level 5: the slow levels keep every distance.
 1251|       |    // Default match splitting at levels 3-5 only: 1-2 are PAK; favor_decode_speed
 1252|       |    // also reaches 6-7.
 1253|       |    // search_depth, sufficient_len, use_lazy, lazy_attempts, lazy_len_threshold, step_base,
 1254|       |    // step_shift, min_offset, split_max
 1255|  35.2k|    static const zxc_lz77_params_t table[7] = {
 1256|  35.2k|        {3, 16, 0, 0, 0, 4, 4, ZXC_LZ_MINDIST, 0},        // fallback
  ------------------
  |  |  745|  35.2k|#define ZXC_LZ_MINDIST 32
  ------------------
 1257|  35.2k|        {3, 16, 0, 0, 0, 4, 4, ZXC_LZ_MINDIST, 0},        // level 1
  ------------------
  |  |  745|  35.2k|#define ZXC_LZ_MINDIST 32
  ------------------
 1258|  35.2k|        {3, 18, 0, 0, 0, 3, 6, ZXC_LZ_MINDIST, 0},        // level 2
  ------------------
  |  |  745|  35.2k|#define ZXC_LZ_MINDIST 32
  ------------------
 1259|  35.2k|        {3, 16, 1, 4, 128, 1, 4, ZXC_LZ_MINDIST, 33},     // level 3
  ------------------
  |  |  745|  35.2k|#define ZXC_LZ_MINDIST 32
  ------------------
 1260|  35.2k|        {3, 18, 1, 4, 128, 1, 5, ZXC_LZ_MINDIST, 24},     // level 4
  ------------------
  |  |  745|  35.2k|#define ZXC_LZ_MINDIST 32
  ------------------
 1261|  35.2k|        {64, 256, 1, 16, 128, 1, 8, ZXC_LZ_MINDIST, 23},  // level 5
  ------------------
  |  |  745|  35.2k|#define ZXC_LZ_MINDIST 32
  ------------------
 1262|  35.2k|        {64, 256, 0, 0, 0, 1, 8, 1, 0}                    // level 6
 1263|  35.2k|    };
 1264|  35.2k|    return (level >= ZXC_LEVEL_ULTRA)
  ------------------
  |  Branch (1264:12): [True: 7.35k, False: 27.9k]
  ------------------
 1265|  35.2k|               ? (zxc_lz77_params_t){128, 256, 0, 0, 0, 1, 8, 1, 0}
 1266|  35.2k|               : table[level < ZXC_LEVEL_FASTEST ? ZXC_LEVEL_FASTEST : level];
  ------------------
  |  Branch (1266:24): [True: 0, False: 27.9k]
  ------------------
 1267|  35.2k|}
zxc_compress.c:zxc_block_is_short_dist_bound:
 1408|  12.2k|                                                           const size_t size) {
 1409|  12.2k|    const size_t d_max = ZXC_LZ_MINDIST;
  ------------------
  |  |  745|  12.2k|#define ZXC_LZ_MINDIST 32
  ------------------
 1410|       |    // Too small to sample, and too small to gain: keep every distance.
 1411|  12.2k|    if (size < d_max + sizeof(uint32_t)) return 1;
  ------------------
  |  Branch (1411:9): [True: 2.40k, False: 9.80k]
  ------------------
 1412|       |
 1413|  9.80k|    size_t want = size / ZXC_LZ_MINDIST_PROBE_PER_KB;
  ------------------
  |  |  752|  9.80k|#define ZXC_LZ_MINDIST_PROBE_PER_KB 1024
  ------------------
 1414|  9.80k|    if (want < ZXC_LZ_MINDIST_PROBE_MIN) want = ZXC_LZ_MINDIST_PROBE_MIN;
  ------------------
  |  |  753|  9.80k|#define ZXC_LZ_MINDIST_PROBE_MIN 16
  ------------------
                  if (want < ZXC_LZ_MINDIST_PROBE_MIN) want = ZXC_LZ_MINDIST_PROBE_MIN;
  ------------------
  |  |  753|  7.96k|#define ZXC_LZ_MINDIST_PROBE_MIN 16
  ------------------
  |  Branch (1414:9): [True: 7.96k, False: 1.84k]
  ------------------
 1415|  9.80k|    if (want > ZXC_LZ_MINDIST_PROBE_MAX) want = ZXC_LZ_MINDIST_PROBE_MAX;
  ------------------
  |  |  754|  9.80k|#define ZXC_LZ_MINDIST_PROBE_MAX 64
  ------------------
                  if (want > ZXC_LZ_MINDIST_PROBE_MAX) want = ZXC_LZ_MINDIST_PROBE_MAX;
  ------------------
  |  |  754|  1.32k|#define ZXC_LZ_MINDIST_PROBE_MAX 64
  ------------------
  |  Branch (1415:9): [True: 1.32k, False: 8.47k]
  ------------------
 1416|  9.80k|    size_t stride = size / want;
 1417|  9.80k|    if (stride < d_max) stride = d_max;
  ------------------
  |  Branch (1417:9): [True: 5.68k, False: 4.12k]
  ------------------
 1418|       |
 1419|  9.80k|    const size_t planned = (size - sizeof(uint32_t) - d_max) / stride + 1;
 1420|  9.80k|    const size_t bar = (size_t)ZXC_LZ_MINDIST_MAX_SHORT_PCT * planned;
  ------------------
  |  |  762|  9.80k|#define ZXC_LZ_MINDIST_MAX_SHORT_PCT 20
  ------------------
 1421|       |
 1422|  9.80k|    size_t samples = 0;
 1423|  9.80k|    size_t hits = 0;
 1424|   101k|    for (size_t i = d_max; i + sizeof(uint32_t) <= size; i += stride) {
  ------------------
  |  Branch (1424:28): [True: 101k, False: 0]
  ------------------
 1425|   101k|        const uint32_t cur = zxc_le32(blk + i);
 1426|   101k|        samples++;
 1427|  2.24M|        for (size_t d = 1; d < d_max; d++) {
  ------------------
  |  Branch (1427:28): [True: 2.18M, False: 66.3k]
  ------------------
 1428|  2.18M|            if (zxc_le32(blk + i - d) == cur) {
  ------------------
  |  Branch (1428:17): [True: 34.6k, False: 2.14M]
  ------------------
 1429|  34.6k|                hits++;
 1430|  34.6k|                break;
 1431|  34.6k|            }
 1432|  2.18M|        }
 1433|   101k|        if (hits * 100U > bar) return 1;                           // can only rise
  ------------------
  |  Branch (1433:13): [True: 7.80k, False: 93.2k]
  ------------------
 1434|  93.2k|        if ((hits + (planned - samples)) * 100U <= bar) return 0;  // out of reach
  ------------------
  |  Branch (1434:13): [True: 2.00k, False: 91.2k]
  ------------------
 1435|  93.2k|    }
 1436|      0|    return hits * 100U > bar;
 1437|  9.80k|}
zxc_compress.c:zxc_le32:
 1385|  4.51G|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1386|  4.51G|    uint32_t v;
 1387|  4.51G|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  168|  4.51G|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1388|       |#ifdef ZXC_BIG_ENDIAN
 1389|       |    return ZXC_BSWAP32(v);
 1390|       |#else
 1391|  4.51G|    return v;
 1392|  4.51G|#endif
 1393|  4.51G|}
zxc_compress.c:zxc_le64:
 1448|   822M|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1449|   822M|    uint64_t v;
 1450|   822M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  168|   822M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1451|       |#ifdef ZXC_BIG_ENDIAN
 1452|       |    return ZXC_BSWAP64(v);
 1453|       |#else
 1454|   822M|    return v;
 1455|   822M|#endif
 1456|   822M|}
zxc_compress.c:zxc_ctz64:
 1677|   133M|static ZXC_ALWAYS_INLINE int zxc_ctz64(const uint64_t x) {
 1678|   133M|    if (x == 0) return 64;
  ------------------
  |  Branch (1678:9): [True: 0, False: 133M]
  ------------------
 1679|   133M|#if defined(__GNUC__) || defined(__clang__)
 1680|   133M|    return __builtin_ctzll(x);
 1681|       |#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64))
 1682|       |    unsigned long r;
 1683|       |    _BitScanForward64(&r, x);
 1684|       |    return (int)r;
 1685|       |#elif defined(_MSC_VER)
 1686|       |    // Use two 32-bit scans to avoid fragile 64-bit De Bruijn multiplication.
 1687|       |    unsigned long r;
 1688|       |    const uint32_t lo = (uint32_t)x;
 1689|       |    if (_BitScanForward(&r, lo)) return (int)r;
 1690|       |    _BitScanForward(&r, (uint32_t)(x >> 32));
 1691|       |    return 32 + (int)r;
 1692|       |#else
 1693|       |    return zxc_ctz64_debruijn(x);
 1694|       |#endif
 1695|   133M|}
zxc_compress.c:zxc_ctz32:
 1655|  3.37M|static ZXC_ALWAYS_INLINE int zxc_ctz32(const uint32_t x) {
 1656|  3.37M|    if (x == 0) return 32;
  ------------------
  |  Branch (1656:9): [True: 0, False: 3.37M]
  ------------------
 1657|  3.37M|#if defined(__GNUC__) || defined(__clang__)
 1658|  3.37M|    return __builtin_ctz(x);
 1659|       |#elif defined(_MSC_VER)
 1660|       |    unsigned long r;
 1661|       |    _BitScanForward(&r, x);
 1662|       |    return (int)r;
 1663|       |#else
 1664|       |    return zxc_ctz32_debruijn(x);
 1665|       |#endif
 1666|  3.37M|}
zxc_compress.c:zxc_copy32:
 1602|  1.07M|static ZXC_ALWAYS_INLINE void zxc_copy32(void* dst, const void* src) {
 1603|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
 1604|       |    // AVX2/AVX512: Single 256-bit (32 byte) unaligned load/store
 1605|       |    _mm256_storeu_si256((__m256i*)dst, _mm256_loadu_si256((const __m256i*)src));
 1606|       |#elif defined(ZXC_USE_SSE2)
 1607|       |    const __m128i a = _mm_loadu_si128((const __m128i*)src);
 1608|  1.07M|    const __m128i b = _mm_loadu_si128((const __m128i*)((const uint8_t*)src + 16));
 1609|  1.07M|    _mm_storeu_si128((__m128i*)dst, a);
 1610|  1.07M|    _mm_storeu_si128((__m128i*)((uint8_t*)dst + 16), b);
 1611|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1612|       |    const uint8x16_t a = vld1q_u8((const uint8_t*)src);
 1613|       |    const uint8x16_t b = vld1q_u8((const uint8_t*)src + 16);
 1614|       |    vst1q_u8((uint8_t*)dst, a);
 1615|       |    vst1q_u8((uint8_t*)dst + 16, b);
 1616|       |#elif defined(__riscv_misaligned_fast) && !defined(__riscv_vector)
 1617|       |    uint8_t a[16], b[16];
 1618|       |    ZXC_MEMCPY(a, src, 16);
 1619|       |    ZXC_MEMCPY(b, (const uint8_t*)src + 16, 16);
 1620|       |    ZXC_MEMCPY(dst, a, 16);
 1621|       |    ZXC_MEMCPY((uint8_t*)dst + 16, b, 16);
 1622|       |#else
 1623|       |    ZXC_MEMCPY(dst, src, 32);
 1624|       |#endif
 1625|  1.07M|}
zxc_compress.c:zxc_opt_dp_sizes:
 1129|  5.38k|                                               size_t* RESTRICT sz_bm) {
 1130|  5.38k|    *sz_dp = ZXC_ALIGN_CL((chunk_size + 1) * sizeof(uint32_t));
  ------------------
  |  |  384|  5.38k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1131|  5.38k|    *sz_pl = ZXC_ALIGN_CL((chunk_size + 1) * sizeof(uint16_t));
  ------------------
  |  |  384|  5.38k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1132|  5.38k|    *sz_po = ZXC_ALIGN_CL((chunk_size + 1) * sizeof(uint16_t));
  ------------------
  |  |  384|  5.38k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1133|  5.38k|    *sz_bm = ZXC_ALIGN_CL(ZXC_BITMAP_WORDS(chunk_size + 1) * sizeof(uint64_t));
  ------------------
  |  |  384|  5.38k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  382|  5.38k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  380|  5.38k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1134|  5.38k|}
zxc_compress.c:zxc_read_varint:
  630|  93.3k|static ZXC_ALWAYS_INLINE uint32_t zxc_read_varint(const uint8_t** ptr, const uint8_t* end) {
  631|  93.3k|    const uint8_t* p = *ptr;
  632|  93.3k|    if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  152|  93.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 93.3k]
  |  |  ------------------
  ------------------
                  if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  633|       |
  634|  93.3k|    const uint32_t b0 = p[0];
  635|       |
  636|       |    // 1 Byte: 0xxxxxxx (7 bits) -> val < 128 (2^7)
  637|  93.3k|    if (LIKELY(b0 < 0x80)) {
  ------------------
  |  |  146|  93.3k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 84.5k, False: 8.80k]
  |  |  ------------------
  ------------------
  638|  84.5k|        *ptr = p + 1;
  639|  84.5k|        return b0;
  640|  84.5k|    }
  641|       |
  642|       |    // 2 Bytes: 10xxxxxx xxxxxxxx (14 bits) -> val < 16384 (2^14)
  643|  8.80k|    if (LIKELY(b0 < 0xC0)) {
  ------------------
  |  |  146|  8.80k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 8.64k, False: 157]
  |  |  ------------------
  ------------------
  644|  8.64k|        if (UNLIKELY(p + 1 >= end)) {
  ------------------
  |  |  152|  8.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 8.64k]
  |  |  ------------------
  ------------------
  645|      0|            *ptr = end;
  646|      0|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  647|      0|        }
  648|  8.64k|        *ptr = p + 2;
  649|  8.64k|        return (b0 & 0x3F) | ((uint32_t)p[1] << 6);
  650|  8.64k|    }
  651|       |
  652|       |    // 3 Bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> val < 2^21. The longest
  653|       |    // a legitimate varint can be: values are (ll - MASK) or (ml - MASK), always
  654|       |    // strictly below block_size_max = 2^21.
  655|    157|    if (LIKELY(b0 < 0xE0)) {
  ------------------
  |  |  146|    157|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 157, False: 0]
  |  |  ------------------
  ------------------
  656|    157|        if (UNLIKELY(p + 2 >= end)) {
  ------------------
  |  |  152|    157|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 0, False: 157]
  |  |  ------------------
  ------------------
  657|      0|            *ptr = end;
  658|      0|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  659|      0|        }
  660|    157|        *ptr = p + 3;
  661|    157|        return (b0 & 0x1F) | ((uint32_t)p[1] << 5) | ((uint32_t)p[2] << 13);
  662|    157|    }
  663|       |
  664|       |    // extra encoding: out-of-spec for the current format, reject.
  665|      0|    *ptr = end;
  666|      0|    return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  667|    157|}
zxc_compress.c:zxc_ss_prem_rle_q8:
  965|  13.6k|static inline int zxc_ss_prem_rle_q8(const int level) {
  966|  13.6k|    return (level >= ZXC_LEVEL_DENSITY) ? 1 : (256 >> ZXC_RLE_MARGIN_SHIFT);
  ------------------
  |  |  892|  8.18k|#define ZXC_RLE_MARGIN_SHIFT 5
  ------------------
  |  Branch (966:12): [True: 5.43k, False: 8.18k]
  ------------------
  967|  13.6k|}
zxc_compress.c:zxc_huf_enc_max_code_len:
 1051|  11.4k|static inline int zxc_huf_enc_max_code_len(const int level) {
 1052|  11.4k|    return (level >= ZXC_LEVEL_ULTRA) ? ZXC_HUF_MAX_CODE_LEN_ULTRA : ZXC_HUF_MAX_CODE_LEN_DENSITY;
  ------------------
  |  |  826|  10.2k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
                  return (level >= ZXC_LEVEL_ULTRA) ? ZXC_HUF_MAX_CODE_LEN_ULTRA : ZXC_HUF_MAX_CODE_LEN_DENSITY;
  ------------------
  |  |  831|  1.13k|#define ZXC_HUF_MAX_CODE_LEN_DENSITY 8
  ------------------
  |  Branch (1052:12): [True: 10.2k, False: 1.13k]
  ------------------
 1053|  11.4k|}
zxc_compress.c:zxc_ss_prem_huf_q8:
  984|  5.71k|static inline int zxc_ss_prem_huf_q8(const int level) {
  985|  5.71k|    return (level >= ZXC_LEVEL_DENSITY) ? 4 : (256 >> ZXC_HUF_MARGIN_SHIFT);
  ------------------
  |  |  896|      0|#define ZXC_HUF_MARGIN_SHIFT 5
  ------------------
  |  Branch (985:12): [True: 5.71k, False: 0]
  ------------------
  986|  5.71k|}
zxc_decompress.c:zxc_block_header_ok:
 1537|   146k|static ZXC_ALWAYS_INLINE int zxc_block_header_ok(const uint8_t* p) {
 1538|   146k|    uint8_t temp[ZXC_BLOCK_HEADER_SIZE];
 1539|   146k|    ZXC_MEMCPY(temp, p, ZXC_BLOCK_HEADER_SIZE);
  ------------------
  |  |  168|   146k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1540|   146k|    temp[7] = 0;  // The checksum covers the header with its own byte zeroed
 1541|   146k|    return p[7] == zxc_hash8(temp) && (p[1] | p[2]) == 0;
  ------------------
  |  Branch (1541:12): [True: 109k, False: 37.0k]
  |  Branch (1541:39): [True: 109k, False: 147]
  ------------------
 1542|   146k|}
zxc_decompress.c:zxc_hash8:
 1524|   146k|static ZXC_ALWAYS_INLINE uint8_t zxc_hash8(const uint8_t* p) {
 1525|   146k|    const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  797|   146k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
                  const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  797|   146k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1526|       |
 1527|   146k|    return (uint8_t)(h >> 56);
 1528|   146k|}
zxc_decompress.c:zxc_le64:
 1448|  3.44M|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1449|  3.44M|    uint64_t v;
 1450|  3.44M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  168|  3.44M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1451|       |#ifdef ZXC_BIG_ENDIAN
 1452|       |    return ZXC_BSWAP64(v);
 1453|       |#else
 1454|  3.44M|    return v;
 1455|  3.44M|#endif
 1456|  3.44M|}
zxc_decompress.c:zxc_le32:
 1385|  7.59M|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1386|  7.59M|    uint32_t v;
 1387|  7.59M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  168|  7.59M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1388|       |#ifdef ZXC_BIG_ENDIAN
 1389|       |    return ZXC_BSWAP32(v);
 1390|       |#else
 1391|  7.59M|    return v;
 1392|  7.59M|#endif
 1393|  7.59M|}
zxc_decompress.c:zxc_copy32:
 1602|  51.7M|static ZXC_ALWAYS_INLINE void zxc_copy32(void* dst, const void* src) {
 1603|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
 1604|       |    // AVX2/AVX512: Single 256-bit (32 byte) unaligned load/store
 1605|       |    _mm256_storeu_si256((__m256i*)dst, _mm256_loadu_si256((const __m256i*)src));
 1606|       |#elif defined(ZXC_USE_SSE2)
 1607|       |    const __m128i a = _mm_loadu_si128((const __m128i*)src);
 1608|  51.7M|    const __m128i b = _mm_loadu_si128((const __m128i*)((const uint8_t*)src + 16));
 1609|  51.7M|    _mm_storeu_si128((__m128i*)dst, a);
 1610|  51.7M|    _mm_storeu_si128((__m128i*)((uint8_t*)dst + 16), b);
 1611|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1612|       |    const uint8x16_t a = vld1q_u8((const uint8_t*)src);
 1613|       |    const uint8x16_t b = vld1q_u8((const uint8_t*)src + 16);
 1614|       |    vst1q_u8((uint8_t*)dst, a);
 1615|       |    vst1q_u8((uint8_t*)dst + 16, b);
 1616|       |#elif defined(__riscv_misaligned_fast) && !defined(__riscv_vector)
 1617|       |    uint8_t a[16], b[16];
 1618|       |    ZXC_MEMCPY(a, src, 16);
 1619|       |    ZXC_MEMCPY(b, (const uint8_t*)src + 16, 16);
 1620|       |    ZXC_MEMCPY(dst, a, 16);
 1621|       |    ZXC_MEMCPY((uint8_t*)dst + 16, b, 16);
 1622|       |#else
 1623|       |    ZXC_MEMCPY(dst, src, 32);
 1624|       |#endif
 1625|  51.7M|}
zxc_decompress.c:zxc_read_varint:
  630|  4.63M|static ZXC_ALWAYS_INLINE uint32_t zxc_read_varint(const uint8_t** ptr, const uint8_t* end) {
  631|  4.63M|    const uint8_t* p = *ptr;
  632|  4.63M|    if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  152|  4.63M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 2.18k, False: 4.63M]
  |  |  ------------------
  ------------------
                  if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|  2.18k|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|  2.18k|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  2.18k|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  633|       |
  634|  4.63M|    const uint32_t b0 = p[0];
  635|       |
  636|       |    // 1 Byte: 0xxxxxxx (7 bits) -> val < 128 (2^7)
  637|  4.63M|    if (LIKELY(b0 < 0x80)) {
  ------------------
  |  |  146|  4.63M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 3.82M, False: 814k]
  |  |  ------------------
  ------------------
  638|  3.82M|        *ptr = p + 1;
  639|  3.82M|        return b0;
  640|  3.82M|    }
  641|       |
  642|       |    // 2 Bytes: 10xxxxxx xxxxxxxx (14 bits) -> val < 16384 (2^14)
  643|   814k|    if (LIKELY(b0 < 0xC0)) {
  ------------------
  |  |  146|   814k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 795k, False: 18.9k]
  |  |  ------------------
  ------------------
  644|   795k|        if (UNLIKELY(p + 1 >= end)) {
  ------------------
  |  |  152|   795k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 728, False: 794k]
  |  |  ------------------
  ------------------
  645|    728|            *ptr = end;
  646|    728|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|    728|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|    728|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|    728|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  647|    728|        }
  648|   794k|        *ptr = p + 2;
  649|   794k|        return (b0 & 0x3F) | ((uint32_t)p[1] << 6);
  650|   795k|    }
  651|       |
  652|       |    // 3 Bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> val < 2^21. The longest
  653|       |    // a legitimate varint can be: values are (ll - MASK) or (ml - MASK), always
  654|       |    // strictly below block_size_max = 2^21.
  655|  18.9k|    if (LIKELY(b0 < 0xE0)) {
  ------------------
  |  |  146|  18.9k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (146:19): [True: 15.9k, False: 3.02k]
  |  |  ------------------
  ------------------
  656|  15.9k|        if (UNLIKELY(p + 2 >= end)) {
  ------------------
  |  |  152|  15.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (152:21): [True: 738, False: 15.2k]
  |  |  ------------------
  ------------------
  657|    738|            *ptr = end;
  658|    738|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|    738|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|    738|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|    738|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  659|    738|        }
  660|  15.2k|        *ptr = p + 3;
  661|  15.2k|        return (b0 & 0x1F) | ((uint32_t)p[1] << 5) | ((uint32_t)p[2] << 13);
  662|  15.9k|    }
  663|       |
  664|       |    // extra encoding: out-of-spec for the current format, reject.
  665|  3.02k|    *ptr = end;
  666|  3.02k|    return ZXC_VARINT_INVALID;
  ------------------
  |  |  597|  3.02k|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|  3.02k|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|  3.02k|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  667|  18.9k|}
zxc_decompress.c:zxc_copy16:
 1582|  16.7M|static ZXC_ALWAYS_INLINE void zxc_copy16(void* dst, const void* src) {
 1583|  16.7M|#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512) || defined(ZXC_USE_SSE2)
 1584|       |    // x86 SSE2/AVX2/AVX512: Single 128-bit unaligned load/store
 1585|  16.7M|    _mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src));
 1586|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1587|       |    vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));
 1588|       |#else
 1589|       |    ZXC_MEMCPY(dst, src, 16);
 1590|       |#endif
 1591|  16.7M|}
zxc_decompress.c:zxc_le16:
 1366|   172k|static ZXC_ALWAYS_INLINE uint16_t zxc_le16(const void* p) {
 1367|   172k|    uint16_t v;
 1368|   172k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  168|   172k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1369|       |#ifdef ZXC_BIG_ENDIAN
 1370|       |    return ZXC_BSWAP16(v);
 1371|       |#else
 1372|   172k|    return v;
 1373|   172k|#endif
 1374|   172k|}
zxc_decompress.c:zxc_checksum:
 1732|  41.1k|                                               const uint64_t seed, const uint8_t hash_method) {
 1733|  41.1k|    (void)hash_method; /* single algorithm for now; extend when adding more */
 1734|  41.1k|    const uint64_t hash = rapidhash_withSeed(input, len, seed);
 1735|       |
 1736|       |    return (uint32_t)(hash ^ (hash >> (sizeof(uint32_t) * CHAR_BIT)));
 1737|  41.1k|}
zxc_dispatch.c:zxc_validate_block_size:
 1178|  52.9k|static ZXC_ALWAYS_INLINE int zxc_validate_block_size(const size_t bs) {
 1179|  52.9k|    return bs >= ZXC_BLOCK_SIZE_MIN && bs <= ZXC_BLOCK_SIZE_MAX && (bs & (bs - 1)) == 0;
  ------------------
  |  |   73|   105k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  52.9k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
                  return bs >= ZXC_BLOCK_SIZE_MIN && bs <= ZXC_BLOCK_SIZE_MAX && (bs & (bs - 1)) == 0;
  ------------------
  |  |   75|   105k|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  ------------------
  |  |  |  |   69|  52.9k|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  ------------------
  ------------------
  |  Branch (1179:12): [True: 52.9k, False: 0]
  |  Branch (1179:40): [True: 52.9k, False: 0]
  |  Branch (1179:68): [True: 52.9k, False: 0]
  ------------------
 1180|  52.9k|}
zxc_dispatch.c:zxc_block_size_ceil:
 1159|   123k|static ZXC_ALWAYS_INLINE size_t zxc_block_size_ceil(const size_t v) {
 1160|   123k|    uint64_t x = (uint64_t)v - 1;
 1161|   123k|    x |= x >> 1;
 1162|   123k|    x |= x >> 2;
 1163|   123k|    x |= x >> 4;
 1164|   123k|    x |= x >> 8;
 1165|   123k|    x |= x >> 16;
 1166|   123k|    x |= x >> 32;
 1167|   123k|    x++;
 1168|   123k|    const size_t bs = (size_t)x;
 1169|   123k|    return (bs < ZXC_BLOCK_SIZE_MIN) ? ZXC_BLOCK_SIZE_MIN : bs;
  ------------------
  |  |   73|   123k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|   123k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
                  return (bs < ZXC_BLOCK_SIZE_MIN) ? ZXC_BLOCK_SIZE_MIN : bs;
  ------------------
  |  |   73|  56.6k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  56.6k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
  |  Branch (1169:12): [True: 56.6k, False: 66.6k]
  ------------------
 1170|   123k|}
zxc_huffman.c:zxc_log2_u32:
 1145|   311M|static ZXC_ALWAYS_INLINE uint32_t zxc_log2_u32(const uint32_t v) {
 1146|       |#ifdef _MSC_VER
 1147|       |    unsigned long index;
 1148|       |    return (v == 0) ? 0 : (_BitScanReverse(&index, v) ? index : 0);
 1149|       |#else
 1150|   311M|    return (v == 0) ? 0 : (uint32_t)(31 - __builtin_clz(v));
  ------------------
  |  Branch (1150:12): [True: 0, False: 311M]
  ------------------
 1151|   311M|#endif
 1152|   311M|}

LLVMFuzzerTestOneInput:
   74|  17.6k|int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   75|  17.6k|    if (size < FUZZ_BLOCK_CTRL || size > FUZZ_BLOCK_MAX_INPUT) return 0;
  ------------------
  |  |   34|  35.2k|#define FUZZ_BLOCK_CTRL 4                /* control bytes consumed below */
  ------------------
                  if (size < FUZZ_BLOCK_CTRL || size > FUZZ_BLOCK_MAX_INPUT) return 0;
  ------------------
  |  |   33|  17.6k|#define FUZZ_BLOCK_MAX_INPUT (256 << 10) /* 256 KiB of fuzzer bytes */
  ------------------
  |  Branch (75:9): [True: 2, False: 17.6k]
  |  Branch (75:35): [True: 4, False: 17.6k]
  ------------------
   76|  17.6k|    const int level = (int)(data[0] % (unsigned)zxc_max_level()) + 1;
   77|  17.6k|    const int checksum = data[1] & 1;
   78|  17.6k|    const size_t k = (size_t)((data[1] >> 1) % N_SIZES);
  ------------------
  |  |   35|  17.6k|#define N_SIZES 3
  ------------------
   79|  17.6k|    const size_t bs = kBlockSizes[k];
   80|       |    // Raw-decode capacity, 1 .. 2^18.
   81|  17.6k|    const size_t raw_cap = ((size_t)data[2] << 10 | (size_t)data[3] << 2 | (data[1] >> 6)) + 1;
   82|  17.6k|    data += FUZZ_BLOCK_CTRL;
  ------------------
  |  |   34|  17.6k|#define FUZZ_BLOCK_CTRL 4                /* control bytes consumed below */
  ------------------
   83|  17.6k|    size -= FUZZ_BLOCK_CTRL;
  ------------------
  |  |   34|  17.6k|#define FUZZ_BLOCK_CTRL 4                /* control bytes consumed below */
  ------------------
   84|  17.6k|    if (size == 0) return 0;
  ------------------
  |  Branch (84:9): [True: 1, False: 17.6k]
  ------------------
   85|       |
   86|  17.6k|    zxc_dctx* const heap = zxc_create_dctx();
   87|  17.6k|    if (!heap) return 0;
  ------------------
  |  Branch (87:9): [True: 0, False: 17.6k]
  ------------------
   88|  17.6k|    if (zxc_dctx_set_param(heap, ZXC_D_CHECKSUM, checksum) != ZXC_OK) {
  ------------------
  |  Branch (88:9): [True: 0, False: 17.6k]
  ------------------
   89|      0|        zxc_free_dctx(heap);
   90|      0|        return 0;
   91|      0|    }
   92|       |
   93|       |    /* 1. Raw input as a block. */
   94|  17.6k|    {
   95|  17.6k|        uint8_t *fast = NULL, *safe = NULL, *stat = NULL;
   96|  17.6k|        const int64_t rf = decode(heap, 0, data, size, raw_cap, &fast);
   97|  17.6k|        const int64_t rs = decode(heap, 1, data, size, raw_cap, &safe);
   98|  17.6k|        agree(rf, fast, rs, safe);
   99|  17.6k|        zxc_dctx* const sd = static_dctx(k, checksum);
  100|  17.6k|        if (sd) {
  ------------------
  |  Branch (100:13): [True: 17.6k, False: 0]
  ------------------
  101|  17.6k|            const int64_t rt = decode(sd, 1, data, size, raw_cap, &stat);
  102|  17.6k|            agree(rs, safe, rt, stat);
  103|  17.6k|        }
  104|  17.6k|        free(fast);
  105|  17.6k|        free(safe);
  106|  17.6k|        free(stat);
  107|  17.6k|    }
  108|       |
  109|       |    /* 2. Round trip of one block of at most bs bytes. */
  110|  17.6k|    const size_t n = size < bs ? size : bs;
  ------------------
  |  Branch (110:22): [True: 17.5k, False: 93]
  ------------------
  111|  17.6k|    const size_t cb = zxc_compress_block_bound(n);
  112|  17.6k|    zxc_cctx* const cctx = zxc_create_cctx();
  113|  17.6k|    const int configured = cctx && zxc_cctx_set_param(cctx, ZXC_C_LEVEL, level) == ZXC_OK &&
  ------------------
  |  Branch (113:28): [True: 17.6k, False: 0]
  |  Branch (113:36): [True: 17.6k, False: 0]
  ------------------
  114|  17.6k|                           zxc_cctx_set_param(cctx, ZXC_C_CHECKSUM, checksum) == ZXC_OK &&
  ------------------
  |  Branch (114:28): [True: 17.6k, False: 0]
  ------------------
  115|  17.6k|                           zxc_cctx_set_param(cctx, ZXC_C_BLOCK_SIZE, (int64_t)bs) == ZXC_OK;
  ------------------
  |  Branch (115:28): [True: 17.6k, False: 0]
  ------------------
  116|  17.6k|    uint8_t* const comp = cb ? (uint8_t*)malloc(cb) : NULL;
  ------------------
  |  Branch (116:27): [True: 17.6k, False: 0]
  ------------------
  117|  17.6k|    const int64_t c = (configured && comp) ? zxc_compress_block(cctx, data, n, comp, cb) : -1;
  ------------------
  |  Branch (117:24): [True: 17.6k, False: 0]
  |  Branch (117:38): [True: 17.6k, False: 0]
  ------------------
  118|  17.6k|    if (c > 0) {
  ------------------
  |  Branch (118:9): [True: 17.6k, False: 0]
  ------------------
  119|  17.6k|        const size_t len = (size_t)c;
  120|  17.6k|        const size_t padded = (size_t)zxc_decompress_block_bound(n);
  121|  17.6k|        uint8_t* out = NULL;
  122|  17.6k|        int64_t r;
  123|       |
  124|  17.6k|        r = decode(heap, 0, comp, len, padded, &out);
  125|  17.6k|        assert(r == (int64_t)n && memcmp(out, data, n) == 0);
  ------------------
  |  Branch (125:9): [True: 0, False: 17.6k]
  |  Branch (125:9): [True: 0, False: 0]
  |  Branch (125:9): [True: 17.6k, False: 0]
  |  Branch (125:9): [True: 17.6k, False: 0]
  ------------------
  126|  17.6k|        free(out);
  127|  17.6k|        r = decode(heap, 0, comp, len, n, &out);
  128|  17.6k|        assert(r == (int64_t)n && memcmp(out, data, n) == 0);
  ------------------
  |  Branch (128:9): [True: 0, False: 17.6k]
  |  Branch (128:9): [True: 0, False: 0]
  |  Branch (128:9): [True: 17.6k, False: 0]
  |  Branch (128:9): [True: 17.6k, False: 0]
  ------------------
  129|  17.6k|        free(out);
  130|  17.6k|        r = decode(heap, 1, comp, len, n, &out);
  131|  17.6k|        assert(r == (int64_t)n && memcmp(out, data, n) == 0);
  ------------------
  |  Branch (131:9): [True: 0, False: 17.6k]
  |  Branch (131:9): [True: 0, False: 0]
  |  Branch (131:9): [True: 17.6k, False: 0]
  |  Branch (131:9): [True: 17.6k, False: 0]
  ------------------
  132|  17.6k|        free(out);
  133|  17.6k|        zxc_dctx* const sd = static_dctx(k, checksum);
  134|  17.6k|        if (sd) {
  ------------------
  |  Branch (134:13): [True: 17.6k, False: 0]
  ------------------
  135|  17.6k|            r = decode(sd, 1, comp, len, n, &out);
  136|  17.6k|            assert(r == (int64_t)n && memcmp(out, data, n) == 0);
  ------------------
  |  Branch (136:13): [True: 0, False: 17.6k]
  |  Branch (136:13): [True: 0, False: 0]
  |  Branch (136:13): [True: 17.6k, False: 0]
  |  Branch (136:13): [True: 17.6k, False: 0]
  ------------------
  137|  17.6k|            free(out);
  138|  17.6k|        }
  139|       |
  140|       |        // Truncated: a block's length is part of its header, so any cut fails.
  141|  17.6k|        r = decode(heap, 1, comp, len - 1, n, &out);
  142|  17.6k|        assert(r < 0);
  ------------------
  |  Branch (142:9): [True: 0, False: 17.6k]
  |  Branch (142:9): [True: 17.6k, False: 0]
  ------------------
  143|  17.6k|        free(out);
  144|  17.6k|        (void)r;
  145|  17.6k|    }
  146|  17.6k|    free(comp);
  147|  17.6k|    zxc_free_cctx(cctx);
  148|  17.6k|    zxc_free_dctx(heap);
  149|  17.6k|    return 0;
  150|  17.6k|}
fuzz_block.c:decode:
   56|   141k|                      const size_t cap, uint8_t** out) {
   57|   141k|    uint8_t* const dst = (uint8_t*)malloc(cap);
   58|   141k|    if (!dst) return INT64_MIN;
  ------------------
  |  Branch (58:9): [True: 0, False: 141k]
  ------------------
   59|   141k|    const int64_t r = safe ? zxc_decompress_block_safe(d, src, len, dst, cap)
  ------------------
  |  Branch (59:23): [True: 88.1k, False: 52.9k]
  ------------------
   60|   141k|                           : zxc_decompress_block(d, src, len, dst, cap);
   61|   141k|    assert(r < 0 || (size_t)r <= cap);
  ------------------
  |  Branch (61:5): [True: 141k, False: 0]
  |  Branch (61:5): [True: 0, False: 0]
  |  Branch (61:5): [True: 69.8k, False: 71.2k]
  |  Branch (61:5): [True: 71.2k, False: 0]
  ------------------
   62|   141k|    *out = dst;
   63|   141k|    return r;
   64|   141k|}
fuzz_block.c:agree:
   67|  35.2k|static void agree(const int64_t r1, const uint8_t* b1, const int64_t r2, const uint8_t* b2) {
   68|  35.2k|    if (r1 > 0 && r2 > 0) {
  ------------------
  |  Branch (68:9): [True: 492, False: 34.7k]
  |  Branch (68:19): [True: 354, False: 138]
  ------------------
   69|    354|        assert(r1 == r2);
  ------------------
  |  Branch (69:9): [True: 0, False: 354]
  |  Branch (69:9): [True: 354, False: 0]
  ------------------
   70|    354|        assert(memcmp(b1, b2, (size_t)r1) == 0);
  ------------------
  |  Branch (70:9): [True: 0, False: 354]
  |  Branch (70:9): [True: 354, False: 0]
  ------------------
   71|    354|    }
   72|  35.2k|}
fuzz_block.c:static_dctx:
   41|  35.2k|static zxc_dctx* static_dctx(const size_t k, const int checksum) {
   42|  35.2k|    static void* ws[N_SIZES];
   43|  35.2k|    static size_t ws_size[N_SIZES];
   44|  35.2k|    if (!ws[k]) {
  ------------------
  |  Branch (44:9): [True: 3, False: 35.2k]
  ------------------
   45|      3|        ws_size[k] = (zxc_static_dctx_workspace_size(kBlockSizes[k]) + 63) & ~(size_t)63;
   46|      3|        ws[k] = aligned_alloc(64, ws_size[k]);
   47|      3|        if (!ws[k]) return NULL;
  ------------------
  |  Branch (47:13): [True: 0, False: 3]
  ------------------
   48|      3|    }
   49|  35.2k|    zxc_dctx* const d = zxc_init_static_dctx(ws[k], ws_size[k], kBlockSizes[k]);
   50|  35.2k|    if (d && zxc_dctx_set_param(d, ZXC_D_CHECKSUM, checksum) != ZXC_OK) return NULL;
  ------------------
  |  Branch (50:9): [True: 35.2k, False: 0]
  |  Branch (50:14): [True: 0, False: 35.2k]
  ------------------
   51|  35.2k|    return d;
   52|  35.2k|}

